muesli / markscribe

Your personal markdown scribe with template-engine and Git(Hub) & RSS powers πŸ“œ
MIT License
359 stars 39 forks source link

Feature idea: Parsing markdown #8

Open simenandre opened 4 years ago

simenandre commented 4 years ago

Hello! Thanks for an awesome command!

I came over this looking for something that could generate a list of ARDs in our documentation repository. Basically, there is a folder named ard/ in our repository, they are all regular Markdown documents. For anyone in the project, this should be indexed easily, and IMHO I don't think files named 00001-rewrite-to-perl.md are nice enough. I want them listed in our README.md and I think maybe this library could fix that with a nice feature addition.

Potensial use-cases

I assume for this to work, Markdown files all must have # <title here>, so they can be parsed to {{.Title}}. A nice addition could be to implement Markdown Headers, variables from this could be in the template as well πŸ€“. Personally I don't like how Markdown headers are parsed on Github, but anyway.

Potential implementation

Template

# Some title about some Markdown files
{{range markdown "docs"}}
- [{{.Title}}]({{.Path}})
{{end}}

Output

# Some title about some Markdown files
- [Hello there](./docs/hello-there.md)

docs/hello-there.md

# Hello there

...
muesli commented 4 years ago

Sounds like a great idea!