Skip to content

feat(cli): add configurable syntax highlighting themes via code-theme setting#13254

Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1773063588-configurable-code-theme
Open

feat(cli): add configurable syntax highlighting themes via code-theme setting#13254
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1773063588-configurable-code-theme

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 9, 2026

Description

Refs fern-api/fern-platform#8209

Adds a new code-theme option to docs.yml settings that 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

  • Added CodeThemeConfig type to Fern API definition (fern/apis/docs-yml/definition/docs.yml) with optional light and dark string fields
  • Added code-theme field to DocsSettingsConfig in the API definition
  • Created SDK API and serialization type files for CodeThemeConfig
  • Updated DocsSettingsConfig in both API and serialization layers to include codeTheme
  • Updated Zod schemas (DocsYmlSchemas.ts, DocsSettingsConfigSchema.ts) with the new field
  • Regenerated JSON schemas (docs-yml.schema.json at root and packages/cli/workspace/loader/src/) via pnpm jsonschema
  • Added CLI changelog entry in versions.yml (v4.18.0)

Example docs.yml usage:

settings:
  code-theme:
    light: github-light
    dark: dracula

Updates Since Last Revision

  • Removed codeTheme plumbing from parseDocsConfiguration.ts: The return type (CjsFdrSdk.docs.v1.commons.DocsSettingsConfig) comes from the published FDR CJS SDK on npm, which doesn't include codeTheme yet. 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.
  • Regenerated JSON schema files: Previously hand-edited, now regenerated via pnpm jsonschema to match the correct definition ordering and formatting expected by CI lint.
  • Added versions.yml entry: v4.18.0 feat entry for the new code-theme setting.

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.ts plumbing to forward codeTheme to the platform.

Review Checklist

  • Verify the hand-written SDK types (CodeThemeConfig.ts in api/serialization) match what Fern would auto-generate from the API definition — they carry the "auto-generated" comment
  • Confirm "code-theme" serialization key in DocsSettingsConfig serializer correctly maps to the kebab-case API field
  • Verify v4.18.0 is the correct next version in versions.yml
  • Note: parseDocsConfiguration.ts does not forward codeTheme yet — this is intentional (FDR SDK dependency, see above). Confirm this gap is acceptable.
  • Note: theme names are accepted as free-form strings with no validation against Shiki's BundledTheme list — invalid names will fall back to defaults at runtime (handled in the platform PR)

Testing

  • pnpm run check (Biome) passes
  • pnpm compile passes (including @fern-api/configuration-loader)
  • pnpm jsonschema regenerated and committed
  • All required CI checks pass (compile, lint, biome, test, test-ete, depcheck, versions.yml validation)
  • Manual end-to-end testing requires both this PR and fern-platform#8209 to be deployed

… highlighting

Co-Authored-By: will.kendall@buildwithfern.com <wpk235@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits March 9, 2026 13:52
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant