-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from mrjvs/feat-expose-shiki
Expose Shiki and Remark
- Loading branch information
Showing
19 changed files
with
194 additions
and
98 deletions.
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
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.