Code Monkey home page Code Monkey logo

hads's Introduction

Hey it's Another Documentation Server! (hads)

NPM version Node version Downloads License

The master of hell docs

Hads is a fast Node.js based web server allowing to browse, search and edit documentation written in Markdown.

screenshot

Features:

  • No configuration needed
  • Github-like presentation
  • GFM (Github Flavoured Markdown)
  • Automatic indexation and search
  • In-browser editor
  • Table of contents using Markdown extension [[toc]]
  • Navigation index using Markdown extension [[index]]
  • Diagrams and flowcharts using Mermaid syntax
  • Drag'n drop images
  • 100% offline
  • Production Mode. No edition possible
  • Possibility to hook Templates and Public files
  • Load plugins from your local installation (useful to add contact form etc..)

Usage

npm install -g hads
hads -o

Your browser will open http://localhost:4040 and display your project documentation.

Command-line options

Usage: hads [root dir] [options]

Options:
  -p, --port        Port number to listen on       [default: 4040]
  -h, --host        Host address to bind to        [default: "localhost"]
  -i, --images-dir  Directory to store images      [default: "images"]
  -x, --production  Production Mode. No edition possible
  -d, --directory   Specify a starting directory 
  -o, --open        Open default browser on start
  --help            Show this help

If no root dir is specified, ./ will be used.

Extras

Home page

The server will automatically search for a file named index.md, readme.md or README.md on the specified documentation root and will use it as your home page.

Table of contents

The special text [[toc]] will be replaced by the table of contents of the markdown document, based on headings.

Navigation index

The special text [[index]] will be replaced by the full navigation index of all markdown files found under the specified root dir. File and folder names will be humanized for better readability.

It is particularly useful on the home page to provide an overview of the available documentation for your project.

Diagrams and flowcharts

You can use the Mermaid syntax to insert diagrams and flowcharts directly in your markdown, but using code blocks with the mermaid language specified, like this:

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```

Local Dynamic Hooking

You can set your own template by creating a __hads/ directory in your root path.

  • You can add your own public files in __hads/public/ which is accecible from http:///_hads/ (w/ only one underscore)
  • You can overload the PUG templates used internally in __hads/views/ as following:
  • add.pug: Add template
  • edit.pug: Edit Template
  • file.pug: File Templater
  • footer.pug: Footer
  • header.pug: Header
  • layout.pug: General layout

Creating a plugin

Create __hads/plugins/myplugin directory into your installation, create a file __hads/plugins/myplugin/hads.js and add the following lines in it:

module.exports = function(app, rewriteDirectory) {
	console.log('hello world!');
}

The app variable is the Express.js object where you can add new routes. You can add a package.json into your plugin directory if you need to add some dependencies.

Updates

See changelog here

hads's People

Contributors

mykiimike avatar sinedied avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.