shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.08k stars 53 forks source link

Ignore option #86

Closed frencojobs closed 3 years ago

frencojobs commented 3 years ago

This PR does

For example,

{
    "theme": "nord",
    "ignoreCodeblocksWithCodefenceMeta": ["live"] // ```jsx live - will be ignored
}

This feature won't do anything until we remove the MDXComponents file in docusaurus preset. The canary release of Docusaurus is now working fine without the MDXComponents but not having the file breaks twoslash in all other older versions of Docusaurus. I'd like to wait for (at least) a major release to remove the file. #72 will have to wait for that.

To see the results, simply update all docusaurus plugins in the example/docusaurus to canary and remove the MDXComponents file in the preset (locally for now).

changeset-bot[bot] commented 3 years ago

⚠️ No Changeset found

Latest commit: 00b38f50478ed9d324c45292bb8a9d12ba306439

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

frencojobs commented 3 years ago

Optional: We could also apply this to the docusaurus config? Given that the live code blocks are documented in the official docusaurus site, it feels reasonable to assume that to 'just work'

The config object is the same right? I'm pretty sure the docusaurus config will be passed down to remark.

frencojobs commented 3 years ago

Oh, you mean the live ignore option. Yea we could totally do that, but we can also do that later after we've removed the MDXComponents file. Doing it later together with removing MDXComponents sounds better to me since it fits the scope of solving the #72 better.