single talk directive
This commit is contained in:
parent
889e5521b6
commit
5d19f7e71b
1 changed files with 20 additions and 0 deletions
|
@ -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):
|
class TalksGenerator(generators.Generator):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.talks = []
|
self.talks = []
|
||||||
|
@ -142,3 +161,4 @@ else:
|
||||||
signals.get_generators.connect(get_generators)
|
signals.get_generators.connect(get_generators)
|
||||||
signals.initialized.connect(add_talks_option_defaults)
|
signals.initialized.connect(add_talks_option_defaults)
|
||||||
directives.register_directive('talklist', TalkListDirective)
|
directives.register_directive('talklist', TalkListDirective)
|
||||||
|
directives.register_directive('talk', TalkDirective)
|
||||||
|
|
Loading…
Reference in a new issue