Skip to content

Overwrite docs #73

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

Merged
merged 5 commits into from
Mar 31, 2025
Merged

Overwrite docs #73

merged 5 commits into from
Mar 31, 2025

Conversation

HeyItsGilbert
Copy link
Member

@HeyItsGilbert HeyItsGilbert commented Mar 31, 2025

Updated New-MarkdownHelp with force parameter.

This is a signed version of #67

Description

New-MarkdownHelp should always overwrite new old markdown pages.
If this is not suitable a parameter should be added to be able to force it.

Related Issue

Motivation and Context

This allows the comment based help to be the source of truth.

How Has This Been Tested?

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added this change to the CHANGELOG.md.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Dylan-Prins and others added 3 commits March 31, 2025 07:58
* Introduced an `Overwrite` parameter to control the overwriting of existing markdown files.
* Updated relevant functions and properties to utilize the new parameter.
* Added new rules for `MD013` to disable checks for code blocks and tables.
* Documented breaking changes in `CHANGELOG.md` regarding UTF-8 file compilation and markdown file overwriting.
* Introduced a new `.PARAMETER Overwrite` to allow overwriting existing markdown files.
* Updated the `New-MarkdownHelp` command to utilize the `Overwrite` parameter.
@joshooaj
Copy link
Member

So the impact of this on existing users of PowerShellBuild is that if the markdown help files already exist, they'll be overwritten based on comment-based help if it is present?

If so, then for someone like me who uses markdown as my source of truth, I'll have to add a line to set $PSBPreference.Docs.Overwrite to $false or all my docs will be overwritten and I'll need to do a git reset --hard.

Should we overwrite files by default, or should we fail the build and suggest the user add $PSBPreference.Docs.Overwrite = $true instead?

@HeyItsGilbert HeyItsGilbert requested a review from joshooaj March 31, 2025 16:16
…eter

* Clarified the behavior of the `$PSBPreference.Docs.Overwrite` parameter.
* Updated the default value from `$true` to `$false` in configuration files.
* Enhanced error handling in `Build-PSBuildMarkdown` function.
Copy link
Member

@joshooaj joshooaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

@HeyItsGilbert
Copy link
Member Author

I've decided to set the default to $false. If the $PSBPreference.Docs.Overwrite is set to $true we no longer ErrorAction = SilentlyContinue so that users who overwrite can see if they run into issues.

@HeyItsGilbert HeyItsGilbert merged commit dcc2bb6 into main Mar 31, 2025
3 checks passed
@HeyItsGilbert HeyItsGilbert deleted the OverwriteDocs branch March 31, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants