express-md-docs
TypeScript icon, indicating that this package has built-in type declarations

1.0.7Β β€’Β PublicΒ β€’Β Published

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.

Package Sidebar

Install

npm i express-md-docs

Weekly Downloads

12

Version

1.0.7

License

MIT

Unpacked Size

156 kB

Total Files

5

Last publish

Collaborators

  • luisfelipesdn12