Compare commits

...

3 Commits

Author SHA1 Message Date
Richard Harris
201a0eb2f6 fix edit links 2019-06-16 15:22:52 -04:00
Richard Harris
4f0ab31049 html titles 2019-06-16 15:18:40 -04:00
Richard Harris
d97efda10b update site-kit 2019-06-16 14:43:01 -04:00
5 changed files with 13 additions and 32 deletions

View File

@@ -846,9 +846,9 @@
}
},
"@sveltejs/site-kit": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.0.4.tgz",
"integrity": "sha512-BaQhIL1iPhCF+iDXfy9psDvRdFzfyMPkWnoZHfVz+INpHsU2aJmRZOPl9rykXmPyiPo+AwTTNK5vjIvmtwHLPQ==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.1.1.tgz",
"integrity": "sha512-EYQKhrdbRWeaPteTN1YZ4oW0xBbUzQ2D+XPdIfEvwDvgxAka9KZP5BCiENrXFf7Z9lxe2HW6MDlrT2sMwoS8+g==",
"dev": true,
"requires": {
"@sindresorhus/slugify": "^0.9.1",

View File

@@ -28,7 +28,7 @@
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/runtime": "^7.4.4",
"@sveltejs/site-kit": "^1.0.4",
"@sveltejs/site-kit": "^1.1.1",
"npm-run-all": "^4.1.5",
"rollup": "^1.11.3",
"rollup-plugin-babel": "^4.3.2",

View File

@@ -19,4 +19,4 @@
<meta name="Description" content="The next small thing in web development">
</svelte:head>
<Docs {sections}/>
<Docs {sections} project="sapper"/>

View File

@@ -19,4 +19,4 @@
<meta name="Description" content="The next small thing in web development">
</svelte:head>
<Docs {sections}/>
<Docs {sections} project="sapper" dir="migrating"/>

View File

@@ -7,23 +7,6 @@ import { make_session_slug_processor } from '@sveltejs/site-kit/utils/slug';
import marked from 'marked';
import hljs from 'highlight.js';
const escaped = {
'"': '&quot;',
"'": '&#39;',
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
};
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 = [
'blockquote',
'html',
@@ -115,15 +98,13 @@ export default function generate_docs(dir) {
const slug = level <= 4 && make_slug(rawtext);
if (level === 3 || level === 4) {
const title = unescape(
text
.replace(/<\/?code>/g, '')
.replace(/\.(\w+)(\((.+)?\))?/, (m, $1, $2, $3) => {
if ($3) return `.${$1}(...)`;
if ($2) return `.${$1}()`;
return `.${$1}`;
})
);
const title = text
.replace(/<\/?code>/g, '')
.replace(/\.(\w+)(\((.+)?\))?/, (m, $1, $2, $3) => {
if ($3) return `.${$1}(...)`;
if ($2) return `.${$1}()`;
return `.${$1}`;
});
subsections.push({ slug, title, level });
}