prettier format

pull/8289/head
Puru Vijay 3 years ago
parent 5da78e3e46
commit 47709f0c5b

@ -8,3 +8,4 @@ scripts/*
/test
.svelte-kit
types
.vercel

@ -1248,6 +1248,18 @@
"vite": "^4.0.0"
}
},
"node_modules/@sveltejs/kit/node_modules/magic-string": {
"version": "0.30.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz",
"integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==",
"dev": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.13"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@sveltejs/repl": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@sveltejs/repl/-/repl-0.2.0.tgz",
@ -2539,9 +2551,9 @@
}
},
"node_modules/magic-string": {
"version": "0.30.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz",
"integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==",
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz",
"integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==",
"dev": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.13"
@ -3743,18 +3755,6 @@
}
}
},
"node_modules/svelte-preprocess/node_modules/magic-string": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz",
"integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==",
"dev": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.13"
},
"engines": {
"node": ">=12"
}
},
"node_modules/tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",

@ -14,7 +14,7 @@ const escape_replacements = {
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
"'": '&#39;'
};
const get_escape_replacement = (ch) => escape_replacements[ch];
@ -45,7 +45,7 @@ const prism_languages = {
css: 'css',
diff: 'diff',
ts: 'typescript',
'': '',
'': ''
};
/** @type {Partial<import('marked').Renderer>} */
@ -165,7 +165,7 @@ const default_renderer = {
text(text) {
return text;
},
}
};
/**
@ -179,8 +179,8 @@ export function transform(markdown, renderer = {}) {
// options are global, and merged in confusing ways. You can't do e.g.
// `new Marked(options).parse(markdown)`
...default_renderer,
...renderer,
},
...renderer
}
});
return marked(markdown);

@ -16,7 +16,7 @@ export function get_examples_data() {
const section = {
title: '', // Initialise with empty
slug: subdir.split('-').slice(1).join('-'),
examples: [],
examples: []
};
if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue;
@ -44,7 +44,7 @@ export function get_examples_data() {
files.push({
filename: file,
type: file.split('.').at(-1),
content: fs.readFileSync(`${example_base_dir}/${file}`, 'utf-8'),
content: fs.readFileSync(`${example_base_dir}/${file}`, 'utf-8')
});
}
@ -66,7 +66,7 @@ export function get_examples_list(examples_data) {
title: section.title,
examples: section.examples.map((example) => ({
title: example.title,
slug: example.slug,
})),
slug: example.slug
}))
}));
}

@ -14,7 +14,7 @@ export function get_tutorial_data() {
const section = {
title: '', // Initialise with empty
slug: subdir.split('-').slice(1).join('-'),
tutorials: [],
tutorials: []
};
if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue;
@ -46,7 +46,7 @@ export function get_tutorial_data() {
completion_states_data[app_dir === 'app-a' ? 'initial' : 'complete'].push({
name: file,
type: file.split('.').at(-1),
content: fs.readFileSync(`${app_dir_path}/${file}`, 'utf-8'),
content: fs.readFileSync(`${app_dir_path}/${file}`, 'utf-8')
});
}
}
@ -56,7 +56,7 @@ export function get_tutorial_data() {
slug,
content: body,
dir: `${subdir}/${section_dir}`,
...completion_states_data,
...completion_states_data
});
}
@ -75,7 +75,7 @@ export function get_tutorial_list(tutorial_data) {
title: section.title,
tutorials: section.tutorials.map((tutorial) => ({
title: tutorial.title,
slug: tutorial.slug,
})),
slug: tutorial.slug
}))
}));
}

@ -11,7 +11,7 @@ const languages = {
css: 'css',
diff: 'diff',
ts: 'typescript',
'': '',
'': ''
};
/**
@ -82,7 +82,7 @@ export async function get_parsed_tutorial(tutorial_data, slug) {
return html;
},
codespan: (text) => '<code>' + text + '</code>',
codespan: (text) => '<code>' + text + '</code>'
});
return { ...tutorial, content };

@ -12,6 +12,6 @@ export async function load({ params }) {
return {
examples_list,
example,
slug: params.slug,
slug: params.slug
};
}

@ -15,6 +15,6 @@ export async function load({ params }) {
return {
tutorials_list,
tutorial,
slug: params.slug,
slug: params.slug
};
}

Loading…
Cancel
Save