5.2.3. Code sections

As you can see, the code is displayed with line numbers, and the file is named at the beginning and ending of each chunk. Interscript calls these chunks code sections and the doco between them document sections. So basically, Interscript allows you to interleave code and document sections. This is called gathering in some other literate programming tools. You can end a code section with an @head() command, or a @doc() command, which switches back to document mode.

Just so you can see it again, here is some code interleaved with documentation.

Start python section to interscript/tests/output/mymodule3.py[1 /2 ] Next Last
     1: #line 302 "tutorial.pak"
     2: import sys
     3: class myclass:
     4:   def __init__(self, name):
     5:     self.name = name
End python section to interscript/tests/output/mymodule3.py[1]
And now for the hello method:
Start python section to interscript/tests/output/mymodule3.py[2 /2 ] Prev First
     6: #line 309 "tutorial.pak"
     7:   def hello(self):
     8:     print 'hello','self.name
End python section to interscript/tests/output/mymodule3.py[2]
You should see two code sections, embedded in documentation.