Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many changes for your consideration #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Many changes for your consideration #13

wants to merge 5 commits into from

Conversation

JakeH
Copy link

@JakeH JakeH commented Jan 6, 2013

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.)
    Index
  • 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 Stream to 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.

Jacob Hickman added 5 commits January 2, 2013 20:46
Wanted to add support for TypeScript. Wound up going anti-pattern to
what Docco was originally meant for. しょうがないね
Added a new parse module to handle cases where commenting and code exist
on the same line. Added more options, move settings to separate file.
Began adding tests.
Re-added the inline index drop down. Added CLI arguments to control the
generation of the standalone index file, the inline index and to
truncate output directory before starting the job.
@ashclarke
Copy link

👍

1 similar comment
@vai
Copy link

vai commented Jul 27, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants