Generate an index related to all entities rendered with `ShowDoc`
build_index
will build an index to names generated with ShowDoc
to document paths that we can later use to construct links for documentation.
Consider the follwing two markdown files, test_docs.md
and front_matter_with_test_docs.md
:
_p1 = Path('test_files/_md_files/test_docs.md')
print(_p1.read_text())
_p2 = Path('test_files/_md_files/front_matter_test_docs.md')
print(_p2.read_text())
Notice that for front_matter_test_docs.md
, the front matter has a slug
, which is used for the path rather than the directory in which the document resides.
Here is how the index looks:
build_index('test_files/')
NbdevLookup
can help you linkify markdown.
Here is an example of a file before linkifying it:
print(_backticks_file.read_text())
And after linkifying it:
nl = NbdevLookup(md_path='test_files/_md_files/')
nl.update_markdown()
print(_backticks_file.read_text())