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
|
* [ ] custom python code in tables
|
||||||
* [x] fix overlong table cells (pandoc longtable only deals with overlong tables but not cells)
|
* [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)
|
* [ ] add a book mode for mixing input and headers (# Blah -m mod.cg.yaml)
|
||||||
|
* [ ] table generator
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
import token
|
import token
|
||||||
|
import string
|
||||||
|
|
||||||
class TableGenerator:
|
class TableGenerator:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
@ -34,4 +35,36 @@ class TableGenerator:
|
||||||
row.append(' ')
|
row.append(' ')
|
||||||
|
|
||||||
print(' | '.join(row))
|
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:
|
book:
|
||||||
- fields:
|
- fields:
|
||||||
- name
|
- name
|
||||||
|
|
|
@ -34,6 +34,8 @@ goal:
|
||||||
bewerten. Sie lernen grundsätzliche Technologien der 3D Echtzeitdarstellung
|
bewerten. Sie lernen grundsätzliche Technologien der 3D Echtzeitdarstellung
|
||||||
kennen und wenden diese an.
|
kennen und wenden diese an.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
en: |
|
en: |
|
||||||
Computer graphics is describing all techniques in computer science
|
Computer graphics is describing all techniques in computer science
|
||||||
generating images perceivable by humans. Participants will have a broad
|
generating images perceivable by humans. Participants will have a broad
|
||||||
|
|
|
@ -4,7 +4,7 @@ name:
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
|
||||||
competency-table:
|
competency-table:
|
||||||
de:
|
de:
|
||||||
- "Lineare Algebra": 'ABC'
|
- "Lineare Algebra": 'ABC'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue