from Wiki to Documentation

This commit is contained in:
MeowcaTheoRange 2023-01-05 18:17:51 -06:00
parent 1d0249fb98
commit d31b7be056
17 changed files with 87 additions and 33 deletions

BIN
assets/Files/extract1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

BIN
assets/Files/github1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
assets/Files/makesure1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

BIN
assets/Files/npmi1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
assets/Files/terminal1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View file

@ -186,8 +186,8 @@ body {
box-sizing: border-box; box-sizing: border-box;
font-family: var(--font-families); font-family: var(--font-families);
font-size: 18px; font-size: 18px;
border: 2px var(--general-fg) solid; border: 2px var(--tag-fg) solid;
background-color: var(--general-bg); background-color: var(--main-fg);
color: var(--tag-fg); color: var(--tag-fg);
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
} }
@ -211,8 +211,8 @@ body {
box-sizing: border-box; box-sizing: border-box;
font-family: var(--font-families); font-family: var(--font-families);
font-size: 18px; font-size: 18px;
border: 2px var(--general-fg) solid; border: 2px var(--tag-fg) solid;
background-color: var(--general-bg); background-color: var(--main-fg);
color: var(--tag-fg); color: var(--tag-fg);
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
position: absolute; position: absolute;
@ -227,9 +227,9 @@ body {
box-sizing: border-box; box-sizing: border-box;
font-size: 18px; font-size: 18px;
border-radius: 0 8px 8px 0; border-radius: 0 8px 8px 0;
color: var(--general-bg); color: var(--main-fg);
background-color: var(--general-bg); border: 2px var(--tag-fg) solid;
border: 2px var(--general-fg) solid; background-color: var(--main-fg);
position: absolute; position: absolute;
right: 8px; right: 8px;
cursor: default; cursor: default;
@ -246,7 +246,7 @@ body {
} }
#sbheader input::placeholder { #sbheader input::placeholder {
color: var(--general-fg); color: var(--secondary);
} }
.menubutton { .menubutton {
@ -295,11 +295,17 @@ body {
margin-top: 8px; margin-top: 8px;
} }
} }
.showonmobile {
display: none;
}
@media only screen and (max-width: 800px) { @media only screen and (max-width: 800px) {
.hideonmobile { .hideonmobile {
display: none; display: none;
} }
.showonmobile {
display: initial;
}
#sidebar { #sidebar {
width: 100vw !important; width: 100vw !important;

View file

@ -17,15 +17,20 @@
margin: 16px 0; margin: 16px 0;
} }
#page p { #page p {
display: inline-block;
font-size: 16px; font-size: 16px;
width: 100%; width: 100%;
margin: 0; margin: 0;
} }
#page small { #page small {
display: inline-block;
font-size: 12px; font-size: 12px;
width: 100%; width: 100%;
margin: 0; margin: 0;
} }
#page > small {
margin-bottom: 16px;
}
#page a { #page a {
color: var(--main); color: var(--main);
} }
@ -33,4 +38,12 @@
background-color: var(--general-bg); background-color: var(--general-bg);
padding: 2px; padding: 2px;
border-radius: 4px; border-radius: 4px;
}
#page img {
display: block;
max-width: 100%;
max-height: 500px;
object-fit: contain;
object-position: left;
margin-top: 16px;
} }

View file

