The newdoc tool

Crates.io Crates.io Crates.io

Travis (.org) AppVeyor Copr build

The newdoc tool generates pre-populated module and assembly files formatted with AsciiDoc, which are used in Red Hat and Fedora documentation. The generated files follow the Modular Documentation guidelines: https://redhat-documentation.github.io/modular-docs/.

Installing newdoc

Test that newdoc works:

$ newdoc

Updating newdoc

Creating a new module

  1. In the directory where modules are located, use newdoc to create a new file:

    modules-dir]$ newdoc --procedure "Setting up thing"

    The script also accepts the --concept and --reference options. You can use these short forms instead: -p, -c, and -r.

  2. Rewrite the placeholders in the generated file with your docs.

Creating a new assembly

  1. In the directory where assemblies are located, use newdoc to create a new file:

    assemblies-dir]$ newdoc --assembly "Achieving thing"

    You can use the short form of the --assembly option instead: newdoc -a "Achieving thing".

  2. Rewrite the placeholders in the generated file with your docs.

    Add AsciiDoc include statements to include modules. See Include Files in the AsciiDoc Syntax Quick Reference.

    Alternatively, you can use the --include-in option when creating the assembly to generate modules and include them automatically, in a single step. See the description in the Options section.

Validating a file for Red Hat requirements

You can use the --validate (-l) option to check an existing file for Red Hat publishing requirements. For example:

``` $ newdoc --validate modules/empty-file.adoc

💾 File: empty-file.adoc 🔴 Error: The file has no title or headings. 🔴 Error: The file is missing an ID. 🔶 Warning: The file is missing the _abstract flag. The flag is recommended but not required. 🔴 Error: Cannot determine the module type. ```

``` $ newdoc --validate modules/con_proper-module.adoc

💾 File: modules/con_proper-module.adoc 🔷 Information: No issues found in this file. ```

Options

For more options, see the output of the following command:

$ newdoc --help

Release notes

You can find a brief change log on the Releases page.

Additional resources