Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically detect templates in a scan path #85

Closed
BernieWhite opened this issue Jul 5, 2021 · 0 comments · Fixed by #88
Closed

Automatically detect templates in a scan path #85

BernieWhite opened this issue Jul 5, 2021 · 0 comments · Fixed by #88
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@BernieWhite
Copy link
Contributor

With PSDocs v0.9.0 we can scan a sub-directory and generate documentation for templates based on a schema with selectors.

Instead of integration code like this:

# Scan for Azure template file recursively in the templates/ directory
Get-AzDocTemplateFile -Path templates/ | ForEach-Object {
    # Generate a standard name of the markdown file. i.e. <name>_<version>.md
    $template = Get-Item -Path $_.TemplateFile;
    $templateName = $template.Directory.Parent.Name;
    $version = $template.Directory.Name;
    $docName = "$($templateName)_$version";

    # Generate markdown
    Invoke-PSDocument -Module PSDocs.Azure -OutputPath out/docs/ -InputObject $template.FullName -InstanceName $docName;
}

or

Get-AzDocTemplateFile -Path templates/ | ForEach-Object {
    Invoke-PSDocument -Module PSDocs.Azure -OutputPath out/docs/ -InputObject $_.TemplateFile -Convention 'Azure.NameByParentPath';
}

we want this:

Invoke-PSDocument -Module PSDocs.Azure -InputPath . -Convention 'Azure.NameByParentPath' -OutputPath 'out/docs/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant