zimbatm / mdsh

`$ mdsh` # a markdown shell pre-processor
https://zimbatm.github.io/mdsh/
MIT License
123 stars 11 forks source link

Invisible command, for docs generation #24

Closed roberth closed 5 years ago

roberth commented 5 years ago

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.

Examples:

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

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.