Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

556 code blocks #745

Draft
wants to merge 68 commits into
base: main
Choose a base branch
from
Draft

556 code blocks #745

wants to merge 68 commits into from

Conversation

andrewrisse
Copy link
Contributor

@andrewrisse andrewrisse commented Jul 9, 2024

Adds formatting for code blocks.

Node about the new CodeBlock.svelte component:

The markdown-it highlight option used in Message.svelte does not allow us to insert normal Svelte components in the
code block that it returns. This CodeBlock.svelte component is instead used as a web component within that
function to properly render the code blocks with highlighting and a copy button.
We have to forgo shadow root creation so that styles are no longer encapsulated (e.g. shadow: 'none') in the
customElement definition above.
In order to access styles from highlight.js and carbon, we import those sub-components into this one.
Trying to use the styles from within this component will not work.

Copy link

netlify bot commented Jul 9, 2024

Deploy Preview for leapfrogai-docs canceled.

Name Link
🔨 Latest commit 722337b
🔍 Latest deploy log https://app.netlify.com/sites/leapfrogai-docs/deploys/668eded5303b6a00085153e9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant