mirror of
https://github.com/Cian-H/I-Form_Research_Server_Docs.git
synced 2025-12-22 22:22:03 +00:00
first commit
This commit is contained in:
37
build.py
Normal file
37
build.py
Normal file
@@ -0,0 +1,37 @@
|
||||
import subprocess
|
||||
|
||||
import tomlkit as toml
|
||||
|
||||
from scripts_config import readme_files # type: ignore
|
||||
|
||||
def create_readme():
|
||||
with open("README.md", "wt") as r:
|
||||
for header, file in readme_files.items():
|
||||
r.write(f"\n\n## {header}\n\n")
|
||||
with open(file, "rt") as f:
|
||||
r.write(f.read())
|
||||
|
||||
|
||||
def update_license():
|
||||
with open("LICENSE", "rt") as source, open("docs/license.md", "wt") as target:
|
||||
target.write(source.read())
|
||||
|
||||
|
||||
def build_docs():
|
||||
print("Building docs...")
|
||||
# First, ensure the license is up to date
|
||||
update_license()
|
||||
# Then, we build the docs
|
||||
subprocess.run(["poetry", "run", "mkdocs", "build", "--clean"])
|
||||
# Finally, export the readme
|
||||
print("Exporting readme...")
|
||||
create_readme()
|
||||
print("Finished building docs.")
|
||||
|
||||
|
||||
def main():
|
||||
build_docs()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user