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

Write docs outside of artifacts directory #31

Closed
TsekNet opened this issue Sep 8, 2020 · 3 comments
Closed

Write docs outside of artifacts directory #31

TsekNet opened this issue Sep 8, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@TsekNet
Copy link
Contributor

TsekNet commented Sep 8, 2020

Description

While generating docs, it looks like Catesta only writes documentation generated by platyPS to the artifacts folder. I'm not sure if this is WAI, but it would be useful to generate docs in the root directory (I'll leave the actual location up to you). Having docs in the root directory would make them more discoverable when someone is browsing a git repo, as they're immediately visible. Currently, docs are not automatically written to any directory that's uploaded to GitHub.

Describe the solution you'd like

When the CreateMarkdownHelp task executes, docs are written to the root directory (alongside src, media, .vscode, etc.). Whether they also need to live in the artifacts dir, I'll leave up to you.

Describe any alternatives you've considered

A scripted copy of the docs generated and written to the artifacts directory would be possible, to avoid unnecessary calls to platyPS and ensure the docs are always the same between the two directories.

Additional context

I've manually copied the docs for now, but I'd like to hear your thoughts on how to address this.

@TsekNet TsekNet added the enhancement New feature or request label Sep 8, 2020
@TsekNet
Copy link
Contributor Author

TsekNet commented Sep 8, 2020

Noticing that you have code to do this already:

    # here you could move your docs up to your repos doc level if you wanted
    Write-Build Gray '        Overwriting docs output...'
    Move-Item "$($script:ArtifactsPath)\docs\*.md" -Destination "..\docs\" -Force
    Remove-Item "$($script:ArtifactsPath)\docs" -Recurse -Force -ErrorAction Stop
    Write-Build Gray '        ...Docs output completed.'

This seems to be commented out in the module available from PSGallery. Assuming something wasn't working here and thus this was commented out, and the changes in this repo haven't been pushed to PSGallery just yet?

@techthoughts2
Copy link
Owner

This is functional code, and can be un-commented and utilized.

This was commented out because some module authors opt to reverse their help workflow once the markdown is published.

Initial help based comments -> Markdown generated -> External help generated -> Comment based help replaced with external help reference.

At this point some module authors stop updating comment based help and elect instead to edit the markdown directly and then regen from that point using platyPS directly.

Module generators by their nature are somewhat opinionated and I hadn't made a decision if replacing the top level docs on each build was the right call.

Thus, this was commented out.

In review, I think Catesta is driven from a design model that derives the 'source of help truth' from the comment based help. So, I will get this un-commented and documented as the default behavior.

@techthoughts2 techthoughts2 self-assigned this Sep 8, 2020
@TsekNet
Copy link
Contributor Author

TsekNet commented Sep 8, 2020

Sounds reasonable, thanks for the context!

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

No branches or pull requests

2 participants