Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
doc: try to add a :show: attribute to the showfile directive
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 10 Nov 2019 16:58:31 +0000 (17:58 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 10 Nov 2019 18:09:06 +0000 (19:09 +0100)
docs/source/_ext/showfile.css
docs/source/_ext/showfile.js
docs/source/_ext/showfile.py

index eb44eab..1e3b831 100644 (file)
@@ -19,7 +19,7 @@
 }
 
 .toggle-header.open:after {
-    content: " â\96²";
+    content: " â¯\87";
 }
 
 .toggle-content {
index 7dae2b1..fd8ae6c 100644 (file)
@@ -3,7 +3,7 @@ $(function() {
     /**
      * Toggle logic
      */
-    $('.toggle-content').hide()
+    $('.hidden-content').hide()
     $('.toggle-header').click(function () {
         $(this).toggleClass("open");
         $(this).next('.toggle-content').toggle('400');
index 5d79a32..2c37ef6 100644 (file)
@@ -21,7 +21,7 @@ class ShowFileDirective(Directive):
     has_content = False
     optional_arguments = 1
     option_spec = {
-      'language': directives.unchanged
+        'language': directives.unchanged
     }
 
     def run(self):
@@ -110,12 +110,21 @@ class ExampleTabDirective(Directive):
 
 class ToggleDirective(Directive):
     has_content = True
-    option_spec = {'header': directives.unchanged}
+    option_spec = {
+        'header': directives.unchanged,
+        'show': directives.flag
+    }
     optional_arguments = 1
 
     def run(self):
         node = nodes.container()
         node['classes'].append('toggle-content')
+        if not "show" in self.options:
+            # This :show: thing is not working, and I fail to see why.
+            # Only the hidden-content class gets a call to hide() in the Javascript,
+            # and :show:n block# still get hidden when I load the page.
+            # No idea what's going on (Mt)
+            node['classes'].append('hidden-content')
 
         par = nodes.container()
         par['classes'].append('toggle-header')