mirror of
https://github.com/len0rd/personal-website.git
synced 2026-10-10 08:02:54 -04:00
install rail diagram
This commit is contained in:
parent
edb19a8da3
commit
f9cd8d69d8
3 changed files with 33 additions and 0 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "extern/rail_diagram"]
|
||||
path = extern/rail_diagram
|
||||
url = ../rail_diagram
|
||||
29
conf.py
29
conf.py
|
|
@ -1,5 +1,7 @@
|
|||
# Sphinx docs configuration for building project documentation
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
from pygments import token
|
||||
from pygments.lexer import RegexLexer, bygroups
|
||||
|
|
@ -214,3 +216,30 @@ class CanbusDbcLexer(RegexLexer):
|
|||
|
||||
|
||||
lexers["dbc"] = CanbusDbcLexer(startinline=True)
|
||||
|
||||
|
||||
def copy_rail_diagram(app, exception):
|
||||
if exception is not None:
|
||||
return
|
||||
|
||||
project_root = Path(__file__).parent
|
||||
rail_diagram_dir = project_root / "extern" / "rail_diagram"
|
||||
output_rail_dir = Path(app.outdir) / "rail"
|
||||
output_rail_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
shutil.copy2(
|
||||
rail_diagram_dir / "railroad_diagram.html",
|
||||
output_rail_dir / "index.html",
|
||||
)
|
||||
shutil.copy2(
|
||||
rail_diagram_dir / "railroad_app.js",
|
||||
output_rail_dir / "railroad_app.js",
|
||||
)
|
||||
shutil.copy2(
|
||||
rail_diagram_dir / "railroad_data.js",
|
||||
output_rail_dir / "railroad_data.js",
|
||||
)
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.connect("build-finished", copy_rail_diagram)
|
||||
|
|
|
|||
1
extern/rail_diagram
vendored
Submodule
1
extern/rail_diagram
vendored
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit dd5ed091f91ab789bc829cd9754da6d830e4c038
|
||||
Loading…
Add table
Add a link
Reference in a new issue