-
Notifications
You must be signed in to change notification settings - Fork 12
/
compile.py
72 lines (66 loc) · 2.2 KB
/
compile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import os
themes = { "1-introduccion" :
["la-evolucion-de-php-y-los-frameworks-mvc",
"ventajas-e-inconvenientes-de-los-frameworks",
"que-es-symfony",
"instalacion",
"directorios",
"bundles",
"composer",
"profiler-y-consola",
"ejercicios"],
"2-symfony-a-vista-de-pajaro" :
["fundamentos-http",
"request-response",
"routing",
"controller",
"templating",
"model",
"ejercicios"],
"3-doctrine" :
["doctrine",
"configuracion",
"entidades",
"relaciones",
"lazy-eager",
"dql",
"repositorios",
"ejercicios"],
"4-twig" :
["twig",
"conceptos-basicos",
"layouts-herencia",
"include-render",
"assets",
"extensiones"],
"5-formularios" :
["conceptos-basicos",
"validacion",
"field-types",
"formularios-embebidos",
"form-events"],
"6-inyeccion" :
["conceptos-teoricos",
"symfony2",
"ejercicios"],
"7-eventos" :
["introduccion",
"event-dispatcher",
"ejercicios"],
"8-seguridad" :
["conceptos-basicos",
"usuarios",
"ejercicios"],
}
def convert(theme, files):
full_path_files = [full_path(theme, file) for file in files]
print "Compiling", theme
execute_conversion("docx", theme, full_path_files);
def full_path(theme, file):
return theme + "/" + file + ".md"
def execute_conversion(doctype, theme, files):
joined = ' '.join(files)
command = "pandoc -o ./compiled/%s/%s.%s %s -t %s"%(doctype, theme, doctype, joined, doctype);
os.system(command)
for theme, files in themes.items() :
convert(theme, files)