You can pass an argument to the cli to change the input folder (by defaultdocs). That will change the output folder too to_FOLDERNAME(by default_docs).
markdown-folder-to-html documentation
# Outputs site to _documentation
If you want to change the output folder name, justmvit to something else.
Custom HTML
The default HTML is extremely basic, butsimple and pretty, and is the one used in the docs.
Create your own in your docs folderdocs/template.htmlto use that one instead. Feel free to include styles inline or CSS files (since all will be copied to output).
Order
You may have noticed that files are sorted alphabetically. There's a little trick where if you name your folders/files with XX-folder/XX-file (XX being a number of 1+ digits) those numbers won't show up on the index of the pages, giving you the ability to organize files both in the filesystem and in the generated HTML site.
Also, the rootindex.mdfile will always show up at the beginning of the index.
Site contents and information for custom templates
If you want to do things with a custom template HTML you need the information of the site. This will allow you to do things in the front-end UI, like adding search to the static site with lunrjs or other things like adding buttons for the next/previous article.
For this use cases, you will see acontents.jsongenerated in your output folder. It contains the hierarchical paths of the files, and the contents with the original markup, the HTML, the original path and the transformed URL:
See theJSON fileof our documentation site for an example.
You can then fetch this JSON file with JS from your template, and go crazy with it, processing the contents to adapt them for search, looking for the previous/next articles to link to them, etc.
If you have working examples of a template that does something interesting, please let me know and I'll list them here!
Why
After quite a lot of research, I couldn't find a simple and straightforward solution to generating html docs from a folder full of markdown files that relied on simple concepts. That is what this tool does:
Simply copy everything over, and translate .md files to .html with a pure HTML layout (feel free to add CSS, or JS, or precompile those assets if you need to)
.md links are rewritten to .html so that you can reference files with their real path on your markdown files and they'll work on the HTML version too.
Provide sensible defaults and zero-configuration. JUST WORK.
Use know abstraction, like the file system, pure HTML, etc