Skip to content

Commit

Permalink
fix: shiki languages
Browse files Browse the repository at this point in the history
  • Loading branch information
gregermendle committed Nov 21, 2023
1 parent 793ba9e commit 5d6c502
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/example/app/routes/__toc.docs.installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { code as previewCode } from "~/routes/__layout._index";
export const loader = async () => {
return shiki.shikiize({
install: {
lang: "bash",
lang: "shellscript",
code: `
# install remix-mailer and nodemailer transport
npm i remix-mailer nodemailer
# install remix-mailer core library
npm i remix-mailer
`,
},
basic: {
Expand All @@ -27,10 +27,10 @@ npm i remix-mailer nodemailer

`remix-mailer` contains a set of components and utilities that can be used to preview email templates. _(technically they dont even need to be emails, it could honestly be anything.)_

<Shikiize id="install" />
<Shikiize id="install" />

## Basic Usage

The fastest way to get started with `remix-mailer` is to use the built-in `<PreviewBrowser />` component and `loadPreviews` utility.

<Shikiize id="basic" />
<Shikiize id="basic" />
2 changes: 2 additions & 0 deletions apps/example/app/shiki.server.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { json } from "@remix-run/node";
import { Lang } from "shiki";
import "shiki/languages/tsx.tmLanguage.json";
import "shiki/languages/shellscript.tmLanguage.json";
import "shiki/themes/css-variables.json";
import shiki from "shiki";
export * from "shiki";
Expand All @@ -13,6 +14,7 @@ export interface Block {
export const shikiize = async (blocksToRender: Record<string, Block>) => {
const highlighter = await shiki.getHighlighter({
theme: "css-variables",
langs: ["shellscript", "tsx"],
});

const blocks = Object.entries(blocksToRender).map(([key, block]) => [
Expand Down

0 comments on commit 5d6c502

Please sign in to comment.