@ -15,7 +15,7 @@ var getPages = () => {
__pg.tags["Meta"] = templateTag("//","#808080"); __pg.tags["Meta"] = templateTag("//","#808080");
__pg.tags["404"] = templateTag("404","#008000"); __pg.tags["404"] = templateTag("404","#008000");
__pg.tags["500"] = templateTag("500","#FF0080"); __pg.tags["500"] = templateTag("500","#FF0080");
__pg.wikiData.fullName = __pg.wikiData.name.join(" "); __pg.documentationData.fullName = __pg.documentationData.name.join(" ");
pages = __pg; pages = __pg;
} }
setInterval(getPages, 10000); setInterval(getPages, 10000);
@ -32,10 +32,10 @@ var getPage = (page) => {
return templateIndex(page, pages.pages[page]); return templateIndex(page, pages.pages[page]);
} }
app.get('/', (_,r) => r.redirect("/wiki/Welcome")); app.get('/', (_,r) => r.redirect("/page/Welcome"));
app.get('/wiki', (_,r) => r.redirect("/wiki/Welcome")); app.get('/page', (_,r) => r.redirect("/page/Welcome"));
app.get('/wiki/:page', function(req, res, next) { app.get('/page/:page', function(req, res, next) {
var page = getPage(req.params.page); var page = getPage(req.params.page);
switch (page.type) { switch (page.type) {
case "invaildrequest": case "invaildrequest":

View file

@ -1,5 +1,5 @@
{ {
"name": "avalon-wiki-engine", "name": "avalon-documentation-engine",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",

View file

@ -1,16 +1,37 @@
<p>Welcome to the AWE installation guide!</p> <p>Welcome to the ADE installation guide!</p>
<p>This guide will assist you while installing the Avalon Wiki Engine on a local server.</p> <p>This guide will assist you while installing the Avalon Documentation Engine on a local server.</p>
<p>Make sure you have your 80 port open on this server.</p> <p>Make sure you have your 80 port open on this server.</p>
<%- include("blocks/MessageBox.ejs", { <%- include("blocks/MessageBox.ejs", {
title: "Docker support", title: "Docker support",
content: "This guide will not contain resources for installing AWE on Docker. You are purely on your own for that." content: "This guide will not contain resources for installing ADE on Docker. You are purely on your own for that."
}) %> }) %>
<h1>Installing locally or on a Node server</h1> <h1>Installing locally or on a Node server</h1>
<p>If you just want AWE for your local network, or on your own real server.</p> <p>If you just want ADE for your local network, or on your own real server.</p>
<h2>Steps</h2>
<h3>Step 1 - Downloading the repository from GitHub</h3>
<p>First, go to any folder you would like to keep ADE in.</p>
<p>Then, go to <a href="https://github.com/MeowcaTheoRange/AvalonDocumentationEngine" target="_blank">the GitHub repository for ADE</a> and download the ZIP.</p>
<img src="/assets/github1.png" />
<small>Selecting Code > Download ZIP on the GitHub UI.</small>
<p>Then, extract the ZIP into the folder.</p>
<img src="/assets/extract1.png" />
<small>Dragging the ZIP contents into a folder.</small>
<%- include("blocks/MessageBox.ejs", {
title: "HOLD ON...",
content: "Make sure to read the license! This information is important for defining who and what can use the documentation contents.<br />Alternatively, make a \"License\" article within the Documentation to define your own license for the content.<br />Instructions on how to do this can be found <a href=\"/page/Licensing_documentation_content\">here.</a><img src='/assets/makesure1.png' />"
}) %>
<h3>Step 2 - Install dependencies</h3>
<p>Installing dependencies for the Avalon Documentation Engine is super easy. Simply open a Node terminal in your Documentation folder.</p>
<img src="/assets/terminal1.png" />
<small>A terminal, which has the documentation as its' current directory.</small>
<p>Then, type <code>npm install</code> (or <code>npm i</code>) into the terminal.</p>
<img src="/assets/npmi1.png" />
<small>A terminal, which has the output of the aforementioned npm command.</small>
<p><code>package-lock.json</code> and <code>node-modules/</code> should appear in the directory.</p>
<h1>Installing on Replit</h1> <h1>Installing on Replit</h1>
<p>If you want quickly get AWE up and running.</p> <p>If you want quickly get ADE up and running.</p>
<%- include("blocks/MessageBox.ejs", { <%- include("blocks/MessageBox.ejs", {
title: "Cycles required", title: "Cycles required",
content: "In order to use AWE on Replit, you will have to use Cycles to make your AWE Repl Always On.", content: "In order to use ADE on Replit, you will have to use Cycles to make your ADE Repl Always On.",
notice: "2 cycles/day for Always On" notice: "2 cycles/day for Always On - recommended amount is 62, for at least a month"
}) %> }) %>

View file

@ -1,4 +1,4 @@
<p>Searching in the Avalon Wiki Engine is possible.</p> <p>Searching in the Avalon Documentation Engine is possible.</p>
<p>Use the searchbar element on the top-left to type text in and look for articles using a filter.</p> <p>Use the searchbar element on the top-left to type text in and look for articles using a filter.</p>
<h1>Search methods</h1> <h1>Search methods</h1>
<h2>Searching by name</h2> <h2>Searching by name</h2>

View file

@ -1,11 +1,11 @@
<%- include("blocks/MessageBox.ejs", { <%- include("blocks/MessageBox.ejs", {
title: "Welcome!", title: "Welcome!",
content: "Welcome to the " + allPages.wikiData.fullName + " development resource!" content: "Welcome to the " + allPages.documentationData.fullName + " development resource!"
}) %> }) %>
<h1><%- allPages.wikiData.fullName %></h1> <h1><%- allPages.documentationData.fullName %></h1>
<p>The Avalon Wiki Engine (also known as AWE) is a free and open-source piece of software, that lets site administrators manage content in a simple format.</p> <p>The Avalon Documentation Engine (also known as ADE) is a free and open-source piece of software, that lets site administrators manage content in a simple format.</p>
<h2>About</h2> <h2>About</h2>
<p>The Avalon Wiki Engine is a bit tacky, but it functions well, allowing end users to easily navigate content, with fancy tricks like searching - by name or by tags.</p> <p>The Avalon Documentation Engine is a bit tacky, but it functions well, allowing end users to easily navigate content, with fancy tricks like searching - by name or by tags.</p>
<p>Formatting is based on individual EJS files - see <a href="https://ejs.co">ejs.co</a> for more info on EJS templating.</p> <p>Formatting is based on individual EJS files - see <a href="https://ejs.co">ejs.co</a> for more info on EJS templating.</p>
<h2>Installation and Source</h2> <h2>Installation and Source</h2>
<p>An installation guide can be found at <a href="/wiki/Installation">Installation</a>.</p> <p>An installation guide can be found at <a href="/page/Installation">Installation</a>.</p>

View file

@ -15,7 +15,7 @@ gap:8px;">
<small><%- locals.pronouns ?? "she/her" %></small> <small><%- locals.pronouns ?? "she/her" %></small>
<p><%- locals.birthday ?? "January 1, 1970" %></p> <p><%- locals.birthday ?? "January 1, 1970" %></p>
<p><%- locals.gender ?? "Female" %>, <%- locals.preference ?? "Asexual (deceased)" %></p> <p><%- locals.gender ?? "Female" %>, <%- locals.preference ?? "Asexual (deceased)" %></p>
<small><%- locals.attribution ?? "<a href='https://en.wikipedia.org/wiki/John_Doe'>John Doe on Wikipedia</a>" %></small> <small><%- locals.attribution ?? "<a href='https://en.documentationpedia.org/page/John_Doe'>John Doe on Documentationpedia</a>" %></small>
</div> </div>
<div style="display: flex;flex-direction: column;gap:8px;padding: 16px;"> <div style="display: flex;flex-direction: column;gap:8px;padding: 16px;">
<h3 style="margin:0;">About</h3> <h3 style="margin:0;">About</h3>

View file

@ -17,7 +17,19 @@
<body> <body>
<div id="header"> <div id="header">
<button class="menubutton material-symbols-outlined" onclick="toggleSidebar()">toc</button> <button class="menubutton material-symbols-outlined" onclick="toggleSidebar()">toc</button>
<span class="title"><%- allPages.wikiData.name[0] %> <span class="hideonmobile"><%- allPages.wikiData.name[1] %></span></span> <span class="title">
<span class="<%- allPages.documentationData.shortName.length !== 0 ? "hideonmobile" : "" %>">
<%- allPages.documentationData.name[0] ?? "No-name" %>
<span class="hideonmobile">
<%- allPages.documentationData.name[1] ?? "" %>
</span>
<%- allPages.documentationData.name[2] ?? "" %>
<span class="hideonmobile">
<%- allPages.documentationData.name[3] ?? "" %>
</span>
</span>
<span class="<%- allPages.documentationData.shortName.length !== 0 ? "showonmobile" : "" %>"><%- allPages.documentationData.shortName ?? "" %></span>
</span>
</div> </div>
<div id="body"> <div id="body">
<div id="sidebar"> <div id="sidebar">

View file

@ -1,9 +1,11 @@
{ {
"wikiData": { "documentationData": {
"name": [ "name": [
"Avalon", "Avalon",
"Wiki Engine" "Documentation Engine",
] "Help Desk"
],
"shortName": "ADE Help Desk"
}, },
"tags": { "tags": {
"Accessibility": { "Accessibility": {

View file

@ -1,4 +1,4 @@
There was an internal server error while rendering this article.<br /> There was an internal server error while rendering this article.<br />
Possibly, this article's page <b>index</b> exists, but it is redirecting to or referencing a non-existent article.<br /> Possibly, this article's page <b>index</b> exists, but it is redirecting to or referencing a non-existent article.<br />
<br /> <br />
If possible, please notify the wiki managers. If possible, please notify the documentation managers.

View file

@ -1,5 +1,5 @@
<div class="fullwidthlink <%- redirect ? "showsearch" : "" %>" style="background-color: <%- data.color ?? "var(--main-fg)" %>;"> <div class="fullwidthlink <%- redirect ? "showsearch" : "" %>" style="background-color: <%- data.color ?? "var(--main-fg)" %>;">
<a class="linkname" href="/wiki/<%- name %>"> <a class="linkname" href="/page/<%- name %>">
<%- name.replace(/_/g, " ") %> <%- redirect ? (">> " + data.replace(/_/g, " ")) : "" %> <%- name.replace(/_/g, " ") %> <%- redirect ? (">> " + data.replace(/_/g, " ")) : "" %>
</a> </a>
<% if (!redirect) { %> <% if (!redirect) { %>