Merge branch 'feature/vuepress'

This commit is contained in:
Janik von Rotz committed 2020-11-17 11:20:32 +01:00
commit 2de5dea46d
10 files changed
+10882 -222

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
module.exports = {
title: 'Knowledge Mint System',
description: 'Knowledge Mint System',
}
-13
View File
@@ -1,13 +0,0 @@
{
"theme": "obsidian",
"pluginEnabledStatus": {
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"command-palette": true,
"markdown-importer": true,
"word-count": true
}
}
-76
View File
@@ -1,76 +0,0 @@
{
"main": {
"id": "44fb896351717618",
"type": "split",
"children": [
{
"id": "fbefa5f018992652",
"type": "leaf",
"active": true,
"state": {
"type": "empty",
"state": {}
}
}
],
"direction": "vertical"
},
"left": {
"id": "99f1ff63a1bbcbfa",
"type": "split",
"children": [
{
"id": "5b64a7445fe42d7e",
"type": "tabs",
"children": [
{
"id": "1881acc783b8889c",
"type": "leaf",
"state": {
"type": "file-explorer",
"state": {}
}
},
{
"id": "0b0f1b9040504d3b",
"type": "leaf",
"state": {
"type": "search",
"state": {
"query": ""
}
}
}
]
}
],
"direction": "horizontal",
"width": 300
},
"right": {
"id": "29e34c1df4067b74",
"type": "split",
"children": [
{
"id": "67b1dfe3bfc8f6d2",
"type": "tabs",
"children": [
{
"id": "ff6de105afe40aab",
"type": "leaf",
"state": {
"type": "backlink",
"state": {}
}
}
]
}
],
"direction": "horizontal",
"width": 300,
"collapsed": true
},
"lastOpenFiles": [
"Prozess Einkauf.png"
]
}
+89 -11
View File
@@ -1,8 +1,77 @@
const fs = require('fs')
const convert = require('./convert')
var path = require('path')
const paths = []
// settings
const ignoreFiles = ['_navbar.md', '_sidbar.md']
const basePath = '/'
const basePathAssets = './'
const uriSuffix = '.html'
const anchorPrefix = '#'
const allowedAssets = ['.png', '.jpg', '.svg', 'gif']
function sanitizeName(file) {
return file.toLocaleLowerCase().replace(/\s+/g, '-').replace('---','-')
}
function sanitizeAssetname(file) {
return file.toLocaleLowerCase().replace(/\s+/g, '-').replace('---','-').replace('ö','oe').replace('ü','ue').replace('ä','ae')
}
function convert(content,file) {
// convert wiki image links
// ![[image.png]] -> <img src="./assets/image.png"/>
const wikiImage = /!\[\[([^\]]*\.png|jpg|jpeg|svg|gif)\]\]/g
let matches = content.match(wikiImage) || []
for (i = 0; i < matches.length; i++) {
let match = matches[i]
let image = sanitizeAssetname(match.match(/!\[\[([^\]]*)/)[1])
content = content.replace(match, `![](${basePathAssets}${image})`)
}
// convert embeded content links
// ![[Content]] -> [Content](Content.md ':include')
const embededContent = /!\[\[([^\]]*)\]\]/g
matches = content.match(embededContent) || []
for (i = 0; i < matches.length; i++) {
let match = matches[i]
let title = encodeURI(match.match(/\[\[([^\]|#]*)/)[1])
content = content.replace(embededContent, `[$1](${title}.md ':include')`)
}
// convert wiki links
// [[href#anchor|title] -> [title](href#anchor)
const wikiLink = /\[\[([^\]]*)\]\]/g
matches = content.match(wikiLink) || []
for (i = 0; i < matches.length; i++) {
let match = matches[i]
let href = match.match(/\[\[([^\]|#]*)/)[1]
let title = match.match(/\[\[([^\]|#]*)/)[1]
let anchor = null
// set anchor
if (match.indexOf('#') > 0) {
console.log(match, anchor)
anchor = match.match(/#([^\||\]]*)/)[1]
// sanitize anchor link
anchor = sanitizeName(anchor)
}
// set title and href
if (match.indexOf('|') > 0) {
href = match.match(/\[\[([^\||#]*)/)[1]
title = match.match(/\|(.*)\]\]/)[1]
}
// sanitize href
href = sanitizeName(href ? href : file.replace('\.md', ''))
content = content.replace(match, `[${title}](${basePath}${href}${uriSuffix}${anchor ? (anchorPrefix + anchor) : ''})`)
}
return content
}
// loop all markdown files of the current folder
fs.readdirSync(__dirname).filter(file => (file.slice(-3) === '.md') && (ignoreFiles.indexOf(file) != 0)).forEach((file) => {
@@ -11,10 +80,10 @@ fs.readdirSync(__dirname).filter(file => (file.slice(-3) === '.md') && (ignoreFi
var content = fs.readFileSync(file, 'utf8')
// set new file name
newfile = convert.sanitizeFilename(file)
newfile = sanitizeName(file)
// push filename
paths.push('/' + newfile.replace('.md', ''))
// convert content
content = convert(content, file)
// add footer
content = content + [
@@ -23,17 +92,26 @@ fs.readdirSync(__dirname).filter(file => (file.slice(-3) === '.md') && (ignoreFi
'\n\n',
'[📝 Edit on GitHub](' + 'https://github.com/Mint-System/Knowledge/blob/master/' + file.replace(/\s+/g, '%20') + ')',
'\n\n',
'[📂 Open in Obsidan](' + 'obsidian://open?vault=Knowledge%20Mint%20System&file=' + file.replace(/\s+/g, '%20') + ')',
'\n\n',
'<footer>',
'Copyright © <a href="https://www.mint-system.ch/">Mint System GmbH</a>',
'</footer>'
].join('')
// write content back to file
// Delete existing file
fs.unlinkSync(file)
// write content to new file
fs.writeFileSync(newfile, content, 'utf8')
})
// write paths.json for search index
const content = `const paths = ${JSON.stringify(paths)}`
fs.writeFileSync('paths.js', content, 'utf8')
// Loop all asset files
fs.readdirSync(__dirname + '/assets').filter(file => (allowedAssets.indexOf(path.extname(file)) == 0)).forEach((file) => {
console.log()
// set new file name
newfile = sanitizeAssetname(file)
// move asset file
fs.renameSync(__dirname + '/assets/' + file, __dirname + '/' + newfile)
})
-52
View File
@@ -1,52 +0,0 @@
function sanitizeFilename(file) {
return file.toLocaleLowerCase().replace(/\s+/g, '-').replace('---','-')
}
function convert(content,file) {
// convert wiki image links
const wikiImage = /!\[\[([^\]]*\.png|jpg|jpeg)\]\]/g
content = content.replace(wikiImage, '<img src="/assets/$1" \/>')
// convert embeded content links
// ![[Content] -> [Content](Content.md ':include')
const embededContent = /!\[\[([^\]]*)\]\]/g
let matches = content.match(embededContent) || []
for (i = 0; i < matches.length; i++) {
let match = matches[i]
let title = encodeURI(match.match(/\[\[([^\]|#]*)/)[1])
content = content.replace(embededContent, `[$1](${title}.md ':include')`)
}
// convert wiki links
// [[href#anchor|title] -> <a href="href?id=anchor">title</a>
const link = /\[\[([^\]]*)\]\]/g
matches = content.match(link) || []
for (i = 0; i < matches.length; i++) {
let match = matches[i]
let href = match.match(/\[\[([^\]|#]*)/)[1]
let title = match.match(/\[\[([^\]|#]*)/)[1]
let anchor
if (match.indexOf('#') > 0) {
anchor = match.match(/#([^\||\]]*)/)[1]
// Convert to docsify id
anchor = anchor.toLowerCase().replace(/ /g, "-")
}
if (match.indexOf('|') > 0) {
href = match.match(/\[\[([^\||#]*)/)[1]
title = match.match(/\|(.*)\]\]/)[1]
}
// sanitize href
href = sanitizeFilename(href ? href : file.replace('\.md', ''))
content = content.replace(match, `<a href="/#/${href}${anchor ? ('?id=' + anchor) : ''}">${title}</a>`)
}
return content
}
exports.convert = convert
exports.sanitizeFilename = sanitizeFilename
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

-66
View File
@@ -1,66 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Knowledge Mint System</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">
<script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script type="text/javascript" src="paths.js"></script>
<script type="text/javascript" src="convert.js"></script>
<style>
article img {
border: 1px groove lightgrey;
padding: 8px;
}
</style>
</head>
<body>
<div id="app"></div>
<script>
var num = 0;
mermaid.initialize({ startOnLoad: false })
window.$docsify = {
name: 'Knowledge Mint System',
repo: 'Mint-System/Knowledge',
loadNavbar: true,
loadSidebar: false,
logo: '/assets/logo.svg',
themeColor: '#0B9FA3',
auto2top: true,
search: {
paths: paths
},
plugins: [
function (hook, vm) {
hook.beforeEach(function (content) {
content = convert(content, vm.route.file)
return content
})
}
],
markdown: {
renderer: {
code: function (code, lang) {
if (lang === "mermaid") {
return (
'<div class="mermaid">' + mermaid.render('mermaid-svg-' + num++, code) + "</div>"
);
}
return this.origin.code.apply(this, arguments)
}
}
}
}
</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>
<script src="//cdn.jsdelivr.net/npm/docsify-tabs@1"></script>
<script async defer data-domain="knowledge.mint-system.ch" src="https://plausible.io/js/plausible.hash.js"></script>
</body>
</html>
+10781
View File
File diff suppressed because it is too large. Load diff
+7 -3
View File
@@ -1,5 +1,9 @@
{
"scripts": {
"vercel-build": "node ./build.js"
}
}
"vercel-build": "node build.js && vuepress build ."
},
"devDependencies": {
"vuepress": "^1.7.1"
},
"dependencies": {}
}
-1
View File
@@ -1 +0,0 @@
const paths = ["/agbs-entwicklungsprojekt","/angebot","/angebotsanfrage-anlegen","/ansible-inventory","/ansible-playbooks","/ansible-vault","/ansible","/backup","/behalten-sie-ihre-unternehmensdaten-mit-nextcloud-im-griff","/bigbluebutton","/cloud-mint-system","/contribution","/corporate-design","/dns","/design-decisions","/development","/docker-migrate-bind-mount-to-volume-mount","/docker","/docsify","/dokumente","/evaluation-iaas","/evaluation-odoo-report","/evaluation","/exoscale","/fernwartung","/gnu-gplv3-lizenz","/git","/grafana","/hetzner","/hosting-modelle","/hosting","/infrastruktur","/janik-von-rotz","/kalkulation-managed-server","/kurt-gisler","/libreoffice-impress","/libreoffice","/libreplm","/links","/linux-server-patching-dokumentation","/linux-server-patching","/login-mint-system","/lohnarten","/managed-server","/management-handbuch","/marco-roeleven","/markdown-tutorial","/mehrwertsteuer","/methodik","/mint-system-gmbh","/mintsys-cloud","/monitoring","/moodle-hosting","/moodle","/netzwerk","/nextcloud-configure-ignored-files","/nextcloud-restore-password-manager-from-backup","/nextcloud-transfer-ownership","/nextcloud-hosting","/nextcloud","/obsidian","/odoo-app-show-db-name","/odoo-app","/odoo-assets","/odoo-budget","/odoo-community-association","/odoo-community-edition","/odoo-datenbank-manager","/odoo-datenbank-vorlage","/odoo-demodaten","/odoo-development-environment","/odoo-development","/odoo-email-integration","/odoo-email-konfiguration","/odoo-engineering-&-lifecycle-management","/odoo-enterprise","/odoo-fertigung","/odoo-finanzen-import","/odoo-finanzen-setup","/odoo-finanzen","/odoo-hosting-mintsys-cloud","/odoo-hosting-odoo.sh","/odoo-hosting-on-premise","/odoo-hosting","/odoo-kalender","/odoo-kontakt","/odoo-kostenrechnung","/odoo-login-integration","/odoo-lohnabrechnung","/odoo-map-view","/odoo-marketing","/odoo-master-password","/odoo-migration-worklog","/odoo-oca","/odoo-painpoints","/odoo-planung","/odoo-product-lifecycle-management","/odoo-produktdatenmanagement-(pdm)","/odoo-projekt","/odoo-qm-data-system","/odoo-rest-api","/odoo-s.a.","/odoo-testumgebung","/odoo-umgebungen","/odoo-verkäufe","/odoo-website-konfiguration","/odoo-widgets","/odoo-zeiterfassung","/odoo","/openeduca","/philosophie","/produktart","/prozesse-akquise-akquise-abschliessen","/prozesse-akquise-anforderungsanalyse","/prozesse-akquise-angebot-erstellen","/prozesse-akquise-kontaktaufnahme","/prozesse-akquise-odoo-demoumgebung-bestellen","/prozesse-akquise-präsentation","/prozesse-akquise","/prozesse-finanzen-ausgangsrechnungen","/prozesse-finanzen-buchhaltung","/prozesse-finanzen-eingangsrechnungen","/prozesse-finanzen-personalabrechnung","/prozesse-finanzen","/prozesse-infrastruktur-dns-verwaltung","/prozesse-infrastruktur-installation-bigbluebutton","/prozesse-infrastruktur-installation-moodle","/prozesse-infrastruktur-installation-nextcloud","/prozesse-infrastruktur-installation-odoo","/prozesse-infrastruktur-nextcloud-bestellen","/prozesse-infrastruktur-odoo-bestellen","/prozesse-infrastruktur-server-monitoring","/prozesse-infrastruktur-server-bereitstellen","/prozesse-infrastruktur-server-bestellen","/prozesse-infrastruktur","/prozesse-marketing-newsletter-und-blog","/prozesse-marketing","/prozesse-odoo-app-abwesenheitszeiten","/prozesse-odoo-app-anwesenheitszeiten","/prozesse-odoo-app-einkauf","/prozesse-odoo-app-fertigung","/prozesse-odoo-app-finanzen","/prozesse-odoo-app-kontakte","/prozesse-odoo-app-kundenverwaltung","/prozesse-odoo-app-plm","/prozesse-odoo-app-personalabrechnung","/prozesse-odoo-app-projekt","/prozesse-odoo-app-qualität","/prozesse-odoo-app-studio","/prozesse-odoo-app-verkäufe","/prozesse-odoo-app-zeiterfassung","/prozesse-odoo-demoumgebung-bereitstellen","/prozesse-odoo-testumgebung-bereitstellen","/prozesse-odoo","/prozesse-projektmanagement-aufgaben-verwalten","/prozesse-projektmanagement-konzept","/prozesse-projektmanagement-odoo-projekt-erstellen","/prozesse-projektmanagement-projektdefinition","/prozesse-projektmanagement-zeiterfassung","/prozesse-projektmanagement","/prozesse","/py3o-report-engine","/qweb-templating-engine","/readme","/richtlinie-code-sharing","/richtlinie-dokumentmanagementsystem","/richtlinie-e-mail","/richtlinie-konferenz","/richtlinie-namenskonventionen","/richtlinie-passwörter","/richtlinie-website","/richtlinien","/security","/server","/signatur","/slides","/tags","/team-infrastruktur","/telefonie","/tools","/vercel","/vorgehensmodell","/wartungsvertrag","/web-analytics","/web-application-firewall","/workplace","/_sidebar","/f-1","/f","/hosttech","/mint-system.ch-realm"]