mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat(docs): use github-flavored markdown at the shuttle level too
This commit is contained in:
@@ -4,17 +4,25 @@ title: |
|
|||||||
{{name}} Datasheet
|
{{name}} Datasheet
|
||||||
subtitle: Project Repository [{{repo}}]({{repo}})
|
subtitle: Project Repository [{{repo}}]({{repo}})
|
||||||
documentclass: scrartcl
|
documentclass: scrartcl
|
||||||
date: \today{}
|
date: |
|
||||||
|
```{=latex}
|
||||||
|
\today{}
|
||||||
|
```
|
||||||
geometry: "left=2cm,right=2cm,top=2cm,bottom=2.5cm"
|
geometry: "left=2cm,right=2cm,top=2cm,bottom=2.5cm"
|
||||||
fontsize: 14pt
|
fontsize: 14pt
|
||||||
mainfont: Latin Modern Sans
|
mainfont: Latin Modern Sans
|
||||||
header-includes:
|
header-includes:
|
||||||
- \usepackage{hyperref}
|
- |
|
||||||
- \hypersetup{colorlinks=true,
|
```{=latex}
|
||||||
|
\usepackage{hyperref}
|
||||||
|
\hypersetup{colorlinks=true,
|
||||||
urlcolor=blue,
|
urlcolor=blue,
|
||||||
linkcolor=[rgb]{0,0,0.5},
|
linkcolor=[rgb]{0,0,0.5},
|
||||||
allbordercolors={0 0 0},
|
allbordercolors={0 0 0},
|
||||||
pdfborderstyle={/S/U/W 1} }
|
pdfborderstyle={/S/U/W 1} }
|
||||||
|
```
|
||||||
---
|
---
|
||||||
|
|
||||||
|
```{=latex}
|
||||||
\pagebreak
|
\pagebreak
|
||||||
|
```
|
||||||
|
|||||||
+6
-10
@@ -121,7 +121,7 @@ class Docs:
|
|||||||
|
|
||||||
logging.info(f"building datasheet for {project}")
|
logging.info(f"building datasheet for {project}")
|
||||||
|
|
||||||
# ensure there are no LaTeX escape sequences in various fields, and that optional fields are set
|
# ensure that optional fields are set
|
||||||
for key in [
|
for key in [
|
||||||
"author",
|
"author",
|
||||||
"description",
|
"description",
|
||||||
@@ -129,32 +129,28 @@ class Docs:
|
|||||||
"git_url",
|
"git_url",
|
||||||
"doc_link",
|
"doc_link",
|
||||||
]:
|
]:
|
||||||
if key in yaml_data:
|
if key not in yaml_data:
|
||||||
yaml_data[key] = str(yaml_data[key]).replace(
|
|
||||||
"\\", "\\mbox{\\textbackslash}"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
yaml_data[key] = ""
|
yaml_data[key] = ""
|
||||||
|
|
||||||
# now build the doc & print it
|
# now build the doc & print it
|
||||||
try:
|
try:
|
||||||
doc = chevron.render(doc_template, yaml_data)
|
doc = chevron.render(doc_template, yaml_data)
|
||||||
fh.write(doc)
|
fh.write(doc)
|
||||||
fh.write("\n\\clearpage\n")
|
fh.write("\n```{=latex}\n\\clearpage\n```\n")
|
||||||
except IndexError:
|
except IndexError:
|
||||||
logging.warning("missing pins in info.yaml, skipping")
|
logging.warning("missing pins in info.yaml, skipping")
|
||||||
|
|
||||||
# ending
|
# ending
|
||||||
fh.write(doc_pinout)
|
fh.write(doc_pinout)
|
||||||
fh.write("\n\\clearpage\n")
|
fh.write("\n```{=latex}\n\\clearpage\n```\n")
|
||||||
fh.write(doc_info)
|
fh.write(doc_info)
|
||||||
fh.write("\n\\clearpage\n")
|
fh.write("\n```{=latex}\n\\clearpage\n```\n")
|
||||||
fh.write(doc_credits)
|
fh.write(doc_credits)
|
||||||
|
|
||||||
logging.info(f"wrote markdown to {markdown_file}")
|
logging.info(f"wrote markdown to {markdown_file}")
|
||||||
|
|
||||||
if pdf_file is not None:
|
if pdf_file is not None:
|
||||||
pdf_cmd = f"pandoc --toc --toc-depth 2 --pdf-engine=xelatex -i {markdown_file} -o {pdf_file}"
|
pdf_cmd = f"pandoc --toc --toc-depth 2 --pdf-engine=xelatex -i {markdown_file} -o {pdf_file} --from gfm+raw_attribute+smart+attributes"
|
||||||
logging.info(pdf_cmd)
|
logging.info(pdf_cmd)
|
||||||
p = subprocess.run(pdf_cmd, shell=True)
|
p = subprocess.run(pdf_cmd, shell=True)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
|
|||||||
+1
-1
@@ -864,7 +864,7 @@ class Project:
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
logging.warning("missing pins in info.yaml, skipping")
|
logging.warning("missing pins in info.yaml, skipping")
|
||||||
|
|
||||||
pdf_cmd = "pandoc --pdf-engine=xelatex --resource-path=docs -i datasheet.md -o datasheet.pdf --from gfm+raw_attribute+smart"
|
pdf_cmd = "pandoc --pdf-engine=xelatex --resource-path=docs -i datasheet.md -o datasheet.pdf --from gfm+raw_attribute+smart+attributes"
|
||||||
logging.info(pdf_cmd)
|
logging.info(pdf_cmd)
|
||||||
p = subprocess.run(pdf_cmd, shell=True)
|
p = subprocess.run(pdf_cmd, shell=True)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user