Expand-DirectoryNavigation

Expand directory link targets one level to links to contained markdown files.

Syntax

 Expand-DirectoryNavigation [-LiteralPath] <String> [-NavSpec] <Object>  [<CommonParameters>] 

Description

Scans a collection of navigation links for link targets pointing to directories and inserts links to all directly contained markdown files.

Parameters

-LiteralPath <String>

Absolute path to the directory the navigation itens are relative to. Usually this is the path to the directory containing the Build.json file the navigation items are from or the directory configured by markdown_dir if the navigation items are from the top-level Build.json file.


Parameter Property Value
Required? true
Position? 1
Default value ``
Accept pipeline input? false
Accept wildcard characters? false

The specification of a single navigation item as specified in ConvertTo-NavigationItem.


Parameter Property Value
Required? true
Position? 2
Default value ``
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

Inputs

Specifications of navigation items as specified in ConvertTo-NavigationItem.

Outputs

Specification of navigation items as specified in ConvertTo-NavigationItem where all links to directories are replaced by links to the directory contents (one level).

Examples

EXAMPLE 1

@{'My Directory' = 'foo'} | Expand-DirectoryNavigation -LiteralPath e:\stuff

Expands the directory foo which is a subdirectory of e:\stuff. Assuming the following directory structure and content:

Diagram 1.

where bar.md and baz.md are two markdown files.

This expands to:

@{'My Directory' = ""} # <- label
@{'bar' = "foo/bar.md"} # <- link
@{'baz' = "foo/baz.md"} # <- link

Related Links


Module: MarkDownToHTML; Version: 2.7.1; (c) 2018-2022 WetHat Lab. All rights reserved.