Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Dec 31, 2024
1 parent ece4fd2 commit 0b48dab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
make compile
# Run local
python build.py
make
# Publish
Expand Down Expand Up @@ -38,4 +39,4 @@ ExecStart=/root/.bun/bin/bun run server.js
[Install]
WantedBy=multi-user.target
```
```
15 changes: 11 additions & 4 deletions docs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import sys
from html import escape

# Put 'auto_editor' in Python path
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
Expand All @@ -19,20 +20,26 @@ def main():

with open("src/ref/options.html", "w") as file:
file.write(
'{{ header-desc "Options" "These are the options and flags that auto-editor uses." }}\n'
'{{ headerdesc "Options" "These are the options and flags that auto-editor uses." }}\n'
"<body>\n"
"{{ nav }}\n"
'<section class="section">\n'
'<div class="container">\n'
)
for op in parser.args:
if isinstance(op, OptionText):
file.write(f"<h2>{op.text}</h2>\n")
file.write(f"<h2>{escape(op.text)}</h2>\n")
else:
file.write(f"<h3><code>{op.names[0]}</code></h3>\n")
if op.metavar is None:
file.write(f"<h3><code>{op.names[0]}</code></h3>\n")
else:
file.write(
f"<h3><code>{op.names[0]} {escape(op.metavar)}</code></h3>\n"
)

if len(op.names) > 1:
file.write(
"<h4><code>"
"<h4>Aliases: <code>"
+ "</code> <code>".join(op.names[1:])
+ "</code></h4>\n"
)
Expand Down
File renamed without changes.

0 comments on commit 0b48dab

Please sign in to comment.