Skip to content

Request: Sections

Hi there, thank you for fenneldoc! It has a lot of what one would expect from a modern doc command, while keeping things simple in the Fennel tradition by outputting simple Markdown.

I see that :doc-order can be used to specify a fixed order for exports. This outputs a flat list of the exports and a flat (i.e. depth 1) Table of Contents, but what if we wanted to group the exports by theme? For instance:

**Table of Contents**

- [Foo Functions](#foo)
  - [`foo-a`](#foo-a)
  - [`foo-b`](#foo-b)
  - [`foo-c`](#foo-c)
- [Bar Functions](#bar)
  - [`bar-a`](#bar-a)
  - [`bar-b`](#bar-b)
  - [`bar-c`](#bar-c)

where in each section we'd see:

## Foo Functions
This is a detailed description.

### `foo-a`
Function signature:
... etc.

In terms of the .fenneldoc config, it could look something like this:

{:modules-info
 {"amazing-code.fnl"
  {:name "Amazing Code"
   :version "0.1.0"
   :sections [{:name "Foo Functions"
               :description "This is a detailed description."
               :order [:foo-a :foo-b :foo-c]}
              {:name "Bar Functions"
               :description "This is a great description."
               :order [:bar-a :bar-b :bar-c]}]}}}

I understand that something similar could be accomplished by using multiple modules and generating docs for each, but surely there are cases where only a single module is appropriate, and yet there are still exports of different theme within it.

Thoughts? Thank you!