kurgaev / yfm-docs

Создавай документацию с помощью yfm-docs в Markdown и HTML форматах

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

english | русский


NPM version

yfm-docs

Yfm-docs lets you build a full-fledged documentation project: with navigation, internal transitions, and full Yandex Flavored Markdown (YFM) support. For example, Yandex.Cloud documentation.

Example of displaying a documentation page

Installation

npm i @doc-tools/docs -g

Usage

yfm -i ./input-folder -o ./ouput-folder -v "{\"name\":\"Alice\"}"

List of possible parameters

  • --input, -i

    Path to the project directory (required parameter).

  • --output, -o

    Path to the output directory (required parameter).

  • --allowHTML

    Allow the use of HTML in MD files.

  • --varsPreset

    Name of the used preset.

  • --vars, -v

    Values of YFM variables

  • --strict, -s

    Start in strict mode.

    YFM warnings are treated as errors. Disabled by default.

  • --quiet, -q

    Start in quiet mode.

    Do not output logs to stdout. Disabled by default.

  • --config, -c

    Path to the YFM configuration file.

  • --output-format

    Generation format: HTML or MD. By default, HTML.

  • --apply-presets

    Shows whether to apply presets when converting md2md.

  • --publish

    Should upload output files to S3 storage. Disabled by default.

  • --version

    Current version.

  • --help

    List of commands.

Learn more yfm-docs --help

Learn more about the project structure

Build result

The built project is a set of static HTML pages that can be viewed locally, hosted on a hosting service, on GitHub Pages, or in S3:

output-folder
|-- index.html (Documentation landing page)
|-- quickstart.html (Document files and images)
|-- pages
    |-- faq.html
    |-- how-to.html
|-- assets
    |-- image1.png
    |-- image2.png
|-- includes
    |-- faq_shared_block.html

Building a project in YFM

You can also build your project in YFM using the --output-format=md key.

In this case:

  • [Inserts in ToC files]( are applied./DOCS.md#tocIncludes).
  • Conditions in the content and ToC files are calculated.
  • Variables are applied if the apply-presets parameter is specified.
  • All files specified in the ToC files, images used in them, and insert files will be copied.

Learn more about variables and conditions in YFM documentation.

input-folder
|-- index.yaml (Documentation landing page)
|-- quickstart.md (Document files and images)
|-- pages
    |-- faq.md
    |-- how-to.md
|-- assets
    |-- image1.png
    |-- image2.png
|-- includes
    |-- faq_shared_block.md

Source files

Installation

cd yfm-docs
npm ci && npm run build

Usage

npm run start -- -i ./input-folder -o ./ouput-folder -v "{\"name\":\"Alice\"}"

License

MIT

About

Создавай документацию с помощью yfm-docs в Markdown и HTML форматах

License:MIT License


Languages

Language:TypeScript 92.4%Language:JavaScript 7.4%Language:SCSS 0.2%