Compare commits
No commits in common. "467727392a82919c46b118207a0850551d9b84d6" and "35fbc4ff8c53f547568c7053125e3160c03700dc" have entirely different histories.
467727392a
...
35fbc4ff8c
8 changed files with 87 additions and 1159 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -158,9 +158,3 @@ cython_debug/
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Other
|
|
||||||
|
|
||||||
*.pdf
|
|
|
@ -15,7 +15,6 @@ import itertools
|
||||||
import yaml
|
import yaml
|
||||||
import textwrap
|
import textwrap
|
||||||
import string
|
import string
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
class MarkdownGenerator:
|
class MarkdownGenerator:
|
||||||
|
@ -40,9 +39,6 @@ class MarkdownGenerator:
|
||||||
|
|
||||||
for k,v in ti:
|
for k,v in ti:
|
||||||
|
|
||||||
if v == None:
|
|
||||||
v = ''
|
|
||||||
|
|
||||||
h = textwrap.wrap(k, h_len, break_long_words=False)
|
h = textwrap.wrap(k, h_len, break_long_words=False)
|
||||||
wrapper = textwrap.TextWrapper(d_len)
|
wrapper = textwrap.TextWrapper(d_len)
|
||||||
t = [wrapper.wrap(i) for i in v.split('\n') if i != '']
|
t = [wrapper.wrap(i) for i in v.split('\n') if i != '']
|
||||||
|
@ -151,26 +147,18 @@ def main():
|
||||||
# get arguments
|
# get arguments
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
# only run debug
|
# only run debug
|
||||||
if args.schema and args.meta and len(args.fields) > 0:
|
if args.schema and args.meta:
|
||||||
|
|
||||||
cb = CourseBuilder()
|
cb = CourseBuilder()
|
||||||
|
|
||||||
actual_fields = []
|
|
||||||
|
|
||||||
if os.path.isfile(args.fields[0]):
|
|
||||||
with open(args.fields[0]) as ff:
|
|
||||||
actual_fields = yaml.load(ff,Loader=yaml.Loader)['fields']
|
|
||||||
else:
|
|
||||||
actual_fields = args.fields
|
|
||||||
|
|
||||||
|
|
||||||
with open(args.schema) as f:
|
with open(args.schema) as f:
|
||||||
cb.set_schema(yaml.load(f,Loader=yaml.Loader))
|
cb.set_schema(yaml.load(f,Loader=yaml.Loader))
|
||||||
|
|
||||||
for m in args.meta:
|
for m in args.meta:
|
||||||
with open(m) as fm:
|
with open(m) as fm:
|
||||||
cb.process(yaml.load(fm,Loader=yaml.Loader),fields=actual_fields,lang=args.lang,pagebreak=args.pagebreak)
|
cb.process(yaml.load(fm,Loader=yaml.Loader),fields=args.fields,lang=args.lang,pagebreak=args.pagebreak)
|
||||||
else:
|
else:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
|
|
||||||
|
|
5
test/simple/.temp.md
Normal file
5
test/simple/.temp.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
+-----------------------------------+---------------------------------------------------------------------------------------------+
|
||||||
|
|Modulname |Computer Graphics |
|
||||||
|
+===================================+=============================================================================================+
|
||||||
|
|Kürzel |CG |
|
||||||
|
+-----------------------------------+---------------------------------------------------------------------------------------------+
|
|
@ -1,12 +1,8 @@
|
||||||
table.en.pdf:
|
table.pdf:
|
||||||
@echo "creating English version ..."
|
@echo "creating english version ..."
|
||||||
python ../../coursebuilder -s schema.yaml -m mod.cg.yaml -l en -f fields.yaml | pandoc --template pandoc-template/eisvogel.latex -o table.en.pdf
|
python ../../coursebuilder -s schema.yaml -m mod.cg.yaml -l en -f name id | pandoc -o table.pdf
|
||||||
|
|
||||||
table.de.pdf:
|
all: table.pdf
|
||||||
@echo "creating German version ..."
|
|
||||||
python ../../coursebuilder -s schema.yaml -m mod.cg.yaml -l de -f fields.yaml | pandoc --template pandoc-template/eisvogel.latex -o table.de.pdf
|
|
||||||
|
|
||||||
all: table.en.pdf table.de.pdf
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm table.en.pdf table.de.pdf
|
rm table.pdf
|
|
@ -1,18 +0,0 @@
|
||||||
fields:
|
|
||||||
- name
|
|
||||||
- id
|
|
||||||
- goal
|
|
||||||
- content
|
|
||||||
- form-of-instruction
|
|
||||||
- prerequisites
|
|
||||||
- media-of-instruction
|
|
||||||
- author-of-indenture
|
|
||||||
- used-in
|
|
||||||
- workload
|
|
||||||
- credits
|
|
||||||
- form-of-exam
|
|
||||||
- term
|
|
||||||
- frequency
|
|
||||||
- duration
|
|
||||||
- kind
|
|
||||||
- remarks
|
|
|
@ -1,7 +1,5 @@
|
||||||
name:
|
name:
|
||||||
de: Computergrafik
|
value: Computer Graphics
|
||||||
en: Computer Graphics
|
|
||||||
|
|
||||||
|
|
||||||
id:
|
id:
|
||||||
value: CG
|
value: CG
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,6 +6,7 @@
|
||||||
#
|
#
|
||||||
name:
|
name:
|
||||||
type: str
|
type: str
|
||||||
|
translatable: false
|
||||||
label: {
|
label: {
|
||||||
de: "Modulname",
|
de: "Modulname",
|
||||||
en: "name of course"
|
en: "name of course"
|
||||||
|
@ -185,12 +186,12 @@ form-of-exam:
|
||||||
term:
|
term:
|
||||||
label: {
|
label: {
|
||||||
de: "Semester",
|
de: "Semester",
|
||||||
en: "term"
|
en: "Term"
|
||||||
}
|
}
|
||||||
type: int
|
type: int
|
||||||
template:
|
template:
|
||||||
de: " ${value}. Semester"
|
de: "$value$. Semester"
|
||||||
en: " ${value}. semester"
|
en: "$value$ semester"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Häufigkeit des Angebots
|
# Häufigkeit des Angebots
|
||||||
|
@ -198,7 +199,7 @@ term:
|
||||||
frequency:
|
frequency:
|
||||||
label: {
|
label: {
|
||||||
de: "Häufigkeit des Angebots",
|
de: "Häufigkeit des Angebots",
|
||||||
en: "frequency of Offer"
|
en: "Frequency of Offer"
|
||||||
}
|
}
|
||||||
type: "enum"
|
type: "enum"
|
||||||
values: {
|
values: {
|
||||||
|
@ -214,9 +215,6 @@ frequency:
|
||||||
|
|
||||||
duration:
|
duration:
|
||||||
type: int
|
type: int
|
||||||
label:
|
|
||||||
de: Dauer
|
|
||||||
en: duration
|
|
||||||
template:
|
template:
|
||||||
de: "$value Semester"
|
de: "$value Semester"
|
||||||
en: "$value term(s)"
|
en: "$value term(s)"
|
||||||
|
@ -242,5 +240,71 @@ remarks:
|
||||||
type: str
|
type: str
|
||||||
label: {
|
label: {
|
||||||
de: "Bemerkungen",
|
de: "Bemerkungen",
|
||||||
en: "remarks"
|
en: "Remarks"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# test:
|
||||||
|
# label: { de: "Name", en: "A Test" }
|
||||||
|
# type: enum
|
||||||
|
# values: {
|
||||||
|
# 'brand' : { de: "Marke", en: "Brand" },
|
||||||
|
# 'new' : { de: "Neu", en: "New" }
|
||||||
|
# }
|
||||||
|
|
||||||
|
|
||||||
|
# # German
|
||||||
|
# de:
|
||||||
|
# name: Modulname
|
||||||
|
# id: Kürzel
|
||||||
|
# instructor: Modulverantwortlicher
|
||||||
|
# goal: Qualifikationsziele
|
||||||
|
# content: Modulinhalte
|
||||||
|
# form: Lehrformen
|
||||||
|
# prerequisites: Voraussetzungen für die Teilnahme
|
||||||
|
# media-of-instruction: Literatur/ multimediale Lehr- und Lernprogramme
|
||||||
|
# author-of-indenture: Lehrbriefautor
|
||||||
|
# used-in: Verwendbarkeit
|
||||||
|
# workload: Arbeitsaufwand/ Gesamtworkload
|
||||||
|
# credits: ECTS und Gewichtung der Note in der Gesamtnote
|
||||||
|
# form-of-exam: Leistungsnachweis
|
||||||
|
# term: Semester
|
||||||
|
# frequency: Häufigkeit des Angebots
|
||||||
|
# duration: Dauer
|
||||||
|
# kind: Art der Veranstaltung (Pflicht, Wahl, etc.)
|
||||||
|
# remarks: Bemerkungen
|
||||||
|
|
||||||
|
# # English
|
||||||
|
# en:
|
||||||
|
# name: Coursename
|
||||||
|
# id: Code
|
||||||
|
# instructor: Instructor
|
||||||
|
# goal: Goals of Qualification
|
||||||
|
# content: Content and Topics
|
||||||
|
# form: Form of Instruction
|
||||||
|
# prerequisites: Prerequisites
|
||||||
|
# media-of-instruction: Media of Instruction
|
||||||
|
# author-of-indenture: Author of Indenture
|
||||||
|
# used-in: Viable for Course
|
||||||
|
# workload: Workload
|
||||||
|
# credits: Credits and Weight of Mark
|
||||||
|
# form-of-exam: Form of Examination
|
||||||
|
# term: Term
|
||||||
|
# frequency: Frequency
|
||||||
|
# duration: Duration
|
||||||
|
# kind: Compulsory / Elective
|
||||||
|
# remarks: Remarks
|
||||||
|
|
||||||
|
# # validators for enum-fields
|
||||||
|
# enums:
|
||||||
|
# form:
|
||||||
|
# - lecture
|
||||||
|
# - seminar
|
||||||
|
# - project
|
||||||
|
# form-of-exam:
|
||||||
|
# - written
|
||||||
|
# - oral
|
||||||
|
# - alternative
|
||||||
|
# term:
|
||||||
|
# - summer
|
||||||
|
# - winter
|
||||||
|
# - both
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue