-
Notifications
You must be signed in to change notification settings - Fork 3
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
Expose Shiki and Remark #69
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fe7b729
Add ability to set shiki transformers and remark plugins
mrjvs 9b0ca81
Fix bug with empty remark plugin set
mrjvs 06ec877
Fix incorrect information in config docs
mrjvs 4a480e1
Add docs for `guider()` entrypoint
mrjvs 5d96724
Update showcases
mrjvs da0f301
Bump versions
mrjvs 6d07490
Fix linting
mrjvs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
apps/docs/pages/docs/guider/api-reference/setup/guider.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# `guider()` | ||
|
||
This function is the way you inject Guider into NextJS. You can use its options | ||
to change how Guider behaves in the compile step. | ||
|
||
|
||
## Example | ||
|
||
```tsx title="/next.config.mjs" | ||
import { guider } from "@neato/guider"; | ||
|
||
const withGuider = guider({ | ||
themeConfig: './theme.config.tsx', | ||
}); | ||
|
||
export default withGuider({ | ||
output: 'export', | ||
}); | ||
``` | ||
|
||
|
||
## Reference | ||
|
||
```tsx | ||
function guider(options); | ||
``` | ||
|
||
<Field title="options" type="DirectoryOptions" required> | ||
Options for the redirect. | ||
|
||
<Field.Properties defaultOpen> | ||
<Field title="themeConfig" type="string" required> | ||
The location of the theme file, the theme file is used to configure almost everything about guider. | ||
</Field> | ||
<Field title="extraRemarkPlugins" type="RemarkPlugin[]"> | ||
A list where you can specify [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md) to use on top of the default list of plugins. | ||
|
||
Use it to add new features to your markdown files. | ||
</Field> | ||
<Field title="remarkPlugins" type="RemarkPlugin[]"> | ||
A list where you can specify [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md) to use **instead of the default Guider plugins**. | ||
|
||
Use it to overwrite how markdown parsing works. **Be aware that this will disable a lot of the default features of Guider, use at your own risk.** Use `extraRemarkPlugins` instead if you want to add extra plugins without breaking existing functionality. | ||
</Field> | ||
<Field title="extraShikiTransformers" type="ShikiTransformer[]"> | ||
A list where you can specify [Shiki transformers](https://shiki.style/guide/transformers) to use on top of the default transformers. | ||
|
||
Use it to add new features to syntax highlighting in codeblocks. | ||
</Field> | ||
<Field title="shikiTransformers" type="ShikiTransformer[]"> | ||
A list where you can specify [Shiki transformers](https://shiki.style/guide/transformers) to use **instead of the default Guider transformers**. | ||
|
||
Use it to overwrite how syntax highlighting works in Guider. **Be aware that this will disable a lot of the default features of Guider, use at your own risk.** Use `extraShikiTransformers` instead if you want to add extra transformers without breaking existing functionality. | ||
</Field> | ||
</Field.Properties> | ||
</Field> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ import { Showcase } from 'components/showcase-layout'; | |
import type { ShowcaseTag, ShowcaseType } from 'components/showcase-card'; | ||
import { ShowcaseCard, ShowcaseCardContainer } from 'components/showcase-card'; | ||
import pretendoImg from 'public/showcases/pretendo.png'; | ||
import mwAccountImg from 'public/showcases/movie-web-account.png'; | ||
import mwDocsImg from 'public/showcases/movie-web-docs.png'; | ||
|
||
const showcases: ShowcaseType[] = [ | ||
{ | ||
|
@@ -15,20 +13,6 @@ const showcases: ShowcaseType[] = [ | |
imageUrl: pretendoImg.src, | ||
tags: ['guider'], | ||
}, | ||
{ | ||
title: 'movie-web backend', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rip |
||
description: 'Uses Config for their account service.', | ||
href: 'https://github.com/movie-web/backend/', | ||
imageUrl: mwAccountImg.src, | ||
tags: ['config'], | ||
}, | ||
{ | ||
title: 'movie-web docs', | ||
description: 'Uses Guider for their documentation', | ||
href: 'https://github.com/movie-web/docs/', | ||
imageUrl: mwDocsImg.src, | ||
tags: ['guider'], | ||
}, | ||
]; | ||
|
||
export default function ShowcasePage() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ module.exports = { | |
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} | ||
}; |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
import type { ShikiTransformer } from 'shiki'; | ||
import type { PluggableList } from 'unified'; | ||
|
||
export type GuiderInitConfig = { | ||
/** | ||
* The location of the theme config | ||
*/ | ||
themeConfig: string; | ||
|
||
/** | ||
* Extra shiki transformers added to syntax highlighted code | ||
*/ | ||
extraShikiTransformers?: ShikiTransformer[]; | ||
|
||
/** | ||
* Replaces all shiki transformers added to syntax highlighted code | ||
*/ | ||
shikiTransformers?: ShikiTransformer[]; | ||
|
||
/** | ||
* Extra remark plugins added to markdown parsing | ||
*/ | ||
extraRemarkPlugins?: PluggableList; | ||
|
||
/** | ||
* Replaces all remark plugins added to markdown parsing | ||
* NOTE: This disables and breaks a lot of features of Guider, use at your own risk. | ||
*/ | ||
remarkPlugins?: PluggableList; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node modules maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although why ignore these if you've changed the linting to run on the src folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Src folder was only for
create-guider
projectThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also node_modules are ignore by default by eslint