gcanti / docs-ts

A zero-config documentation tool for my TypeScript projects
https://gcanti.github.io/docs-ts/
MIT License
101 stars 17 forks source link

Modules with only exports from other modules result in empty ToC #47

Open gillchristian opened 3 years ago

gillchristian commented 3 years ago

What is the current behavior?

When modules only have export from statements it results in an empty ToC.

Eg. the following src/http/index.ts file:

export * from './http'
export * from './utils'

Would result in this generated doc:

---
title: http/index.ts
nav_order: 1
parent: Modules
---

## index overview

Some overview

---

<h2 class="text-delta">Table of contents</h2>

---

What is the expected behavior?

I'm not sure what should be the expected behaviour 🤔

One idea is to remove the ToC title, since there's no ToC. But that would still result in an empty document.

We could show all the exports from the module instead.

Or add a new section that mentions all the exported modules. hadoc does this, module exports show up in the docs as a reference to the module (see Data.Map documentation)

module Data.Map
    ( module Data.Map.Lazy
    -- ...
    ) where

image

module Data.Map
    ( module Data.Map.Lazy
    -- ...
    ) where

Which versions of docs-ts?

I'm using v0.6.4