1
0
Fork 0

single talk directive

This commit is contained in:
boyska 2017-05-03 02:23:56 +02:00
parent 889e5521b6
commit 5d19f7e71b
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -102,6 +102,25 @@ class TalkListDirective(Directive):
]
class TalkDirective(Directive):
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = True
has_content = True
def run(self):
tmpl = jinja_env.get_template('talk.html')
data = get_talk_data(self.arguments[0])
if data is None:
return []
return [
nodes.raw('', tmpl.render(**data),
format='html')
]
# TODO: TalkGridDirective (griglia completa)
class TalksGenerator(generators.Generator):
def __init__(self, *args, **kwargs):
self.talks = []
@ -142,3 +161,4 @@ else:
signals.get_generators.connect(get_generators)
signals.initialized.connect(add_talks_option_defaults)
directives.register_directive('talklist', TalkListDirective)
directives.register_directive('talk', TalkDirective)