Installation

Source   Edit  

Installation

Nimble Install

The simplest way to install ndgBook is through Nimble, Nim's package manager. Since ndgBook is integrated into the Nim compiler, you only need Nim itself:

$ nimble install nim@#head --dev

This installs the development version of Nim with ndgBook support. For production use, wait for the next Nim release that includes the ndgBook patches.

Tip: You can also build Nim from source with the ndgBook modifications applied to the compiler/docgen.nim and lib/packages/docutils/rstgen.nim files.

Verification

After installation, verify that ndgBook works by creating a test project:

$ mkdir testbook && cd testbook
$ mkdir src
$ echo '# Test' > src/index.md
$ nim doc --project --outDir:docs --index:on src/index.md

You should see output similar to:

Hint: used config file '...' [Conf]
Hint: used config file '.../nimdoc.cfg' [Conf]

The generated HTML files will be in the docs/ directory. Open docs/index.html in your browser to see the result.

Common Issues

If you encounter issues during installation, check the following:

  • Nim version: ndgBook requires Nim 2.2.0 or later. Run nim --version to verify
  • Compiler patches: Make sure the ndgBook modifications to the Nim compiler are applied. The build should include commandDocMarkdown in compiler/docgen.nim
  • Lib paths: The compiler must find its standard library. If you built from source, ensure bin/nim can locate the lib/ directory
Danger: Do not mix ndgBook-patched Nim compilers with stock Nim compilers. The index file format has been extended with the text entry type, which stock compilers cannot read.