Skip to content

Remove clean markdown generation and artifacts.#833

Open
jottakka wants to merge 1 commit intomainfrom
cleanup/remove-clean-markdown
Open

Remove clean markdown generation and artifacts.#833
jottakka wants to merge 1 commit intomainfrom
cleanup/remove-clean-markdown

Conversation

@jottakka
Copy link
Contributor

@jottakka jottakka commented Feb 27, 2026

Stop generating and committing clean markdown files in CI, simplify markdown serving/indexing to use source content directly, and remove .md URL suffixes from llms output and markdown alternates for the current main behavior.


Note

Medium Risk
Removes CI generation/committing of prebuilt markdown artifacts and changes markdown serving/copy behavior to no longer rely on public/_markdown or .md suffixes; risk is mainly broken markdown links/clients expecting .md or missing alternate metadata.

Overview
Stops generating/committing “clean markdown” artifacts. Deletes the generate-markdown GitHub workflow, removes the generate:markdown script and its postbuild hook, and drops the public/_markdown/ generated files from the repo.

Simplifies markdown delivery to use source content and no .md suffix. The markdown API no longer attempts to serve pre-generated clean markdown and instead serves raw MDX (or toolkit markdown when available), while UI copy actions now fetch /api/markdown${pathname} (no .md). Markdown content negotiation/rewrites are updated to build non-.md paths, and the text/markdown alternate metadata is gated behind a disabled flag.

Written by Cursor Bugbot for commit 577bbec. This will update automatically on new commits. Configure here.

Stop generating and committing clean markdown files in CI, simplify markdown serving/indexing to use source content directly, and remove .md URL suffixes from llms output and markdown alternates for the current main behavior.

Made-with: Cursor
@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Building Building Preview, Comment Feb 27, 2026 1:23am

Request Review

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Style Review

Found 1 style suggestion(s).

Powered by Vale + Claude

# Agentic Development

Every page on the Arcade docs site renders as clean markdown. When an AI agent or coding assistant visits any docs URL, the site automatically returns `Content-Type: text/markdown` instead of HTML if:
Every page on the Arcade docs site can be served as markdown. When an AI agent or coding assistant visits any docs URL, the site automatically returns `Content-Type: text/markdown` instead of HTML if:
Copy link
Contributor

Choose a reason for hiding this comment

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

Google.Passive: Changed 'can be served' to 'serves' to use active voice

Suggested change
Every page on the Arcade docs site can be served as markdown. When an AI agent or coding assistant visits any docs URL, the site automatically returns `Content-Type: text/markdown` instead of HTML if:
Every page on the Arcade docs site serves as markdown. When an AI agent or coding assistant visits any docs URL, the site automatically returns `Content-Type: text/markdown` instead of HTML if:

Comment on lines -44 to -51
- name: Check for changes
id: check-changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure we want to keep most of this - it only regenerates the summary for changed pages. It's very slow/expensive to do them all

setLoading(true);
try {
const response = await fetch(`/api/markdown${pathname}.md`);
const response = await fetch(`/api/markdown${pathname}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

won't we have to fetch with the new application/markdown header?

Comment on lines +81 to +87
alternates: ENABLE_MARKDOWN_ALTERNATE
? {
types: {
"text/markdown": getMarkdownAlternatePath(pathname),
},
}
: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were removing all of this from our code and having cloudflare do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeh, tomorrow I have to take a better look on this, there are more things then I expected related to the MD files.

@jottakka jottakka self-assigned this Feb 27, 2026
@@ -101,15 +101,15 @@ function getLocaleFromPathname(pathname: string, request: NextRequest): string {

function buildMarkdownPath(pathname: string, locale: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this function is no longer needed

@@ -19,10 +18,10 @@ const LOCALE_REGEX = /^app\/([a-z]{2}(?:-[A-Z]{2})?)\//;
*/
function getMarkdownAlternatePath(pathname: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

most of this logic is also not necessary

/**
* Converts clean markdown to HTML for Pagefind indexing.
* This function expects pre-cleaned markdown (no MDX syntax).
* Converts markdown to HTML for Pagefind indexing.
*/
async function markdownToHtml(markdownContent: string): Promise<string> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I am missing something but pagefind didn't need to convert to html since it's a postbuild step.

const fetchAndCopyMarkdown = useCallback(async (): Promise<boolean> => {
try {
const markdownUrl = `/api/markdown${pathname}.md`;
const markdownUrl = `/api/markdown${pathname}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to add the header application/markdown here.

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