Skip to content

Commit df6ff35

Browse files
committed
docutils: Allow coq directives to take a class and a name
1 parent 03f7542 commit df6ff35

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

alectryon/docutils.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,19 +324,26 @@ class CoqDirective(Directive):
324324
required_arguments = 0
325325
optional_arguments = 1
326326
final_argument_whitespace = True
327-
option_spec = {}
327+
option_spec = {'class': directives.class_option,
328+
'name': directives.unchanged}
328329
has_content = True
329330

330331
EXPECTED_INDENTATION = 3
331332

332333
def run(self):
334+
roles.set_classes(self.options)
333335
self.assert_has_content()
336+
334337
arguments = self.arguments[0].split() if self.arguments else []
335338
contents = recompute_contents(self, CoqDirective.EXPECTED_INDENTATION)
336339
details = {"options": set(arguments), "contents": contents}
337-
pending = alectryon_pending(AlectryonTransform, details=details)
340+
pending = alectryon_pending(AlectryonTransform, details=details,
341+
**self.options)
342+
338343
set_line(pending, self.lineno, self.state_machine)
344+
self.add_name(pending)
339345
self.state_machine.document.note_pending(pending)
346+
340347
return [pending]
341348

342349
class AlectryonToggleDirective(Directive):

0 commit comments

Comments
 (0)