svelte-readme 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/highlight/shared.d.ts +1 -0
- package/dist/index.js +148 -36
- package/dist/layout.css +100 -7
- package/dist/shared.css +44 -8
- package/dist/style.css +282 -86
- package/dist/svelte.css +5 -5
- package/dist/typescript.css +3 -3
- package/dist/utils/purgeCss.d.ts +1 -1
- package/dist/yaml.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,6 +130,36 @@ interface SvelteReadmeOptions {
|
|
|
130
130
|
}
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
+
### Custom fonts
|
|
134
|
+
|
|
135
|
+
Load fonts from a CDN via `head`, then point the library's `--sr-font-sans` (body text) and `--sr-font-mono` (code snippets) custom properties (see [style.css](src/styles/style.css)) at them via `style`:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { svelteReadme } from "svelte-readme";
|
|
139
|
+
import { defineConfig } from "vite";
|
|
140
|
+
|
|
141
|
+
export default defineConfig({
|
|
142
|
+
plugins: [
|
|
143
|
+
svelteReadme({
|
|
144
|
+
head: `
|
|
145
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
146
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
147
|
+
<link
|
|
148
|
+
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Public+Sans:wght@400;500;600;700&display=swap"
|
|
149
|
+
rel="stylesheet"
|
|
150
|
+
/>
|
|
151
|
+
`,
|
|
152
|
+
style: `
|
|
153
|
+
:root {
|
|
154
|
+
--sr-font-sans: "Public Sans", system-ui, sans-serif;
|
|
155
|
+
--sr-font-mono: "JetBrains Mono", ui-monospace, monospace;
|
|
156
|
+
}
|
|
157
|
+
`,
|
|
158
|
+
}),
|
|
159
|
+
],
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
133
163
|
## Changelog
|
|
134
164
|
|
|
135
165
|
[CHANGELOG.md](CHANGELOG.md)
|
|
@@ -6,6 +6,7 @@ export type Claim = {
|
|
|
6
6
|
export type GapFill = (text: string) => string;
|
|
7
7
|
export declare function escapeHtml(text: string): string;
|
|
8
8
|
export declare function token(className: string, text: string): string;
|
|
9
|
+
export declare function readGrammarCss(moduleUrl: string, filename: string): string;
|
|
9
10
|
export declare const baseTokenStyles: string;
|
|
10
11
|
export declare function renderClaims(source: string, claims: Claim[], gapFill: GapFill): string;
|
|
11
12
|
export declare function gapFill(text: string): string;
|