From e25abcc05a4a786692837421afb3fe4495593e3e Mon Sep 17 00:00:00 2001
From: Jake <j.vondoemming@stud.uni-goettingen.de>
Date: Thu, 1 Sep 2022 15:45:43 +0200
Subject: [PATCH] added base files and configuration for documentation

---
 .gitignore          |   1 +
 Makefile            |  10 ++-
 docs/Makefile       |   6 +-
 docs/config.json    |  15 +++++
 docs/content.json   | 156 --------------------------------------------
 docs/content.md     |   8 +--
 docs/gen_content.py |  83 -----------------------
 docs/index.de.md    |  14 ++++
 8 files changed, 43 insertions(+), 250 deletions(-)
 create mode 100644 docs/config.json
 delete mode 100644 docs/content.json
 delete mode 100755 docs/gen_content.py
 create mode 100644 docs/index.de.md

diff --git a/.gitignore b/.gitignore
index 2ca4fc0..28ebbf5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 /output
+/docs-output
 /public
 /content
 __pycache__
diff --git a/Makefile b/Makefile
index f396ec0..aa07fdc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,22 @@
 .PHONY: html
-html: build
+html: docs build
 
 .PHONY: publish
-publish: build
+publish: docs build
 
 .PHONY: build
 build: mathjax
 	cd fgs && python3 __main__.py "../content" "../output" "../theme" "../config.json" "../lang.json"
 
+.PHONY: docs
+docs: mathjax
+	cd fgs && python3 __main__.py "../docs" "../docs-output" "../theme" "../config.json" "../lang.json"
+
 .PHONY: mathjax
 mathjax:
 	[ ! -d output/mathjax ] && mkdir -p output && cp -vr mathjax/es5 output/mathjax || true
 
 .PHONY: devserver
 devserver:
-	cd output && python -m http.server 8000
+	python -m http.server 8000
 
diff --git a/docs/Makefile b/docs/Makefile
index 86d1c18..61357d6 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -1,4 +1,4 @@
 
-content.md: content.json gen_content.py
-	./gen_content.py > content.md
-
+.PHONY: run
+run:
+	make -C ..
diff --git a/docs/config.json b/docs/config.json
new file mode 100644
index 0000000..aed8141
--- /dev/null
+++ b/docs/config.json
@@ -0,0 +1,15 @@
+{
+	"menuitems": [
+	],
+	"lang": {
+		"de": {
+			"sitename": "Dokumentation Fachgruppenwebseite",
+			"banner": {
+				"title": "Startseite Dokumentation Fachgruppenwebseite"
+			},
+			"atom": {
+				"title": "Dokumentation Fachgruppenwebseite Atom Feed"
+			}
+		}
+	}
+}
diff --git a/docs/content.json b/docs/content.json
deleted file mode 100644
index 9335e09..0000000
--- a/docs/content.json
+++ /dev/null
@@ -1,156 +0,0 @@
-{
-  "header": {
-    "eclass": "block",
-    "level": "int",
-    "attr": "attr",
-    "content": "inlines"
-  },
-  "rawblock": {
-    "eclass": "block",
-    "format": "text",
-    "raw": "text"
-  },
-  "bulletlist": {
-    "eclass": "block",
-    "items": "[blocks]",
-    "count": "int"
-  },
-  "orderedlist": {
-    "eclass": "block",
-    "items": "[blocks]",
-    "count": "int",
-    "start": "int",
-    "style": [
-      "default",
-      "example",
-      "decimal",
-      "lower_roman",
-      "upper_roman",
-      "lower_alpha",
-      "upper_alpha"
-    ],
-    "delim": [
-      "default",
-      "period",
-      "one_parenthesis",
-      "two_parentheses"
-    ]
-  },
-  "blockquote": {
-    "eclass": "block",
-    "content": "blocks"
-  },
-  "plain": {
-    "eclass": "block",
-    "content": "inlines"
-  },
-  "paragraph": {
-    "eclass": "block",
-    "content": "inlines"
-  },
-  "codeblock": {
-    "eclass": "block",
-    "attr": "attr",
-    "code": "text",
-    "code_lines": "[text]"
-  },
-  "horizontalrule": {
-    "eclass": "block"
-  },
-  "blockcontainer": {
-    "eclass": "block",
-    "attr": "attr",
-    "content": "blocks"
-  },
-  "space": {
-    "eclass": "inline"
-},
-  "linebreak": {
-    "eclass": "inline"
-},
-  "softbreak": {
-    "eclass": "inline"
-},
-  "string": {
-    "eclass": "inline",
-    "text": "text"
-  },
-  "strong": {
-    "eclass": "inline",
-    "content": "inlines"
-  },
-  "emph": {
-    "eclass": "inline",
-    "content": "inlines"
-  },
-  "underline": {
-    "eclass": "inline",
-    "content": "inlines"
-  },
-  "strikeout": {
-    "eclass": "inline",
-    "content": "inlines"
-  },
-  "superscript": {
-    "eclass": "inline",
-    "content": "inlines"
-  },
-  "subscript": {
-    "eclass": "inline",
-    "content": "inlines"
-  },
-  "smallcaps": {
-    "eclass": "inline",
-    "content": "inlines"
-  },
-  "link": {
-    "eclass": "inline",
-    "attr": "attr",
-    "content": "inlines",
-    "url": "text",
-    "title": "text"
-  },
-  "image": {
-    "eclass": "inline",
-    "attr": "attr",
-    "alt": "inlines",
-    "url": "text",
-    "title": "text"
-  },
-  "quoted": {
-    "eclass": "inline",
-    "quotetype": [
-      "single",
-      "double"
-    ],
-    "content": "inlines"
-  },
-  "math": {
-    "eclass": "inline",
-    "mathtype": [
-      "display",
-      "inline"
-    ],
-    "math": "text"
-  },
-  "code": {
-    "eclass": "inline",
-    "attr": "attr",
-    "code": "text",
-    "code_lines": "[text]"
-  },
-  "inlinecontainer": {
-    "eclass": "inline",
-    "attr": "attr",
-    "content": "inlines"
-  },
-  "rawinline": {
-    "eclass": "inline",
-    "format": "text",
-    "raw": "text"
-  },
-  "footnote": {
-    "eclass": "inline",
-    "content": "blocks"
-  }
-}
diff --git a/docs/content.md b/docs/content.md
index f417821..188b3e3 100644
--- a/docs/content.md
+++ b/docs/content.md
@@ -1,8 +1,6 @@
-
-# Content Format
-
-
-
+---
+title: Content Format
+---
 
 
 
diff --git a/docs/gen_content.py b/docs/gen_content.py
deleted file mode 100755
index 6cb27e3..0000000
--- a/docs/gen_content.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env python3
-
-import json
-import os
-
-header = """
-# Content Format
-
-
-
-"""
-
-def print_entry(key, parser_raw):
-    # | key | parser | comment |
-    parser = '`' + str(parser_raw) + '`'
-
-    if parser_raw == "text":
-        parser = "String"
-    elif parser_raw == "int":
-        parser = "Integer"
-    elif parser_raw == "[text]":
-        parser = "\[String\]"
-    elif parser_raw == "attr":
-        parser = "[Attr](#attr)"
-    elif parser_raw == "blocks":
-        parser = "\[[Block](#blocks)\]"
-    elif parser_raw == "[blocks]":
-        parser = "\[\[[Block](#blocks)\]\]"
-    elif parser_raw == "inlines":
-        parser = "\[[Inline](#inlines)\]"
-    elif parser_raw == "kvps":
-        parser = "{foo: bar, alice: bob, ...}"
-    elif isinstance(parser_raw,list):
-        parser = '`' + '` \| `'.join(parser_raw) + '`'
-
-    print("| {key} | {parser} | {comment} |".format(key=key, parser=parser, comment=""))
-
-def print_table_header():
-    print("| Key | Parser | Comment |")
-    print("|-----|--------|---------|")
-
-
-def print_etype(etype, c):
-    print("")
-    print("")
-    print("### {etype}".format(etype=etype))
-    print("")
-    print_table_header()
-    print_entry("etype", etype)
-    for key, value in c.items():
-        print_entry(key, value)
-
-
-if __name__ == '__main__':
-    j = {}
-    with open('content.json') as f:
-        j = json.loads(f.read())
-
-    print(header)
-    print("")
-    print("")
-    print("## Attr")
-    print("")
-    print("")
-    print_table_header()
-    print_entry("id", "text")
-    print_entry("classes", "[text]")
-    print_entry("extra", "kvps")
-
-
-    print("")
-    print("")
-    print("## Blocks")
-    is_blocks = True
-    for etype, c in j.items():
-        if c['eclass'] != 'block' and is_blocks:
-            is_blocks = False
-            print("")
-            print("")
-            print("## Inlines")
-        print_etype(etype, c)
-
-
diff --git a/docs/index.de.md b/docs/index.de.md
new file mode 100644
index 0000000..632907f
--- /dev/null
+++ b/docs/index.de.md
@@ -0,0 +1,14 @@
+---
+title: Dokumentation Startseite
+template: "index.html"
+after:
+  - type: "news"
+    title:
+      de: "Zuletzt Veränderte Seiten"
+    id: "last_changed"
+    num: 5
+
+---
+
+Hier findest du die Dokumentation zur Fachgruppenwebseite.
+
-- 
GitLab