commit d9a891734f4f75d6c8e39c9e0288cfdc003c3251
parent ea776098c478da0098ed6ac1fd7477a752570d1f
Author: Friedel Schön <[email protected]>
Date: Fri, 2 Jun 2023 00:29:18 +0200
uncrazify doc-lists
Diffstat:
3 files changed, 17 insertions(+), 29 deletions(-)
diff --git a/Makefile b/Makefile
@@ -69,7 +69,7 @@ $(INTERMED_DIRS):
mkdir -p $@
$(DOC_AST_DIR): $(ASSETS_DIR) | $(DOCS_DIR)
- cp -rv $< $@
+ cp -rv $</* $@
# Object rules
@@ -88,13 +88,13 @@ $(BIN_DIR)/%: $(EXEC_DIR)/%.lnk | $(BIN_DIR)
ln -sf $(shell cat $<) $@
# Documentation and Manual
-$(DOCS_DIR)/%.html: $(TEMPL_DIR)/%.txt $(DOC_AST_DIR) | $(DOCS_DIR)
+$(DOCS_DIR)/%.html: $(TEMPL_DIR)/%.txt $(DOC_AST_DIR) $(MAKE_DOCS) | $(DOCS_DIR)
$(SED) 's/%VERSION%/$(VERSION)/' $< | $(PYTHON) $(MAKE_DOCS) > $@
-$(DOCS_DIR)/%.html: $(MAN_DIR)/%.txt $(DOC_AST_DIR) | $(DOCS_DIR)
+$(DOCS_DIR)/%.html: $(MAN_DIR)/%.txt $(DOC_AST_DIR) $(MAKE_DOCS) | $(DOCS_DIR)
$(SED) 's/%VERSION%/$(VERSION)/' $< | $(PYTHON) $(MAKE_DOCS) > $@
-$(ROFF_DIR)/%: $(MAN_DIR)/%.txt | $(ROFF_DIR)
+$(ROFF_DIR)/%: $(MAN_DIR)/%.txt $(MAKE_MAN) | $(ROFF_DIR)
$(SED) 's/%VERSION%/$(VERSION)/' $< | $(PYTHON) $(MAKE_MAN) | $(AWK) '/./ { print }' > $@
# Debug
diff --git a/assets/style.css b/assets/style.css
@@ -12,7 +12,7 @@ body.dark {
@media(max-width:999px) {
body {
- font-size: 1.94vw
+ font-size: 1vw;
}
}
@@ -63,23 +63,9 @@ a:hover {
height: 1em;
}
-ul {
- list-style: none;
- padding: 0;
- margin: 0;
-}
-
-li {
- margin-left: 2ch;
+.list {
text-indent: -2ch;
-}
-
-li::before {
- content: '* ';
-}
-
-.header {
-
+ padding-left: 2ch;
}
.header .title {
diff --git a/make-docs.py b/make-docs.py
@@ -31,7 +31,7 @@ TITLE_TEMPLATE = "<a class=title id={id} href=#{id}>{text}</a>"
def inline_convert(text):
text = re.sub(r'\*(.+?)\*', r'<b>\1</b>', text)
- text = re.sub(r'_(.+?)_', r'<i>\1</i>', text)
+ text = re.sub(r'_(.+?)_', r'<u>\1</u>', text)
text = re.sub(r'\[(.*?)\]\((.*?)\)', r'<a href="\2">\1</a>', text)
return text
@@ -49,11 +49,11 @@ for line in sys.stdin:
elif line.startswith("@header"):
_, text = line.split(" ", 1)
print(HEADER_TEMPLATE.format(text=text))
- print(HEADER_CHAR * WIDTH)
+ sys.stdout.write(HEADER_CHAR * WIDTH)
elif line.startswith("@title"):
_, id, text = line.split(" ", 2)
print(TITLE_TEMPLATE.format(id=id, text=text))
- print(TITLE_CHAR * WIDTH)
+ sys.stdout.write(TITLE_CHAR * WIDTH)
elif line.startswith("@code"):
width = WIDTH -2
if in_list:
@@ -67,12 +67,14 @@ for line in sys.stdin:
sys.stdout.write('+' + '-' * width + '+')
in_code = False
elif line.startswith("@list"):
- sys.stdout.write("<ul>\n<li>")
+ sys.stdout.write("<div class=list>* ")
in_list = True
elif line.startswith("@endlist"):
- sys.stdout.write("</li></ul>")
+ sys.stdout.write("</div>")
in_list = False
-
+ elif line == '~':
+ print()
+
elif in_code:
padding = WIDTH - 4 - len(line)
if in_list:
@@ -85,8 +87,8 @@ for line in sys.stdin:
elif line:
sys.stdout.write(inline_convert(line) + ' ')
elif in_list: # is empty but in line
- sys.stdout.write("</li>\n<li>")
+ sys.stdout.write("</div>\n<div class=list>* ")
else: # is empty
- print()
+ print('\n')
print(SUFFIX)
\ No newline at end of file