
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Serve your markdown documentations
With a sample configuration, let's serve this project documentation :
Configuration ~/.servedown.yml :
repos:
- name: servedown
ssh: git@github.com:openhoat/servedown.git
url: https://github.com/openhoat/servedown
filePattern: /blob/master/{{file}}
Start the server :
$ servedown
INFO - servedown:181 - 131ms - cloning repo "servedown"...
INFO - servedown:409 - 4.2s - servedown is listening to 0.0.0.0:3000
Now your server is ready...
Browse :
$ xdg-open http://localhost:3000
Result :
The welcome page is generated from a default template string (or your own index.html)
Click on "Servedown" doc project :
Now you see your markdown files rendered with styles :-)
The simplest way to use servedown is the command line.
All you have to do is :
$ npm i servedown -g
Setup your custom configuration in ~/.servedown.yml :
Have a look at the default configuration file to understand all the customizable features.
Starts the servedown doc server :
$ servedown
If repos are specified in configuraton servedown will checkout them into the working directory (~/.servedown), then it will compute recursively the working dir to render the doc site.
If you prefer to embed servedown features into an existing app, then use the servedown module.
$ cd yournodeproject
$ npm i servedown --save
const path = require('path');
const ServeDown = require('../lib/servedown');
ServeDown.start( // Factory static helper method
{
cacheDir: path.join(__dirname, '..', 'dist', 'working', 'cache'), // Cache dir
repos: [{ // Git repos to get the markdown docs from
name: 'servedown',
url: 'https://github.com/openhoat/servedown'
}]
})
.then(() => {
console.log('ready');
});
or the longer way :
const path = require('path');
const express = require('express');
const ServeDown = require('servedown');
const app = express();
const servedown = new ServeDown(); // Create a servedown instance
servedown.init({ // Initialize with custom config
cacheDir: path.join(__dirname, '..', 'dist', 'working', 'cache'), // Cache dir
repos: [{ // Git repos to get the markdown docs from
name: 'servedown',
url: 'https://github.com/openhoat/servedown'
}]
});
app.use(servedown.buildExpressRouter()); // Use provided express middleware
app.listen(3000, () => {
servedown.process(() => { // Prepare html rendering
console.log('ready');
});
});
Here's a short description of how servedown works :
Conventions :
Servedown supports json, js, or yaml format for configuration file.
Prerequisite : git command installed
Add your git repositories and servedown will automatically checkout them.
By default, servedown will optimize the clone operation : only markdown files are fetched.
Use one of the two themes provided or use your owns, and hot switch the current theme with ?theme=.
Provided themes :
Table of contents is dynamically generated from the level 2 headers of markdown contents, look at mydocs theme template example to see how TOC is rendered.
Optionnaly show the source link of the current document to make documentation changes easy.
Add ?update to your browser address and it will reload, included git update.
Add ?q=anysearch to your browser address and servedown will search through your docs, show matches in a search result page and highlight the results into the doc content.
Into the doc content, press 'n' or 'p' to go to next/previous matching.
The /search route provides a default search form overridable by search.html theme template.
[[ My Title ]]
This is shorthand to My Title
[[ include: my/doc/to/include.md ]]
Specified doc path is included into content, relative or absolute paths are supported, file extension is required.
Embed your Mermaid charts in md content with mermaid** ** tags.
Example :
```mermaid
sequenceDiagram
title Authentication Sequence
Alice->Bob: Authentication Request
note right of Bob: Bob thinks about it
Bob->Alice: Authentication Response
```
First place a config.yml file at the root level of the documentation :
myvar: this will be injected
another:
foo: bar
Then inject configuration data reference into markdown content using [{ }] tag :
[{ myvar }]
Another example :
[{ another.foo }]
Enjoy!
FAQs
Serve your markdown documentations
We found that servedown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.