All Projects → fliegwerk → fliegdoc

fliegwerk / fliegdoc

Licence: MIT license
A documentation generator for Typescript-based libraries with good support for monorepos

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to fliegdoc

Pdoc
🐍 ➡️ 📜 Auto-generate API documentation for Python projects
Stars: ✭ 604 (+2416.67%)
Mutual labels:  docs, documentation-generator
App
Fast and searchable Ruby docs
Stars: ✭ 47 (+95.83%)
Mutual labels:  docs, documentation-generator
Pdoc
API Documentation for Python Projects
Stars: ✭ 853 (+3454.17%)
Mutual labels:  docs, documentation-generator
Gatsby Documentation Starter
Automatically generate docs for React components using MDX, react-docgen, and GatsbyJS
Stars: ✭ 91 (+279.17%)
Mutual labels:  docs, documentation-generator
Bsdoc
📚 Documentation Generator for BuckleScript
Stars: ✭ 43 (+79.17%)
Mutual labels:  docs, documentation-generator
Graphql Markdown
The easiest way to document your GraphQL schema.
Stars: ✭ 114 (+375%)
Mutual labels:  docs, documentation-generator
campus-leaflets
校园传单是一个使用 Node.js、MongoDB、Koa、EJS、MDL、Less、RequireJS 和 Gulp 开发的 Node 应用程序。
Stars: ✭ 16 (-33.33%)
Mutual labels:  ejs
mongoose-to-swagger
Conversion library for transforming Mongoose schema objects into Swagger schema definitions.
Stars: ✭ 50 (+108.33%)
Mutual labels:  docs
zksync-docs
zkSync documentation
Stars: ✭ 52 (+116.67%)
Mutual labels:  docs
buuk
A simple markdown based documentation generator.
Stars: ✭ 23 (-4.17%)
Mutual labels:  docs
iDocs
iDocs is one page documentation html template which helps you to create your offline and online documentation for your themes, templates, plugins and software.
Stars: ✭ 75 (+212.5%)
Mutual labels:  docs
api-doc
自动化文档生成工具
Stars: ✭ 13 (-45.83%)
Mutual labels:  docs
react-native-hybrid-storybook
Showcase your react native components in the browser
Stars: ✭ 18 (-25%)
Mutual labels:  documentation-generator
frontendpath
A correct path to front-end development.
Stars: ✭ 60 (+150%)
Mutual labels:  docs
doctools
doctools for eggjs
Stars: ✭ 38 (+58.33%)
Mutual labels:  docs
ExpressionEngine-User-Guide
The source for the HTML ExpressionEngine user guides found at https://docs.expressionengine.com
Stars: ✭ 17 (-29.17%)
Mutual labels:  docs
sphinx rtd dark mode
Adds a toggleable dark mode to the Read the Docs theme for Sphinx.
Stars: ✭ 29 (+20.83%)
Mutual labels:  docs
rdme
ReadMe's official CLI and GitHub Action
Stars: ✭ 44 (+83.33%)
Mutual labels:  docs
Sawo-Docs
Official Repository of SAWO Documentation 📖
Stars: ✭ 18 (-25%)
Mutual labels:  docs
blue bird
API Documentation Generator for the Phoenix Framework
Stars: ✭ 52 (+116.67%)
Mutual labels:  documentation-generator

Welcome to fliegdoc 👋

Version Prerequisite Documentation Maintenance License: MIT Twitter: pklaschka2000

A documentation generator for Typescript-based libraries with good support for monorepos

🏠 Homepage, Demo & Docs

Prerequisites

  • node >12.0.0

Install

npm install --global fliegdoc

Usage

CLI

$ fliegdoc --help
Usage: fliegdoc [command] [options]

Commands:
  fliegdoc build [options]  Build the documentation       [default] [aliases: b]
  fliegdoc serve [options]  Preview the documentation in the browser[aliases: s]
  fliegdoc completion       generate completion script

Options:
      --help     Show help                                             [boolean]
  -s, --serve    Serve the static files after build   [boolean] [default: false]
  -p, --port     The port on which the documentation gets hosted        [number]
  -v, --version  Show version number                                   [boolean]

Get help for individual commands by running fliegdoc <command> --help

The CLI searches for a fliegdoc.config.js file and applies its options on top of the default options.

Example fliegdoc.config.js with default options

// fliegdoc.config.js
const { HTMLTheme } = require('fliegdoc');

module.exports = {
	baseUrl: '/',
	outDir: './docs',
	readme: './README.md',
	modules: [
		{
			package: './package.json',
			tsconfig: './tsconfig.json',
			mainFile: 'main.ts'
		}
	],
	title: 'Documentation', // appears in the page title and header
	externalLinks: {}, // e.g.: { "GitHub": "https://github.com/fliegwerk/fliegdoc" }
	hidePrivateMembers: true,
	theme: HTMLTheme
};

API

import {} from 'fliegdoc';

(cf. docs for a list of exported members)

Themes

Theme Overview

Themes take the doc-ready AST and configuration and write a resulting file structure.

In code, themes are implemented as objects that implement the Theme interface. This means that they have both a property isBrowserViewable: boolean and a method onBuild().

The isBrowserViewable property should be false unless the theme is intended to be used in the browser (e.g., outputting HTML files).

The onBuild method is called with the doc-ready AST and configuration as arguments. As third argument, it gets passed a CreateFileFunction (( path: string, content: Buffer, mimetype: string ) => Promise<void>), that you must use to create files in the output folder. You must use that function so that any necessary cleanup can be done by fliegdoc.

The object then gets passed as theme in the configuration object.

A simple example theme outputting the raw AST as JSON could look like this:

// fliegdoc.config.js
// a theme that outputs the raw AST as JSON files
const theme = {
	isBrowserViewable: false, // don't use this in the browser
	onBuild(ast, config, createFile) {
		for (const module in ast) {
			// iterate over modules
			const { name } = ast[module]; // e.g. 'fliegdoc'
			const fileName = `${name}.json`; // e.g. 'fliegdoc.json'
			const content = JSON.stringify(ast[module], null, 2);

			// create the file
			createFile(fileName, Buffer.from(content), 'application/json');
		}
	}
};

module.exports = { theme /* [...] */ }; // add the theme to the configuration

Please note that there may be changes to the doc-ready AST structure with new TypeScript releases, so we can't provide detailed documentation on its structure. We recommend studying the raw output to get a sense of how the output is structured.

Author

👤 Pablo Klaschka

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 Pablo Klaschka.

This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].