Skip to content

Docs: Set up Prettier for formatting Mintlify website#5020

Merged
abdnh merged 7 commits into
ankitects:mainfrom
Luc-Mcgrady:docs-prettier
Jun 17, 2026
Merged

Docs: Set up Prettier for formatting Mintlify website#5020
abdnh merged 7 commits into
ankitects:mainfrom
Luc-Mcgrady:docs-prettier

Conversation

@Luc-Mcgrady

@Luc-Mcgrady Luc-Mcgrady commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Linked issue (required)

closes #5018

Summary / motivation (required)

This prevents large diffs with prettier being used with the mintlify editor

A caveat of this is that the docs generated by cog now have to be prettier compatible. Also for some reason prettier has problems with the {/* */} multi-line comment format so we have to use instead.

Sadly I don't have a good way to check that the Prettier config does not differ between this PR and the editor.

@Luc-Mcgrady Luc-Mcgrady requested review from abdnh and removed request for abdnh June 16, 2026 14:31
@Luc-Mcgrady Luc-Mcgrady marked this pull request as draft June 16, 2026 15:36
for some reason i had to turn --cache off
@Luc-Mcgrady

Copy link
Copy Markdown
Collaborator Author

Cog and prettier do not play very well with each other although I got it working properly. Notably Prettier doesn't work with multi line MDX comments: https://prettier.io/blog/2021/11/25/2.5.0#mdx so you have to one line any python code.

@Luc-Mcgrady Luc-Mcgrady marked this pull request as ready for review June 16, 2026 21:03
@Luc-Mcgrady Luc-Mcgrady requested a review from abdnh June 16, 2026 21:10
@abdnh abdnh added check:macos Run macOS checks for a PR check:windows Run windows checks for a PR labels Jun 17, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jun 17, 2026

Copy link
Copy Markdown

Documentation build overview

📚 Anki | 🛠️ Build #33182320 | 📁 Comparing d4b935c against latest (2fcaa56)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

@abdnh

abdnh commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Windows is struggling with the long Prettier command: "the command line is too long"

I tried splitting .svelte/.mdx processing into separate invocations but it's still too long. Looking into it.

Prettier respects .gitignore, so we don't need to pass `fmt_excluded`
@abdnh abdnh merged commit e9ac48c into ankitects:main Jun 17, 2026
7 checks passed
@Luc-Mcgrady Luc-Mcgrady deleted the docs-prettier branch June 17, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

check:macos Run macOS checks for a PR check:windows Run windows checks for a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up Prettier for formatting Mintlify website

2 participants