Commits

Robert Mařík  committed 3a41e4b

new option "-H", "--hide"

  • Participants
  • Parent commits 23b28b1

Comments (0)

Files changed (1)

             self.language = 'sage'
 
     def latex(self):
+        if options.hide:
+            first_line = self.text.splitlines()[0]
+            if first_line == '%hide':
+                return ""
         latex_str = colorize(self.text, format=self.language)
         verb_before = r"\begin{Verbatim}[commandchars=@\[\]]"
         verb_after  = r"\begin{Verbatim}[frame=single,label={" + self.language.capitalize() + " code},commandchars=@\[\]]"
                       action = "store", dest = "lang", default = None,
                       help = "input language settings (babel)")
 
+opt_parser.add_option("-H", "--hide",
+                      action = "store_true", dest = "hide", default = False,
+                      help = "do not pring cell with %hide token")
+
 (options, args) = opt_parser.parse_args()
 
 if len(args) < 2: