Generates a markdown list of children files and folders and saves it to a markdown file.
Useful when wanting an index in a readme.md.
Available as a command line tool here.
GIVEN a readme.md file exists
My favourite things are:
<!-- markdown-children:start -->
<!-- markdown-children:end -->
WHEN MarkdownChildrenKit is invoked
try MarkdownChildren().process(.init(
url: URL(string: "../readme.md",
nameType: .useH1,
tagStart: "<!-- markdown-children:start -->",
tagEnd: "<!-- markdown-children:end -->",
saver: saver
))
THEN the readme.md turns into:
My favourite things are:
<!-- markdown-children:start -->
- [Animals](animals.md)
- animals
- pets
- [Cats](animals/pets/cats.md)
- [Dogs](animals/pets/dogs.md)
- zoo
- [Tiger](animals/zoo/tiger.md)
- [Clothes](clothes.md)
- clothes
- summer
- [Dress](clothes/summer/dress.md)
- [Hat](clothes/summer/hat.md)
- winter
- [Jumper](clothes/winter/jumper.md)
- [Pants](clothes/winter/pants.md)
<!-- markdown-children:end -->
Add the following to your project:
https://github.com/ptrkstr/MarkdownChildrenKit
- Option - Choose list node (
-
,*
or+
) - Option - Skip folder if it doesn't contain any markdown files