feat(cli): add configurable syntax highlighting themes via code-theme setting#13254
Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Open
feat(cli): add configurable syntax highlighting themes via code-theme setting#13254devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
… highlighting Co-Authored-By: will.kendall@buildwithfern.com <wpk235@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…dated) and add versions.yml entry Co-Authored-By: will.kendall@buildwithfern.com <wpk235@gmail.com>
Co-Authored-By: will.kendall@buildwithfern.com <wpk235@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refs fern-api/fern-platform#8209
Adds a new
code-themeoption todocs.ymlsettingsthat lets customers override the Shiki syntax highlighting themes used in code blocks, with separate light/dark mode support.Link to Devin Session: https://app.devin.ai/sessions/1012460edf4844c08456fc8e5a17f727
Requested by: @willkendall01
Changes Made
CodeThemeConfigtype to Fern API definition (fern/apis/docs-yml/definition/docs.yml) with optionallightanddarkstring fieldscode-themefield toDocsSettingsConfigin the API definitionCodeThemeConfigDocsSettingsConfigin both API and serialization layers to includecodeThemeDocsYmlSchemas.ts,DocsSettingsConfigSchema.ts) with the new fielddocs-yml.schema.jsonat root andpackages/cli/workspace/loader/src/) viapnpm jsonschemaversions.yml(v4.18.0)Example
docs.ymlusage:Updates Since Last Revision
codeThemeplumbing fromparseDocsConfiguration.ts: The return type (CjsFdrSdk.docs.v1.commons.DocsSettingsConfig) comes from the published FDR CJS SDK on npm, which doesn't includecodeThemeyet. The field will be plumbed through once fern-platform#8209 merges, the FDR SDK is regenerated/published, and this repo consumes the updated package. For now, the CLI accepts and validates the config but does not forward it at runtime.pnpm jsonschemato match the correct definition ordering and formatting expected by CI lint.versions.ymlentry: v4.18.0 feat entry for the newcode-themesetting.Companion PR
This PR provides the schema/CLI side. The runtime consumption (applying themes to Shiki) is in fern-api/fern-platform#8209. Both PRs are needed for the feature to work end-to-end.
Deployment order: fern-platform#8209 should merge first → FDR SDK gets republished → then a follow-up commit here adds the
parseDocsConfiguration.tsplumbing to forwardcodeThemeto the platform.Review Checklist
CodeThemeConfig.tsin api/serialization) match what Fern would auto-generate from the API definition — they carry the "auto-generated" comment"code-theme"serialization key inDocsSettingsConfigserializer correctly maps to the kebab-case API fieldversions.ymlparseDocsConfiguration.tsdoes not forwardcodeThemeyet — this is intentional (FDR SDK dependency, see above). Confirm this gap is acceptable.BundledThemelist — invalid names will fall back to defaults at runtime (handled in the platform PR)Testing
pnpm run check(Biome) passespnpm compilepasses (including@fern-api/configuration-loader)pnpm jsonschemaregenerated and committed