Skip to content

Markdown-to-HTML documentation generator featuring a plethora of added bells and whistles.

License

Notifications You must be signed in to change notification settings

dustin-ruetz/documentastic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

documentastic

A Markdown-to-HTML documentation generator that is feature-rich, customizable, lightweight, and platform-agnostic.

This tool was developed with the intention of being used locally, i.e. md-docs/*.md files compile to html-docs/*.html files, the latter of which can be viewed locally in any browser regardless of device. If you want to see an example of the input/output or learn more about Markdown, open the md-docs/markdown.md and html-docs/markdown.html files and compare them.

My personal use-case employs Resilio Sync to synchronize the contents of html-docs/ to my phone, which ensures I always have access to my documentation on my two primary computing platforms.

Purpose

Documentation is an invaluable tool in development (and, as I have found, also in life). The goal of this project is as follows:

  1. To use the elegant simplicity of Markdown to write maintainable, well-formatted documentation;
  2. To dynamically generate a table-of-contents (TOC) from the document's headings;
  3. To compile the Markdown file into a responsive, spec-compliant, platform-agnostic HTML document; and
  4. If desired, to be able to print out documentation and have it be well-formed.

Installation

  1. Prerequisite: Have Node.js installed.
  2. Download a clone/copy of this repository.
  3. Open a terminal window at the root of the repository.
  4. Run npm install to download all dependencies.

Usage

  1. Make a copy of md-docs/template.md and rename it.
  2. Run npm run gulp to start the tasks.
  3. Open the new file and document until your heart is content.

Features

  • Lightweight: All features are written in vanilla JavaScript and run server-side via the gulp task. The only JavaScript that runs client-side is jquery-smooth-scroll (see below for more details).
  • Efficient: Only the documentation files that have been modified are run through the task. Courtesy of gulp-changed.
  • Table of Contents: Manually trying to maintain TOCs is a headache. This is why Documentastic uses gulp-doctoc to automatically generate a dynamic TOC for you based on the structure of your document's headings.
  • Easy to read, easy to write: Reading and writing in Markdown couldn't be simpler... as long as you're at a computer. If you're on a mobile device, why should you download yet another app just to read Markdown files? Documentastic uses gulp-marked to compile your Markdown files into platform-agnostic HTML documents, allowing you to read them in any browser.
  • Syntax highlighting: Code syntax highlighting is done server-side within the gulp-marked task courtesy of prism.js.
  • Function or form - why not both?: For best browser compatibility and to avoid nasty surprises, HTML documents should be well-formed and comply with the W3C specification.
    • Documentastic keeps your working Markdown file clean and your compiled HTML document compliant by using gulp-inject to inject HTML code partials containing the required <doctype>, <html>, <head>, and <body> tags.
  • DOM manipulation: Documentastic uses gulp-dom to:
    • Set a title for all documents;
    • Set attributes on external links; and
    • Convert Markdown [x] checkboxes into HTML <input type="checkbox"> elements.
  • Minimal disk space: Compiled HTML code is minified courtesy of gulp-htmlmin.
  • Platform-agnostic: Free yourself from the chains of platform dependency and vendor lock-in. As long as you have a browser, you can read your documents.
  • Responsive: Documents are responsive and will scale gracefully according to device screen size.
  • Stylin': CSS styling courtesy of the GitHub Markdown Stylesheet.
  • Smooth moves: Smooth-scrolling is added to all internal links (i.e. everything in the document's TOC) courtesy of jquery-smooth-scroll.
  • Printer-friendly: Documents are printer-friendly by default.

License

MIT License

Copyright 2017 Dustin Ruetz.

About

Markdown-to-HTML documentation generator featuring a plethora of added bells and whistles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published