Skip to content

Key Features

Anton edited this page Jul 31, 2019 · 1 revision

This page has a quick look at the best features available in Documentary and how they help the documentation process.

Feature Description Advantages
Tables Of Contents Compiles an accurate table of contents for the content. 1. Makes the structure of the document immediately visible to the reader.
2. Allows to navigate across the page easily.
3. Shows problems with incorrect levels structure which otherwise might not be visible.
4. Allows to place anchor links available from the TOC at any level in any place of the README.
5. Can insert section breaks which visually divide the content and allow to navigate back to the top.
Examples Allows to embed the source code into documentation. 1. Increases productivity by eliminating the need to copy and paste the source code manually.
2. Developers can run examples as Node.js scripts to check that they are working correctly and debug them.
3. Examples can also be forked (see below).
4. It is possible to imports and requires such as ../src to be displayed as the name of the package.
Forks Makes it possible to run an example and embed its stdout and stderr output directly into documentation. Supports import and export statements without Babel. Allows to save cache for faster re-runs. 1. Enhances productivity by eliminating the need to copy and paste the output by hand.
2. Makes sure the output is always up-to-date with the documented one.
3. Will make it visible if a change to the code base lead to a different output (implicit regression testing).
4. Supports optional caching, so that programs don't have to be re-run each time a change to documentation in a different place is made.
5. Forked modules can use import and export statements natively, making it very easy to document the output of examples written in modern syntax.
6. Ensures that examples are actually working.
7. Can print usage of CLI tools by forking them with -h command.
JSX Components Performs the compilation of custom-defined JSX components into markdown code. 1. Lets to define custom components and reuse them across documentation where needed.
2. Provides a modern syntax to combine markdown and JavaScript.
3. When documentation written in HTML files, the components are documented with web-components.json file for the VSCode which will provide autosuggestions for the arguments of the component.
Tables Compiles tables from arrays without having to write html or markdown. 1. Removes the need to manually build tables either by hand, online or using other tools.
2. Provides table macros to reduce repetitive information and substitute only the core data into templates.
Macros Reuses a defined template to place the data into placeholders. 1. Removes the need to copy-paste patterns to different places and change data manually.
2. Maintains an up-to-date version of the template without having to change it everywhere.
3. Reduces the cluttering of the source documentation by noise and helps to focus on important information.
[Live Push] Detects changes to the source documentation files, re-compiles the output README.md and pushes to the remote repository. 1. The preview is available on-line almost immediately after a change is made.
2. Allows to skip writing a commit message and the push command every time a change is made.
Typedefs Maintains a types.xml file to place types definition in it, available both for source code and documentation. 1. Keeps the types declarations in one place, allowing to quickly update it both in JavaScript JSDoc, and in markdown README.
2. Automatically constructs type tables for documentation.
3. Expands the JSDoc config (options) argument for other developers to have a quick glance at possible options when calling a function.
4. Links all types across the whole documentation for quick navigation.
5. If the types.xml file or directory is published, other packages can embed it into documentation also, by using Documentary.
API Method Titles Creates good-looking headers for methods. 1. By writing each argument on new line, makes it easier to understand the signature of a function.
2. Can maintain a separate title for the table of contents to keep things simple there.
Clone this wiki locally