Skip to content

Fix markdown and related issues#5344

Merged
gautamdsheth merged 2 commits into
devfrom
fix/docs-llmsv2
Jun 3, 2026
Merged

Fix markdown and related issues#5344
gautamdsheth merged 2 commits into
devfrom
fix/docs-llmsv2

Conversation

@gautamdsheth

Copy link
Copy Markdown
Collaborator

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #X, partially fixes #Y, mentioned in #Z, etc.

What is in this Pull Request ?

Please describe the changes in the PR.

Guidance

  • You can delete this section when you are submitting the pull request.*
  • Please update this PR information accordingly. We use this as part of our release notes in monthly communications.
  • Please target your PR to Dev branch. If you do not target the Dev branch we will not accept this PR.

Copilot AI review requested due to automatic review settings June 3, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the documentation site’s “Copy Markdown” UX and publishing workflow to better handle missing Markdown sources and to prevent stale published output.

Changes:

  • Add caching and improved error handling for fetching/copying Markdown source in the modern template JavaScript.
  • Introduce a publish-path clearing step in the site build script before copying generated output.
  • Update the local verification checklist to reflect both “Copy markdown” and “View as Markdown” actions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pages/templates/pnp-modern/public/main.js Adds markdown source caching and improves clipboard fallback behavior for the Copy Markdown feature.
pages/Build-Site.ps1 Adds a helper to clear existing published site output before copying the newly generated site.
pages/articles/buildingdocumentation.md Updates the browser checklist wording to include both Copy and View Markdown actions.

Comment on lines +36 to +44
if (!markdownSourceCache.has(cacheKey)) {
markdownSourceCache.set(cacheKey, fetch(markdownSourceUrl, { cache: "no-store" }).then(response => {
if (!response.ok) {
throw new Error(`Unable to fetch markdown source: ${response.status}`);
}

return response.text();
}));
}
Comment thread pages/Build-Site.ps1 Outdated
Comment on lines +78 to +80
$resolvedPath = (Resolve-Path $Path).Path
$protectedPaths = @($SourceRoot, $PagesPath, $SitePath, [System.IO.Path]::GetPathRoot($resolvedPath))

Comment thread pages/Build-Site.ps1
Comment on lines 303 to 306
if (![string]::IsNullOrWhiteSpace($PublishPath)) {
Write-Host "Copying generated site to $PublishPath"
Clear-PublishPath -Path $PublishPath
Copy-Item -Path (Join-Path $SitePath "*") -Destination $PublishPath -Force -Recurse
@gautamdsheth gautamdsheth merged commit 837aae6 into dev Jun 3, 2026
2 checks passed
@gautamdsheth gautamdsheth deleted the fix/docs-llmsv2 branch June 8, 2026 19:14
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.

2 participants