-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rackover
committed
Feb 9, 2020
1 parent
017ab09
commit e6aeb6f
Showing
19 changed files
with
321 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
const fs = require("fs") | ||
|
||
module.exports = { | ||
getFormattedContents: getFormattedContents | ||
getFormattedContents: getFormattedContents, | ||
getContents: getContents | ||
} | ||
|
||
function getFormattedContents(diskPath){ | ||
return markdown.parse(fs.readFileSync(diskPath).toString()) | ||
} | ||
|
||
function getContents(diskPath){ | ||
return fs.readFileSync(diskPath).toString() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = async function (req, response){ | ||
|
||
const pagePath = response.navigation.current | ||
const page = wikiMap.getPage(pagePath) | ||
|
||
if (!page){ | ||
response.error = { | ||
data: "404" | ||
}; | ||
return response; | ||
} | ||
|
||
const diskPath = page.filePath; | ||
|
||
const data = diskPath ? await wikiPage.getContents(diskPath) : 404 | ||
|
||
response.data = data | ||
response.hierarchy = wikiMap.getHierarchyInfo(pagePath) | ||
response.page = page | ||
|
||
return response; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
extends ../layout/default.pug | ||
|
||
block head | ||
// Editor | ||
link(rel="stylesheet", href="/res/css/simplemde.min.css") | ||
link(rel="stylesheet", href="/res/css/editor.css") | ||
script(src="/res/js/simplemde.min.js") | ||
script(src="/res/js/editor.js") | ||
|
||
|
||
block content | ||
if (hierarchy.length > 1) | ||
.pageAddress | ||
each val, index in hierarchy | ||
a(href=prefix+val.url, class=(val.url === page.url ? "selected" : "")) #{val.name} | ||
if (val.url != page.url) | ||
span 🡆 | ||
div | ||
textarea#editor | ||
| !{data} | ||
// | ||
.pageToolbar | ||
if (user.canWrite) | ||
a.pageEditButton(href="/edit"+navigation.current) 🖋️ Edit... | ||
a.pageEditButton(onclick="return confirm('YOU ARE GOING TO DELETE "+navigation.current+". Are you SURE you want to do this?')", href="/delete"+navigation.current) ❌ Delete... | ||
a.pageEditButton(href=page.repoPath, target="_blank") 🐙 View on github |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
a.saveButton:after{ | ||
content: "Save"; | ||
font-family: "Noto sans"; | ||
margin-left: 6px; | ||
} | ||
|
||
a.saveButton{ | ||
width:auto; | ||
border:1px dotted grey; | ||
padding-left: 6px; | ||
padding-right: 6px; | ||
background:linear-gradient(#00DD44, #006622); | ||
color:white !important; | ||
font-weight:bold; | ||
} | ||
|
||
a.saveButton:hover{ | ||
border:1px solid grey; | ||
background:linear-gradient(#00FF55, #00AA66); | ||
} |
Oops, something went wrong.