Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ryukau committed Aug 11, 2024
1 parent 7c48e7e commit b221bc3
Show file tree
Hide file tree
Showing 107 changed files with 76,897 additions and 69,195 deletions.
2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ exclude:
- manual/FeedbackPhaser/FeedbackPhaser_ja.md
- manual/GenericDrum/GenericDrum_en.md
- manual/GenericDrum/GenericDrum_ja.md
- manual/GlitchSprinkler/GlitchSprinkler_en.md
- manual/GlitchSprinkler/GlitchSprinkler_ja.md
- manual/IterativeSinCluster/IterativeSinCluster_en.md
- manual/IterativeSinCluster/IterativeSinCluster_ja.md
- manual/L4Reverb/L4Reverb_en.md
Expand Down
24 changes: 20 additions & 4 deletions docs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ def dump_config_yml():
yaml.dump({"exclude": md_list}, outfile, default_flow_style=False)


def get_relpath(source, target):
"""Ensure forward slashes."""
return os.path.relpath(source, target).replace(os.sep, "/")


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--rebuild", action="store_true", help="rebuild all file")
Expand All @@ -134,10 +139,12 @@ def dump_config_yml():
dump_config_yml()

index_path = Path("index.html").resolve()
css_path = Path("style.css").resolve()
# css_path = Path("style.css").resolve()
template_path = Path("template.html").resolve()
favicon_svg_path = Path("img/favicon/favicon.svg").resolve()
favicon_png_path = Path("img/favicon/favicon.svg").resolve()
if os == "nt":
css_path = css_path.as_uri()
# css_path = css_path.as_uri()
template_path = template_path.as_uri()

section = {lang: loadCommonSection(lang) for lang in getLanguages()}
Expand All @@ -159,12 +166,16 @@ def dump_config_yml():

print(f"Processing {md}")

index_relpath = os.path.relpath(str(index_path), str(md.parent.resolve()))
favicon_svg_relpath = get_relpath(favicon_svg_path, md.parent.resolve())
favicon_png_relpath = get_relpath(favicon_png_path, md.parent.resolve())
index_relpath = get_relpath(index_path, md.parent.resolve())
if index_relpath == "index.html":
index_relpath = ""

pandoc_command = [
"pandoc",
"--lua-filter",
"./pandocfilter.lua",
"--standalone",
"--toc",
"--toc-depth=4",
Expand All @@ -174,8 +185,13 @@ def dump_config_yml():
f"date-meta={time.strftime('%F')}",
"--metadata",
f"index-relative-path={index_relpath}",
"--metadata",
f"favicon-svg-path={favicon_svg_relpath}",
"--metadata",
f"favicon-png-path={favicon_png_relpath}"
f"index-relative-path={index_relpath}",
f"--template={str(template_path)}",
f"--include-in-header={str(css_path)}",
# f"--include-in-header={str(css_path)}",
f"--output={html}",
]

Expand Down
Loading

0 comments on commit b221bc3

Please sign in to comment.