nocco
nocco copied to clipboard
Many changes for your consideration
Over the holiday week, I did some major changes to this project as it's something I'd like to use for a large TypeScript project I'm working on.
Changes include:
- Index file generated with comment/code snippet previews. (Current implementation is rather boring, but that can be changed with the template file.)

- External configuration file for most application settings.
- Robust command line options for specific job handling as well as some default app setting overrides. e.g. nocco.exe -p c:\src -o c:\docs -t cs -n "My Project Name" --fullindex --inlineindex
- Language configuration loaded via JSON-formatted external file.
- Language definitions boiled down to easier-to-use values:
{
"StartsWith": "/*",
"EndsWith": "*/",
"TrimFromStart":[ "*"],
"IgnoreRepeatingChars" : "true"
}
IgnoreRepeatingChars makes the comment token /* match itself or /***** and the token */ would also match ******/
StartsWith and EndsWith are literal values, not regular expression patterns.
Languages can have many comment directives.
- Comment parser is more complex, returning a line-by-line detail of the exact code and comments extracted, with details on which comment directive was used to match.
- Multi-line comments are now handled
- Self-closing comments inline with code are now handled.
/* comment */ var x = false; /* comment 2 */
- Comment syntax within string literals are now ignored.
var x = 'this /* is not */ a //comment'; // but this is
- Parsing of source files is done via a
Streamto avoid loading the entire file into memory. Summary of the parsing, however, is kept around to build an index file at the end. - Unit tests have been introduced. Current tests are for the code parser and comment cleaner.
- Code is self-documenting or otherwise commented appropriately.
:+1:
:+1: