Files
Wiki/index.html
T

72 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'Knowledge Mint System',
repo: 'Mint-System/Knowledge',
loadNavbar: true,
logo: '/assets/logo.svg',
themeColor: '#0B9FA3',
search : [
'/',
'/Odoo',
],
plugins: [
function(hook, vm) {
hook.beforeEach(function(content) {
// convert wiki image links
const wikiImage = /!\[\[([^\]]*)\]\]/g
content = content.replace(wikiImage, '<img src="/assets/$1" \/>')
// convert wiki links
const link = /\[\[([^\]]*)\]\]/g
let matches = content.match(link) || []
for (i = 0; i < matches.length; i++) {
let match = matches[i]
let title = match.match(/\[\[([^\]]*)/)[1]
let href,anchor
if (match.indexOf('#') > 0) {
anchor = match.match(/#([^\||\]]*)/)[1]
}
if (match.indexOf('|') > 0) {
href = match.match(/\[\[([^\||#]*)/)[1]
title = match.match(/\|(.*)\]\]/)[1]
}
content = content.replace(match, `<a href="/#/${href ? href : title}${anchor ? ('?id='+anchor) : ''}">${title}</a>`)
}
// add edit button
var url = 'https://github.com/Mint-System/Knowledge/blob/master/' +
vm.route.file;
var edit = '[📝 Edit Document](' + url + ')\n';
return (
content +
'\n\n' +
edit
);
});
}
]
};
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
</body>
</html>