6.16.3. Document Tangler

A document tangler writes to the documentation file without actually writing any source file: it can be used to present examples or code snippets, for example.
Start python section to interscript/tanglers/doc.py[1 /1 ]
     1: #line 182 "tanglers.ipk"
     2: #---------------------------------------------------------
     3: # document tangler: writes text as doco,
     4: # doesn't generate a file. Not the same as 'no' tangler
     5: from interscript.tanglers.base import tangler_base
     6: 
     7: class doc_tangler(tangler_base):
     8:   def __init__(self,weaver):
     9:     tangler_base.__init__(self,null_sink(),weaver)
    10:     self.language = 'document'
    11: 
    12:   def get_comment_tangler(self):
    13:     return self
    14: 
    15:   def writeline(self,data,file,count,inhibit_sref=0):
    16:     self.weaver.writeline(data,file,count)
    17: 
End python section to interscript/tanglers/doc.py[1]