prototyping table generator
This commit is contained in:
parent
4105eb917b
commit
021a0f69d3
5 changed files with 43 additions and 2 deletions
1
TODO.md
1
TODO.md
|
@ -4,3 +4,4 @@
|
|||
* [ ] custom python code in tables
|
||||
* [x] fix overlong table cells (pandoc longtable only deals with overlong tables but not cells)
|
||||
* [ ] add a book mode for mixing input and headers (# Blah -m mod.cg.yaml)
|
||||
* [ ] table generator
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
import token
|
||||
import string
|
||||
|
||||
class TableGenerator:
|
||||
def __init__(self) -> None:
|
||||
|
@ -34,4 +35,36 @@ class TableGenerator:
|
|||
row.append(' ')
|
||||
|
||||
print(' | '.join(row))
|
||||
|
||||
|
||||
self.run_template()
|
||||
|
||||
|
||||
def run_template(self):
|
||||
t = string.Template(self.get_latex_template())
|
||||
print(t.substitute({ 'value' : "Test"}))
|
||||
|
||||
|
||||
|
||||
def get_latex_template(self) -> str:
|
||||
|
||||
return (r'\documentclass{article}'
|
||||
r'\usepackage[utf8]{inputenc}'
|
||||
r'\usepackage[]{tabularx}'
|
||||
r'\usepackage[margin=0.7in]{geometry}'
|
||||
r'\begin{document}'
|
||||
r'\begin{table}[ht]'
|
||||
r'\begin{tabular}{l c c}'
|
||||
r'${value}'
|
||||
r'\end{tabular}'
|
||||
r'\end{table}'
|
||||
r'\end{document}')
|
||||
|
||||
|
||||
#
|
||||
# Kompetenz & Kennen & Wertung \\
|
||||
|
||||
# 1 & Pandoc & +++ \\
|
||||
# 2 & Latex & ++ \\
|
||||
# 3 & Writer & +- \\
|
||||
#
|
||||
# latex image.tex;dvisvgm image.dvi
|
|
@ -1,3 +1,8 @@
|
|||
|
||||
#
|
||||
# demonstrates a coursebook setting
|
||||
#
|
||||
|
||||
book:
|
||||
- fields:
|
||||
- name
|
||||
|
|
|
@ -34,6 +34,8 @@ goal:
|
|||
bewerten. Sie lernen grundsätzliche Technologien der 3D Echtzeitdarstellung
|
||||
kennen und wenden diese an.
|
||||
|
||||
|
||||
|
||||
en: |
|
||||
Computer graphics is describing all techniques in computer science
|
||||
generating images perceivable by humans. Participants will have a broad
|
||||
|
|
|
@ -4,7 +4,7 @@ name:
|
|||
|
||||
|
||||
test:
|
||||
|
||||
|
||||
competency-table:
|
||||
de:
|
||||
- "Lineare Algebra": 'ABC'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue