Skip to content

Commit

Permalink
feat(remark): add remark-hint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Dec 11, 2022
1 parent 3de78c9 commit 22da1f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contentlayer.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
import remarkBreaks from 'remark-breaks'
import remarkHint from 'remark-hint'
import rehypePrettyCode from 'rehype-pretty-code'
import rehypeSlug from 'rehype-slug'
import rehypeToc from 'rehype-toc'
Expand All @@ -16,7 +17,7 @@ export default makeSource({
contentDirPath: 'content',
documentTypes: [Post],
mdx: {
remarkPlugins: [remarkGfm, remarkMath, remarkBreaks],
remarkPlugins: [remarkGfm, remarkMath, remarkBreaks, remarkHint],
rehypePlugins: [
[rehypePrettyCode, rehypePrettyCodeOptions],
rehypeSlug,
Expand Down
14 changes: 14 additions & 0 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,19 @@
@apply inline;
}
}

p.hint {
@apply border rounded w-max p-3;

&.tip {
@apply text-cyan-900 border-cyan-900 bg-cyan-900/10;
}
&.warn {
@apply text-amber-900 border-amber-900 bg-amber-900/10;
}
&.error {
@apply text-red-900 border-red-900 bg-red-900/10;
}
}
}
}

0 comments on commit 22da1f0

Please sign in to comment.