#markdown #docs

bin+lib docdoc

Simple tool that stitches together a tree of text-based files

3 releases

0.0.3 Jul 5, 2023
0.0.2 Jun 26, 2023
0.0.1 Jun 26, 2023

#331 in Template engine

MIT/Apache

14KB
277 lines

DocDoc

crates.io Documentation

Simple tool that stitches together a tree of text-based files. Currently only supports markdown.

Why? I couln't find an easy to use and install tool to stitch together my markdown files. And because it's fun, of course!

Installation

You'll need Rust and Cargo to build or install this tool. You can find installation instructions for Rust and Cargo at https://rustup.rs/.

To install the latest release, just run

cargo install docdoc

How it works

Create an entry file. Let's call it entry.md. It has the following content

# My paper
A paper about DocDoc.

#[docdoc:path="./intro.md"]

#[docdoc:path="./conclusion.md"]

You'll notice the #[docdoc:path="..."] directives. These directives tell DocDoc where to find the content to include. DocDoc will replace the directives with the contents of the files in the paths, and resolve its includes recursively.

Let's add some other docs. First, intro.md:

## Introduction

This is the introduction to my paper.
I like to keep things short.

And then conclusion.md:

## Conclusion
So yeah, that was it. I had fun!

Now let's have DocDoc stitch all this together:

docdoc -o output.md entry.md

And done! Open output.md to read the contents of the whole paper.

Features

  • Include files from paths
  • Detect and error on cyclic imports
  • Watch files
  • Include from git
  • [YOUR FEATURE HERE] If you're missing a feature, please open an issue and we'll discuss it.

Dependencies

~3–12MB
~127K SLoC