#markdown #docs #together #tree #file #text-based #output

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

#445 in Template engine

Download history 2/week @ 2024-02-15 11/week @ 2024-02-22 3/week @ 2024-02-29 27/week @ 2024-03-28 28/week @ 2024-04-04

55 downloads per month

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–13MB
~137K SLoC