mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 20:14:39 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e837b33c36 |
6
site/package-lock.json
generated
6
site/package-lock.json
generated
@@ -846,9 +846,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@sveltejs/site-kit": {
|
"@sveltejs/site-kit": {
|
||||||
"version": "1.1.1",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.0.4.tgz",
|
||||||
"integrity": "sha512-EYQKhrdbRWeaPteTN1YZ4oW0xBbUzQ2D+XPdIfEvwDvgxAka9KZP5BCiENrXFf7Z9lxe2HW6MDlrT2sMwoS8+g==",
|
"integrity": "sha512-BaQhIL1iPhCF+iDXfy9psDvRdFzfyMPkWnoZHfVz+INpHsU2aJmRZOPl9rykXmPyiPo+AwTTNK5vjIvmtwHLPQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@sindresorhus/slugify": "^0.9.1",
|
"@sindresorhus/slugify": "^0.9.1",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"@babel/plugin-transform-runtime": "^7.4.4",
|
"@babel/plugin-transform-runtime": "^7.4.4",
|
||||||
"@babel/preset-env": "^7.4.4",
|
"@babel/preset-env": "^7.4.4",
|
||||||
"@babel/runtime": "^7.4.4",
|
"@babel/runtime": "^7.4.4",
|
||||||
"@sveltejs/site-kit": "^1.1.1",
|
"@sveltejs/site-kit": "^1.0.4",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"rollup": "^1.11.3",
|
"rollup": "^1.11.3",
|
||||||
"rollup-plugin-babel": "^4.3.2",
|
"rollup-plugin-babel": "^4.3.2",
|
||||||
|
|||||||
@@ -19,4 +19,4 @@
|
|||||||
<meta name="Description" content="The next small thing in web development">
|
<meta name="Description" content="The next small thing in web development">
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<Docs {sections} project="sapper"/>
|
<Docs {sections}/>
|
||||||
|
|||||||
@@ -19,4 +19,4 @@
|
|||||||
<meta name="Description" content="The next small thing in web development">
|
<meta name="Description" content="The next small thing in web development">
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<Docs {sections} project="sapper" dir="migrating"/>
|
<Docs {sections}/>
|
||||||
|
|||||||
@@ -7,6 +7,23 @@ import { make_session_slug_processor } from '@sveltejs/site-kit/utils/slug';
|
|||||||
import marked from 'marked';
|
import marked from 'marked';
|
||||||
import hljs from 'highlight.js';
|
import hljs from 'highlight.js';
|
||||||
|
|
||||||
|
const escaped = {
|
||||||
|
'"': '"',
|
||||||
|
"'": ''',
|
||||||
|
'&': '&',
|
||||||
|
'<': '<',
|
||||||
|
'>': '>',
|
||||||
|
};
|
||||||
|
|
||||||
|
const unescaped = Object.keys(escaped).reduce(
|
||||||
|
(unescaped, key) => ((unescaped[escaped[key]] = key), unescaped),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
function unescape(str) {
|
||||||
|
return String(str).replace(/&.+?;/g, match => unescaped[match] || match);
|
||||||
|
}
|
||||||
|
|
||||||
const block_types = [
|
const block_types = [
|
||||||
'blockquote',
|
'blockquote',
|
||||||
'html',
|
'html',
|
||||||
@@ -98,13 +115,15 @@ export default function generate_docs(dir) {
|
|||||||
const slug = level <= 4 && make_slug(rawtext);
|
const slug = level <= 4 && make_slug(rawtext);
|
||||||
|
|
||||||
if (level === 3 || level === 4) {
|
if (level === 3 || level === 4) {
|
||||||
const title = text
|
const title = unescape(
|
||||||
.replace(/<\/?code>/g, '')
|
text
|
||||||
.replace(/\.(\w+)(\((.+)?\))?/, (m, $1, $2, $3) => {
|
.replace(/<\/?code>/g, '')
|
||||||
if ($3) return `.${$1}(...)`;
|
.replace(/\.(\w+)(\((.+)?\))?/, (m, $1, $2, $3) => {
|
||||||
if ($2) return `.${$1}()`;
|
if ($3) return `.${$1}(...)`;
|
||||||
return `.${$1}`;
|
if ($2) return `.${$1}()`;
|
||||||
});
|
return `.${$1}`;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
subsections.push({ slug, title, level });
|
subsections.push({ slug, title, level });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ prog.command('export [dest]')
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
prog.parse(process.argv);
|
prog.parse(process.argv, { unknown: (arg: string) => `Unknown option: ${arg}` });
|
||||||
|
|
||||||
|
|
||||||
async function _build(
|
async function _build(
|
||||||
|
|||||||
Reference in New Issue
Block a user