zimbatm/mdsh

Invisible command, for docs generation

roberth opened this issue · 1 comments

When generating documentation, the command itself is usually not very interesting and it may distract the reader.

This can replace for example terraform-docs-updater.

Proposed doc:


Invisible Includes

When generating documentation, the command itself is usually not very interesting and it may distract the reader.

Syntax regexp:
TBD

Invisible Includes work similarily to code blocks but with the comment syntax.

  • $ loads the file and embeds it as a code block
  • > loads the file and embeds it as markdown

Examples:

<!-- $ wc -l <sponsors.txt -->
```
42
```
<!-- > terraform-docs markdown ./my-module -->
<!-- BEGIN mdsh -->
# Inputs
[... actual generated docs ...]
<!-- END mdsh -->

Yeah something similar crossed my mind as well. I think it's important to keep the original syntax to make the transition easier.

For example you start with

`$ cat foo`

and then decide to hide it, so just add <!-- and --> around.

<!-- `$ cat foo` -->

I think it would be more natural like that. And the regexp then just needs to be extended to ignore the additional bits.