-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
256f11a
commit eec70a6
Showing
9 changed files
with
183 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/** | ||
* Gruvbox dark theme | ||
* | ||
* Adapted from a theme based on: | ||
* Vim Gruvbox dark Theme (https://github.com/morhetz/gruvbox) | ||
* | ||
* @author Azat S. <[email protected]> | ||
* @version 1.0 | ||
*/ | ||
|
||
code[class*="language-"], | ||
pre[class*="language-"] { | ||
color: #ebdbb2; /* fg1 / fg */ | ||
direction: ltr; | ||
text-align: left; | ||
white-space: pre; | ||
word-spacing: normal; | ||
word-break: normal; | ||
|
||
-moz-tab-size: 4; | ||
-o-tab-size: 4; | ||
tab-size: 4; | ||
|
||
-webkit-hyphens: none; | ||
-moz-hyphens: none; | ||
-ms-hyphens: none; | ||
hyphens: none; | ||
} | ||
|
||
.token.comment, | ||
.token.prolog, | ||
.token.cdata { | ||
color: #a89984; /* fg4 / gray1 */ | ||
} | ||
|
||
.token.delimiter, | ||
.token.boolean, | ||
.token.keyword, | ||
.token.selector, | ||
.token.important, | ||
.token.atrule { | ||
color: #fb4934; /* red2 */ | ||
} | ||
|
||
.token.operator, | ||
.token.punctuation, | ||
.token.attr-name { | ||
color: #a89984; /* fg4 / gray1 */ | ||
} | ||
|
||
.token.tag, | ||
.token.tag .punctuation, | ||
.token.doctype, | ||
.token.builtin { | ||
color: #fabd2f; /* yellow2 */ | ||
} | ||
|
||
.token.entity, | ||
.token.number, | ||
.token.symbol { | ||
color: #d3869b; /* purple2 */ | ||
} | ||
|
||
.token.property, | ||
.token.constant, | ||
.token.variable { | ||
color: #fb4934; /* red2 */ | ||
} | ||
|
||
.token.string, | ||
.token.char { | ||
color: #b8bb26; /* green2 */ | ||
} | ||
|
||
.token.attr-value, | ||
.token.attr-value .punctuation { | ||
color: #a89984; /* fg4 / gray1 */ | ||
} | ||
|
||
.token.url { | ||
color: #b8bb26; /* green2 */ | ||
text-decoration: underline; | ||
} | ||
|
||
.token.function { | ||
color: #fabd2f; /* yellow2 */ | ||
} | ||
|
||
.token.regex { | ||
background: #b8bb26; /* green2 */ | ||
} | ||
|
||
.token.bold { | ||
font-weight: bold; | ||
} | ||
|
||
.token.italic { | ||
font-style: italic; | ||
} | ||
|
||
.token.inserted { | ||
background: #a89984; /* fg4 / gray1 */ | ||
} | ||
|
||
.token.deleted { | ||
background: #fb4934; /* red2 */ | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script> | ||
import Prism from "prismjs" | ||
import "$lib/prism.css" | ||
import "prismjs/components/prism-javascript.js" | ||
import "prismjs/components/prism-typescript.js" | ||
import "prismjs/components/prism-bash.js" | ||
Prism.manual = true; | ||
const GRAMMARS = { | ||
//@ts-ignore | ||
"javascript" : Prism.languages.javascript, | ||
//@ts-ignore | ||
"typescript" : Prism.languages.typescript, | ||
//@ts-ignore | ||
"bash" : Prism.languages.bash, | ||
} | ||
/** @type {keyof typeof GRAMMARS}*/ | ||
export let language; | ||
/** @type {string}*/ | ||
export let code; | ||
$: html = Prism.highlight(code, GRAMMARS[language], language); | ||
</script> | ||
|
||
<svelte:options immutable={true} /> | ||
<pre class="language-{language}"><code class="language-{language}">{@html html}</code></pre> |
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,10 +1,16 @@ | ||
<script> | ||
import CodeGroup from "$lib/ui/CodeGroup.svelte"; | ||
import Prism from "$lib/ui/Prism.svelte"; | ||
</script> | ||
|
||
<CodeGroup let:Header let:Tab> | ||
<Header title="Installation" /> | ||
<Tab name="npm">npm install --save-dev t18s</Tab> | ||
<Tab name="yarn">yarn add --dev t18s</Tab> | ||
<Tab name="pnpm">pnpm add --save-dev t18s</Tab> | ||
</CodeGroup> | ||
<Tab name="npm"><Prism code="npm install --save-dev t18s" language="bash" /></Tab> | ||
<Tab name="yarn"><Prism code="yarn add --dev t18s" language="bash" /></Tab> | ||
<Tab name="pnpm"><Prism code="pnpm add --save-dev t18s" language="bash" /></Tab> | ||
</CodeGroup> | ||
|
||
<CodeGroup let:Header let:Tab> | ||
<Header title="Highlighting" /> | ||
<Tab><Prism code="console.log('Hello World')" language="javascript" /></Tab> | ||
</CodeGroup> |
25 changes: 12 additions & 13 deletions
25
site/src/routes/[[locale=locale]]/getting-started/+page.svelte
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,28 +1,27 @@ | ||
<script> | ||
import CodeGroup from "$lib/ui/CodeGroup.svelte"; | ||
import ViteConfigSnippet from "./vite-config-snippet.js?raw"; | ||
import Prism from "$lib/ui/Prism.svelte"; | ||
</script> | ||
|
||
<h1>Getting Started</h1> | ||
|
||
<p> | ||
First you need to install t18s as a dev dependency. | ||
</p> | ||
<p>First you need to install t18s as a dev dependency.</p> | ||
|
||
<CodeGroup let:Tab> | ||
<Tab>npm install --save-dev t18s</Tab> | ||
<Tab>npm install --save-dev t18s</Tab> | ||
</CodeGroup> | ||
|
||
<p> | ||
T18S isn't just a library, it's a vite-plugin, so you will need to register it in your vite config. | ||
T18S isn't just a library, it's a vite-plugin, so you will need to register it | ||
in your vite config. | ||
</p> | ||
|
||
<CodeGroup let:Header let:Tab> | ||
<Header title="vite.config.js" /> | ||
<Tab> | ||
</Tab> | ||
<Header title="vite.config.js" /> | ||
<Tab> | ||
<Prism code={ViteConfigSnippet} language="javascript" /> | ||
</Tab> | ||
</CodeGroup> | ||
|
||
<p> | ||
Aaaand we're off. | ||
</p> | ||
<p>Aaaand we're off.</p> |
13 changes: 13 additions & 0 deletions
13
site/src/routes/[[locale=locale]]/getting-started/vite-config-snippet.js
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,13 @@ | ||
import { sveltekit } from "@sveltejs/kit/vite"; | ||
import { t18s } from "t18s"; | ||
import { defineConfig } from "vite"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
sveltekit(), | ||
t18s({ | ||
locales: ["en", "de"], | ||
fallbackLocale: "en", | ||
}), | ||
], | ||
}); |