49

Generate a Blog or project documentation from Markdown using Node.js

 5 years ago
source link: https://www.tuicool.com/articles/hit/6biMRj3
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Markdown Site Engine

Make your project documentation (or blog, or something else) with Markdown.

Demo: https://petersamokhin.com/markdown-site/demo

Features

  • HTML-generating on-the-fly from the Markdown files.
  • Generating of navigation on-the-fly.
  • Dynamic permissions management:
    • Each user has a list of roles (roles are like GitHub's organization's groups).
    • Each page and directory should have a list of roles.
    • User can see the page (in navigation too) if he has at least one role from page's list.
  • Search on all pages depending on access rights of current user.
  • Preview of result html page in creating page.
  • All settings and access rights are fully configurable (using admin panel or changing the code).
  • Too easy to add new setting — admin panel is generated too. You simply need to add new setting and default value, and then you will be able to configure it in admin panel.
  • You can simply copy your markdown files to views/pages/ and (if it necessary) manage access to paths — and then your documentation is ready :) All new pages and directories will be indexed at next page loading.
  • Nice looking & adaptive design for all screen sizes.
  • Other small but useful features:
    #link
    kramdown
    Main pages folder
    Main pages folder
    

Sample

This readme page after rendering:

bU3QVbv.png!web

And mobile version (iPhone 8 Plus):

QbQj2qi.jpg!web

Requirements

  • NodeJS (+ npm )
  • MongoDB (used for passport sessions, user and paths info)
  • Ruby (for kramdown library)
  • babel
  • node-sass (not so necessary if you don't want to change the existing styles, and you still can use plain css)

Install

  1. Clone the repo. I'm not gonna to upload project to npm, etc.
git clone https://github.com/petersamokhin/markdown-site
  1. Install dependencies
cd markdown-site
npm i
  1. Rebuild project sources with babel (also static files will be copied to /dist )
npm run rebuild

Run

Run on http://localhost:3006/markdown-knowledge-base

npm start

3rd party

License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK