Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support to Prism for the Astro language #19

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

simonplend
Copy link
Contributor

This enables syntax highlighting for astro code blocks.

The @astro/prism package is pinned to v1.0.1 as we're importing a module from it that isn't exposed by the package.

prism-include-languages.js was generated with:

npm run swizzle @docusaurus/theme-classic prism-include-languages

See: https://docusaurus.io/docs/markdown-features/code-blocks#supported-languages

This enables syntax highlighting for `astro` code blocks.

The `@astro/prism` package is pinned to v1.0.1 as we're
importing a module from it that isn't exposed by the
package.

`prism-include-languages.js` was generated with:

```bash
npm run swizzle @docusaurus/theme-classic prism-include-languages
```

See: https://docusaurus.io/docs/markdown-features/code-blocks#supported-languages

// TODO: This is a hack. This can be done properly if Astro agree to the
// package exposing this entrypoint.
require('../../node_modules/@astrojs/prism/dist/plugin.js').addAstro(PrismObject);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created an issue for replacing this hack: #20

@simonplend simonplend added the enhancement New feature or request label Sep 19, 2022
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 8fcebb4 into main Sep 19, 2022
@simonplend simonplend deleted the add-prism-language-astro branch September 19, 2022 12:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants