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
and the doco between them
So basically, Interscript allows you to
code and document sections. This is called
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
Start python section to interscript/tests/output/mymodule3.py[1
And now for the hello method:
1: #line 302 "tutorial.pak"
2: import sys
3: class myclass:
4: def __init__(self, name):
5: self.name = name
Start python section to interscript/tests/output/mymodule3.py[2
You should see two code sections, embedded in documentation.
6: #line 309 "tutorial.pak"
7: def hello(self):
8: print 'hello','self.name