diff --git a/content/style/preambule_slides.tex b/content/style/preambule_slides.tex index acf2b8a..ad0bdb4 100644 --- a/content/style/preambule_slides.tex +++ b/content/style/preambule_slides.tex @@ -1,4 +1,3 @@ -\documentclass{beamer} %\usertheme{Madrid} \setbeamercovered{transparent} diff --git a/setup_main_tex_file.py b/setup_main_tex_file.py index 962a1e2..f1d30df 100755 --- a/setup_main_tex_file.py +++ b/setup_main_tex_file.py @@ -8,12 +8,18 @@ import time from os import path, makedirs from jinja2 import Environment, FileSystemLoader +LICENSES = {'CC-by-sa-2.0': 'license-cc-by-sa-2.0', + } + +LATEX_SUBS = {} + + def get_unique_name(base): now = time.localtime() year = str(now[0]) month = str(now[1]).rjust(2, '0') day = str(now[2]).rjust(2, '0') - rand = str(randint(0, 100)).rjust(2, '0') + rand = str(random.randint(0, 100)).rjust(2, '0') return '-'.join([base, year, month, day, rand]).decode('utf-8') @@ -55,13 +61,23 @@ def main(): else: author = author.decode('utf-8') + client = args.client + if not client: + client = u'FIXME' + else: + client = client.decode('utf-8') + directory = args.directory if not directory: directory = '' + license = LICENSES.get(args.license, 'license-cc-by-sa-2.0') + env = {'root': root, 'title': title, - 'author': author} + 'author': author, + 'client': client, + 'license': license} resources = [(path.join('presentations', directory), 'main.tex'),] #('slides', 'license-cc-by-sa-2.0.tex'), #('slides', 'preambule.tex'), @@ -134,7 +150,9 @@ def main(): parser_init = subparsers.add_parser('init', help='Initialisation du fichier maître') parser_init.add_argument('-n', '--name', help="Nom du fichier à créer", required=True) parser_init.add_argument('-a', '--author', help="Auteur de la formation") + parser_init.add_argument('-c', '--client', help="Client") parser_init.add_argument('-t', '--title', help="Titre de la formation") + parser_init.add_argument('-l', '--license', help="Termes de mise à disposition de la formation") parser_init.add_argument('-d', '--directory', help="Sous-répertoires où créer le fichier", required=True) parser_init.set_defaults(func=init) parser_update = subparsers.add_parser('update', help='Mise à jour des fichiers inclus') diff --git a/templates/main.tex b/templates/main.tex index c993936..74271d3 100644 --- a/templates/main.tex +++ b/templates/main.tex @@ -12,15 +12,14 @@ bib = database/bib ]{skblocal.tex} -\skbinput[]{styles/preambule} -\skbinput[]{styles/formation\_en} +\skbinput[from=rep]{style/preambule_slides} \title[]{(((title)))} -\subtitle{XXX CLIENT XXX} +\subtitle{(((client)))} \author[Equipe Auteur]{(((author)))} -\institute[Cadoles]{\skbfigure[width=2cm]{cadoles/logo\_01.png}} +\institute[Cadoles]{\skbfigure[width=2cm]{cadoles/logo_01.png}} \date{{\small \today}} @@ -36,7 +35,7 @@ \begin{document} -\skbinput[]{styles/title.tex} +\skbinput[from=rep]{style/title} % Corps de la formation %\skbinput[from=slides]{}