Examples
The directory details of ./example
is as below
tree
.
├── .hiddenfile.txt
├── .nav.yml
├── _hidden.md
├── a-section
│ ├── a-section.md
│ ├── anotherdir
│ │ ├── depth-2-page.md
│ │ └── textfile.txt
│ └── test.ipynb
├── another-section
│ ├── .nav.yml
│ ├── README.md
│ ├── example.toml
│ └── firstpage.md
├── baz.md
├── foo.py
├── index.md
└── non-index-page.md
.nav.yml
nav:
- index.md
- A File: a-section/a-section.md
- Example website: https://example.com
- "*"
./another-section/.nav.yml
nav:
- firstpage.md
- README.md
List all files in current directory
List directories and files at depth > 0
List directories and files at depth > 0, but with showEmptyDirs=True
{{ lsdir(depth=1,showEmptyDirs=True) }}
Result
- 📁 a-section
- 📁 anotherdir
- test.ipynb
- 📁 another-section
- foo.py
{{ lsdir(depth=2,showEmptyDirs=True) }}
Result
- 📁 a-section
- 📁 anotherdir
- test.ipynb
- 📁 another-section
- foo.py
List all non-Markdown, non-excluded files and folders from root path
{{ lsdir(depth=42,targetDir=".",showEmptyDirs=True) }}
Tip
Just use a big depth number e.g. 42 if you wanna walk every subdir
Result
- 📁 examples
- 📁 a-section
- 📁 anotherdir
- test.ipynb
- 📁 another-section
- foo.py
- 📁 a-section
- 📁 macros-reference
List navigations
{{ lsnav() }}
Result
"A File" is included as it was listed in .nav.yml
as part of this section
{{ lsnav(navIndex=False) }}
Result
- A File
- Example website
- baz.md file
- Non-index.md navs and files
- A section
- Another section > Readme
"A File" is included as it was listed in .nav.yml
as part of this section
The README.md page is now treated as a normal page inside the "Another section" section
List full-depth navigations starting from root and without navIndex
{{ lsnav(depth=42, rootNav = True, navIndex = False) }}
Result
- Welcome
- Installation
- Macros reference
- Examples
- Examples
- A File
- Example website
- baz.md file
- Non-index.md navs and files
- A section
- Anotherdir
- Another section
{{ lsnav(depth=42, rootNav = True, navIndex = False, squeeze=False) }}
Result
Macros reference
Examples
A section
Anotherdir
Another section
List navigations across multiple depths
{{ lsnav(depth = 1) }}
Result
{{ lsnav(depth = 2) }}
Result
Content tab that shows files first, at full depth, and doesn't exclude anything
{{ tabnav(depth=42,features="files,nav", excludeCurrentPage = False, showEmptyDirs=True) }}
Result
- 📁 a-section
- 📁 anotherdir
- test.ipynb
- 📁 another-section
- foo.py