Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] literate programming sample

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] literate programming sample


Chronological Thread 
  • From: "Sam Liddicott" <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] literate programming sample
  • Date: Tue, 20 Jul 2010 18:08:43 +0100
  • Envelope-to: address@hidden
  • Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAADxQTFRF NTdQY2Z/i286eHFugnNXoJBwm5GCs5VeoqO0ua+fwLCQ4c2q19C81NDF4eLr/unQ/PTf/fXW+/rq /f/7XKo76wAAAAlwSFlzAAALEwAACxMBAJqcGAAAAi9JREFUSMetloGSqyAMRVsFNAQkxP//15cE 62rFdt/MZqbTVu/hBhLEx/qf8fgDIAN455wHyPk7wCIe9nA+fwGSH87hgD8AHPfRpy2GwdMtcBh+ mg4Ech9Ih+RNixJKDLEL0GF8VLkSojePHrDlryNijbFW8zBg8PUKbBOI6D1WCV5Rf2DzxCtgBlMs tRRVW5LyVW3ew1TfAZZ6RcQicpb4yZmaC74DJADK6BdATOrUAbJzsZie+K22ZnEBknNYysvhVH6u 1X8CqAe4DuANoPoOrAbsHXUARJ5knc5z4EyyTnHoAqj7xvkYIdk65AwhyEZKMusOIDV2QQQaCnDQ gBiDR3RdIEb5CBESt2wgQJI0Yx/Agphg1MgNsD+QkszM9wHVPx/PeQOW+fmcR9DF8+4CyCJhCuP8 fDzmBbLqs8JzMODqYNfDvKhoGYM2lDosy5jlRozccRAgrPM8iygQS3Mv87IugUgKlC7NZ6liuy4r uresVq5QuQAr09ZKEga8OkluyKXeQ6Bs3SrtqgC1pWLNqAfwDhBnB+sK8OrVL4D4h1B4zWPWhJhu gPUHKA5EwSMYUMsdQK+UKDhIOTSHeg+8HCoTOGtB/gwcl4mSdGybwXegPWhM/RHYKwchkckhUNMX 6j7ueQNScLbZZOPRxaADyO2UQCJpl7wbnE6gQ+ksWjpngxOwF1tF5ecP3R6KB+AQxPfHLncQ+nKw 06fhu68OTIfJ869eTtg22l+9zfwDK3mKl5BFHMYAAAAASUVORK5CYII=

On 20/07/10 17:56, Michael Lachmann wrote: Wow! Looks really amazing!

Who does the syntax-highlighting?

texmacs - thank goodness - I wasn't looking forward to implementing lstlistings from scratch!


Just a side-note:
One feature I always wished in literate programming was reverse-packing. So that you can create hello-world.c, then edit it, and then repack it to the original file. For that you probably need to add comments in the resulting file of which chunk generated which sections of the file.

I think about that from time to time. I notice the python folks are trying to do something about it for their stuff; but I generally edit the primary document and use a diff to help me reverse the changes by hand - it's required for me to annotate the changes in the document anyway.


thanks! Can't wait to try it out,

Real soon now, I hope.

Sam

Michael

On 20 Jul 2010, at 6:37PM, Sam Liddicott wrote:

At the end of this link: https://savannah.nongnu.org/task/download.php?file_id=21016 you will find a sample of literate programming on texmacs using a new stylesheet, based on the noweb style as used by me with Lyx and Latex.

* <label> in a code chunk generates reference text like" 2d line 3"
* each named chunk automatically generates a label that can be accessed like <chunk-reference|message-printf|1> (to get the first block named chunk-reference).
* line numbers are automatically continued between chunks of the same name

Now I just need to adapt my extraction tool (at new.fangled.org).

Features I intend to add to the texmacs stylesheet are:

* optional in-place expansion if referenced chunks (for illustrative purposes)
   [depends on me getting recursive expansion of document tree to insert new <item> at right point (for line numbering)]
* decoration of expanded referenced chunks using braces or over-braces
* parameterized chunks (use to write algorithms - sort of like poor-mans STL/generics)
* in-place expansion of parameters in parameterized chunks (for illustrative purposes)

To get this to work well I need to know how to read the results of <write|...|...>

I note that langle and rangle come out badly in html (literally langle and rangle) and not at all in text

Comments invited.

Sam
--
Sam's signature



--
Sam's signature



Archive powered by MHonArc 2.6.19.

Top of Page