Skip to content

SPANDigital/presidium-rst-to-markdown

presidium-rst-to-markdown (rst2md)

Open in Dev Containers Dev Go Action Workflow Status Main Go Action Workflow Status Release status

A cli tool: rst2md, convert reStructuredText to a Presidium Docsite.

Prerequesite: Pandoc

As rst2md shells out to pandoc, before you install rst2md please install Pandoc for your chosen platform.

Installation

Choose one installation method, they are listed in order of preference

Via homebrew (recommended)

This requires homebrew to be installed.

brew tap SPANDigital/homebrew-tap
brew update
brew install rst2md

Via go install (for go developers)

This requires as least Go 1.22.x to be installed for your operating system.

go install github.com/spandigital/presidium-rst-to-markdown/cmd/rst2md

Source code and pre-built binaries

Source code and pre-built binaries for various architecutrs can be found at releases

Usage

Usage of rst2md:
  -depth int
        Heading depth level to split sections (default 2)
  -force
        Force overwrite of output directory
  -input string
        Input directory
  -output string
        Output directory
  -pandoc-path string
        Path to the Pandoc executable (default "pandoc")
  -parallel int
        Maximum number of parallel processes (default 4)
  -v    Enable verbose logging

Tools Required for Development

Golangci-lint

brew install golangci-lint
brew upgrade golangci-lint

Nodejs

You should have LTS version of NodeJS installed.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install --lts

commitlint

For linting conventional commits

npm install -g @commitlint/cli @commitlint/config-conventional

Pre-commit hooks

To install pre-commit

On MacOSX

brew install pre-commit

Clone and install pre-commit hooks

git clone git@github.com:SPANDigital/presidium-rst-to-markdown.git
pre-commit install

Commit messages

Commit messages to adhere to the conventional commits standard.