readme is a cli tool to extract markdown text from source code files
After trying some of doc builder tools I couldn't find anything that realy suits my needs, so decided to write my own
- be able to write doc block within source file
- having some useful vars to build the docs, like TODO tags
- build only one and huge readme indexed file
TODO: Write installation instructions here
readme 0.1.1
cli tool to extract markdown text from source code files
USAGE:
readme [OPTIONS] [PATH]
ARGS:
<PATH>
OPTIONS:
-f, --file-type <FILE_TYPE> file types to filter by in a regex pattern
-h, --help Print help information
-n, --no-recursive whether or not to look for files recursively
-s, --show-context prints context and exit
-t, --template <TEMPLATE> Handlebars template file
-V, --version Print version information
TODO: Write development instructions here
- having TODO/BUG/FIX dictionary would be nice to get it more feature rich
- needs to improve template error handling
- Fork it (https://github.com/quirinux/readme/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- QuirinuX - creator and maintainer
The following was generated using readme itself :-), check out how it is done on README.md.hbs.
Handlebar VM context Default comment regex: r"^(\s|\t)*(#|//)\s?>"
Default embedded template ../templates/default.hbs
Each matching file is registered internaly like an item as follows and all of them are made avialable on vm context:
- absolute: handles the absolute file path
- relative: handles the file relative path to pwd
- content: file content itself
This is the entry point
TODO: a better error handling is fairly much appreciated showing more about templating and parsing error them rust display trait
this is where the vm is orchestrated
Aiming having a richier templating engine some new functions were created to make readme usage easier to work with:
joins multiple string in one
Mandatory args:
- x: Veac, array of strings to get joined with
Optional args:
- with: str = "\n", string used to join
Return:
- string, resulted joined string
to include another file content, no parsing or process is ran against it
Mandatory args:
- path: , file path to include, fails if file does not exist
Return:
- string, file content within a single string
TODO:
- include the file on processing context instead of raw, making it possible to be a handlebar file
this is supposed to be a rust file with
some nice comments in it
this is supposed to be a python file with
some nice comments in it
this is supposed to be a ruby file with
some nice comments in it