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
]NextLast
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
]PrevFirst