Skip to content
Snippets Groups Projects
Commit 4e7c21f6 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Web: Rozcestník

parent af4e509f
No related branches found
No related tags found
No related merge requests found
......@@ -19,9 +19,12 @@ d = pathlib.Path("/".join(__file__.split("/")[:-1]))
web = jk_web.main.web
copy_file = web.copy_file
Page = web.Page
LangPage = web.LangPage
CZ = jk_web.main.CZ
relative_link = web.relative_link
S = web.S
timer = web.timer
html = web.html
base_page = jk_web.main.base_page
......@@ -30,17 +33,30 @@ base_page = jk_web.main.base_page
with web.Module("bakalarka") as module_bakalarka, web.ctx.add_out_path_prefix(jk_web.main.bakalarka_prefix):
bakalarka_pdf = web.ctx.out_path_prefix + "bakalarka.pdf"
web_index = web.Mpage(d,
"index",
@LangPage(lambda: Page("index.html", short_title="Bakalářská práce", higher_page=jk_web.main.web_projects), CZ)
def web_index():
b = html.Builder()
b.h2("Bakalářská práce: Binární paint shop problém")
with b.ul():
b.li.a(href=relative_link(web_prace))("Práce (web)")
b.li.a(href=relative_link(bakalarka_pdf))("Práce (pdf)")
b.li.a(href=relative_link(web_posudek_vedouci))("Posudek vedoucího")
b.li.a(href=relative_link(web_posudek_oponent))("Posudek oponenta")
b.li.a(href=relative_link(web_prezentace))("Prezentace na obhajobě")
return base_page(b.root)
assert str(web_index) == jk_web.main.web_bakalarka, (str(web_index), jk_web.main.web_bakalarka)
with web.Module("bakalarka-prace"):
bakalarka_pdf = web.ctx.out_path_prefix + "prace.pdf"
web_prace = web.Mpage(d,
"prace",
source="index.md",
bibliography=d/"sample.bib",
page_builder=base_page,
source_code_module=(lambda: ...).__module__,
commands=formatitko_commands,
custom_pdf=bakalarka_pdf,
)
assert str(web_index) == jk_web.main.web_bakalarka, (str(web_index), jk_web.main.web_bakalarka)
web_index.higher_page = jk_web.main.web_projects
@web.add_job(web.PRIORITY_WRITE)
def gen_bakalarka_pdf():
......@@ -48,3 +64,22 @@ with web.Module("bakalarka") as module_bakalarka, web.ctx.add_out_path_prefix(jk
from .bakalarka import main
main(pathlib.Path(tmpdirname), False)
print(web.copy_file(None, bakalarka_pdf, tmpdirname+"/bakalarka.pdf", add_out_path_prefix=False))
web_prace.higher_page = web_index
web_posudek_vedouci = web.copy_file(d, "posudek_vedouci.pdf")
web_posudek_oponent = web.copy_file(d, "posudek_oponent.pdf")
with web.Module("bakalarka-prezentace"):
web_prezentace = web.ctx.out_path_prefix + "prezentace.pdf"
@web.add_job(web.PRIORITY_GENERATE)
def gen_prezentace():
import subprocess
tmpdirname = tempfile.mkdtemp(dir=web.build_dir)
shutil.copytree(d/"prezentace", tmpdirname+"/prezentace")
subprocess.run(["./build.sh"], cwd=tmpdirname+"/prezentace", check=True)
print(web.copy_file(None, web_prezentace, tmpdirname+"/prezentace/main.pdf", add_out_path_prefix=False))
File added
File added
../../prezentace
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment