Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Comment Book

Comment Book extracts the comments from your code and converts them to Markdown.

To use it, copy comment-book.py into your repo and run:

python comment-book.py

The Markdown file can be converted to icml, a format that InDesign will consume for styling and layout. To do this, first download pandoc. Then run

pandoc -s -f markdown -t icml -o my-book.icml my-book.md

The provided python file will probably need some tweaking for your repo's tastes. For example, you might have to add a case to the switch statement that checks a file's extension and applies the revelant regexes.

Regexes Used

These aren't always perfect - one major problem is that they don't check if they are part of a string. But they get the job done. Pull requests welcome!

// comment

(?<!http:)\/\/.*\n

/* comment */

\/\*.*?\*\/

<!-- comment -->

\<!--.*?--\>

{* comment *}

{\*.*?\*}

# comment

#.*\n

''' comment '''

'''.*?'''

About

turn your repository's comments into a book.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages