Skip to content
Snippets Groups Projects
Verified Commit e25abcc0 authored by Jake's avatar Jake :speech_balloon:
Browse files

added base files and configuration for documentation

parent e8d1ed4b
No related branches found
No related tags found
No related merge requests found
/output
/docs-output
/public
/content
__pycache__
......
.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
content.md: content.json gen_content.py
./gen_content.py > content.md
.PHONY: run
run:
make -C ..
{
"menuitems": [
],
"lang": {
"de": {
"sitename": "Dokumentation Fachgruppenwebseite",
"banner": {
"title": "Startseite Dokumentation Fachgruppenwebseite"
},
"atom": {
"title": "Dokumentation Fachgruppenwebseite Atom Feed"
}
}
}
}
{
"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"
}
}
# Content Format
---
title: Content Format
---
......
#!/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)
---
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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment