Static site generator in a single file 📄
This project is a documentation generator written in Rust. It reads markdown files from a specified directory, converts them to HTML, and saves the generated HTML files to another specified directory.
See Dorcs in action here. (same link as the documentation)
-
Markdown to HTML Conversion: The project reads markdown files and converts them to HTML. This is done in the documents loop in the generate_docs function of the Generator struct.
-
Sidebar navigation: Dorcs automatically generates links for navigating between the different pages
-
Page Metadata: Provide a title for a certain page. You can also provide the position of the page in the sidebar.
-
Hot Reload: In watch mode, Dorcs watches the source directory for changes and regenerates the documentation whenever a change is detected.
-
Built-in Server: Dorcs starts a local server to preview the generated documentation.
The documentatoin is available at dorcs.allthing.eu.
The website is generated using Dorcs itself, you can find the source code for the documentation inside the docs
directory.
Download pre-built binaries from the releases section for a quick start.
To build from source, you need to have Go(lang) installed.
Clone the repository and run the following commands inside:
go generate ./build/gen.go
go build -o dorcs .
In develop
branch you can find the latest features and changes. Use with caution, there may be not working features or breaking changes.
You can find the nightly builds marked as pre-releases in the releases section
- Create a
docs
directory with anindex.md
file in it. This will be the landing page of your documentation. - Run Dorcs in the directory with the
docs
folder.
dorcs
This will generate the documentation in the output
directory.