Skip to content

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

{{ lsdir() }}

Result

{{ lsdir(squeeze=False) }}

Result


List directories and files at depth > 0

{{ lsdir(depth=1) }}

Result

{{ lsdir(depth=2) }}

Result


List directories and files at depth > 0, but with showEmptyDirs=True

{{ lsdir(depth=1,showEmptyDirs=True) }}

Result

{{ lsdir(depth=2,showEmptyDirs=True) }}

Result


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


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" 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

{{ lsnav(depth=42, rootNav = True, navIndex = False, squeeze=False) }}

Result


List navigations across multiple depths


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