Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature Request: control which Markdown files are processed by Expressive Code #347

@delucis

Description

@delucis

Support for selectively applying Expressive Code only to some Markdown documents.

We had a request in withastro/starlight#3220 to only apply Expressive Code to documents Starlight controls to allow code in other Markdown pages in a site to look different.

To do that, I suppose EC would need a configuration option to allow specifying the file paths it should process. For example an API something like:

expressiveCode({
  paths: ["src/content/docs/**"],
})

It would also open up the question (at least thinking about an Astro context) of whether multiple EC instances could make sense to have different styles for different parts of a site:

integrations: [
  expressiveCode({ paths: ["src/content/docs/**"], /* some config */ }),
  expressiveCode({ paths: ["src/content/blog/**"], /* some different config */ }),
],

That part is probably not so simple given considerations like the <Code> component, but wanted to share this here in case people have similar needs or thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions