1.0.7 ā€¢ Published 2 years ago

express-md-docs v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

express-md-docs

šŸ“ An Express middleware to render Markdown files into beautiful content in your API

This documentation rendered in a API to demonstrate the working of the package.

Install

  • Using NPM
npm install express-md-docs
  • Using Yarn
yarn add express-md-docs

Use

Basic

Just add middleware to some route as request handler:

import express from "express";
import expressMdDocs from "express-md-docs";

const app = express();

// Docs rendered in the root route
app.get("/", expressMdDocs());

// Docs rendered in the /docs route
app.get("/docs", expressMdDocs());

Options

Is also possible to pass options:

app.get("/", expressMdDocs({
    docsPath: "docs.md",
    style: false,
    htmlPrefix: "<title>My great API</title>"
}));
  • docsPath (type: string - default: README.md): The path to the file that contains the API documentation.

  • style (type: boolean - default: true): Whether auto to import styling from Simple CSS.

  • htmlPrefix (type: string): So you can import your own custom stylesheet, add content to the <head> of the HTML document, or pretty much anything else you want.

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago