cfahlgren1 HF staff commited on
Commit
d25a864
1 Parent(s): 14c1612

update snippet

Browse files
Files changed (2) hide show
  1. src/snippets/leakage.md +1 -1
  2. svelte.config.js +6 -6
src/snippets/leakage.md CHANGED
@@ -27,7 +27,7 @@ code: |
27
  FROM overlapping_rows, total_unique_rows;
28
  ---
29
 
30
- # DuckDB Leakage Detection Query
31
 
32
  This snippet demonstrates how to use DuckDB to detect potential data leakage between train and test datasets by calculating the overlap percentage.
33
 
 
27
  FROM overlapping_rows, total_unique_rows;
28
  ---
29
 
30
+ # Dataset Leakage Detection
31
 
32
  This snippet demonstrates how to use DuckDB to detect potential data leakage between train and test datasets by calculating the overlap percentage.
33
 
svelte.config.js CHANGED
@@ -1,19 +1,19 @@
1
  import adapter from '@sveltejs/adapter-node'
2
  import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
3
-
4
  import { mdsvex, escapeSvelte } from 'mdsvex'
5
  import { createHighlighter } from 'shiki'
6
 
 
 
 
 
 
7
  /** @type {import('mdsvex').MdsvexOptions} */
8
  const mdsvexOptions = {
9
  extensions: ['.md'],
10
  highlight: {
11
  highlighter: async (code, lang = 'text') => {
12
- const highlighter = await createHighlighter({
13
- themes: ['github-dark'],
14
- langs: [ 'sql']
15
- })
16
- await highlighter.loadLanguage('sql')
17
  const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'github-dark' }))
18
  return `{@html \`${html}\` }`
19
  }
 
1
  import adapter from '@sveltejs/adapter-node'
2
  import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
 
3
  import { mdsvex, escapeSvelte } from 'mdsvex'
4
  import { createHighlighter } from 'shiki'
5
 
6
+ const highlighterPromise = createHighlighter({
7
+ themes: ['github-dark'],
8
+ langs: ['sql', 'text']
9
+ })
10
+
11
  /** @type {import('mdsvex').MdsvexOptions} */
12
  const mdsvexOptions = {
13
  extensions: ['.md'],
14
  highlight: {
15
  highlighter: async (code, lang = 'text') => {
16
+ const highlighter = await highlighterPromise
 
 
 
 
17
  const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'github-dark' }))
18
  return `{@html \`${html}\` }`
19
  }