Getting Started

Source   Edit  

Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Nim 2.2.0 or later
  • Git (optional, for source control)
  • A text editor or IDE with Markdown support

You can verify your Nim installation by running:

$ nim --version
Nim Compiler Version 2.2.10 [Linux: amd64]

If you need to install Nim, visit the official website at https://nim-lang.org and follow the installation instructions for your operating system. The recommended method is using choosenim, which manages multiple Nim versions:

Creating a New Book

Start by creating a new Nimble project that will serve as your book:

  1. Create a new directory for your book project
  2. Run nimble init to create the initial project structure
  3. Add the docs task to your .nimble file
  4. Create your first Markdown page in the src/ directory

The resulting project structure should look like this:

mybook/
├── mybook.nimble
└── src/
    ├── SUMMARY.md
    └── index.md

The SUMMARY.md file defines the navigation structure of your book. Each line starting with - [Link](file.md) adds a page to the navigation. Indented entries create nested navigation groups.