markdown: add a toolcontext attribute
authorJean Privat <jean@pryen.org>
Fri, 23 Aug 2013 18:44:36 +0000 (14:44 -0400)
committerJean Privat <jean@pryen.org>
Fri, 23 Aug 2013 18:44:36 +0000 (14:44 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/markdown.nit
src/nitunit.nit

index dd839c4..6653fc6 100644 (file)
@@ -20,6 +20,8 @@ import html
 
 # The class that does the convertion from a `ADoc` to HTML
 private class Doc2Mdwn
+       var toolcontext: ToolContext
+
        # The lines of the current code block, empty is no current code block
        var curblock = new Array[String]
 
@@ -177,14 +179,16 @@ redef class ADoc
        # Build a `<div>` element that contains the full documentation in HTML
        fun full_markdown: HTMLTag
        do
-               var d2m = new Doc2Mdwn
+               var tc = new ToolContext
+               var d2m = new Doc2Mdwn(tc)
                return d2m.work(self)
        end
 
        # Build a `<span>` element that contains the synopsys in HTML
        fun short_markdown: HTMLTag
        do
-               var d2m = new Doc2Mdwn
+               var tc = new ToolContext
+               var d2m = new Doc2Mdwn(tc)
                return d2m.short_work(self)
        end
 end
index f31b405..05cdcc5 100644 (file)
@@ -23,8 +23,6 @@ import parser_util
 class NitUnitExecutor
        super Doc2Mdwn
 
-       var toolcontext: ToolContext
-
        # The name of the module to import
        var modname: String
 
@@ -37,7 +35,7 @@ class NitUnitExecutor
        # Initialize a new e
        init(toolcontext: ToolContext, prefix: String, modname: String, testsuite: HTMLTag)
        do
-               self.toolcontext = toolcontext
+               super(toolcontext)
                self.prefix = prefix
                self.modname = modname
                self.testsuite = testsuite