Re: “Literate” python?

2019-11-30 Thread Berry, Charles
> On Nov 29, 2019, at 9:54 AM, Norman Walsh wrote: > > Hi, > > I’ve seen a couple of pointers recently to using Org mode and tangle > to write more literate Emacs configurations. I use Org+babel all the > time to write “interactive” documents, so I thought I’d try out tangle > from Org. > > I

Re: “Literate” python?

2019-11-29 Thread Norman Walsh
Diego Zamboni writes: > Hi Norm, > > As George said, the trick in this case is to use the =:noweb= and > =:noweb-ref= headers. The change is minimal from the script you > sent: Thanks. With your help (and Barry’s and George’s), I got over the initial hurdles. I wrote about it here: https://so.nwa

Re: “Literate” python?

2019-11-29 Thread Diego Zamboni
Hi Norm, As George said, the trick in this case is to use the =:noweb= and =:noweb-ref= headers. The change is minimal from the script you sent: #+TITLE: Python literate programming #+OPTIONS: html-postamble:nil It starts off as a completely standard Python3 program. #+BEGIN_SRC python :tangle

Re: “Literate” python?

2019-11-29 Thread Norman Walsh
George Mauer writes: > I've used noweb references to actually assemble what will be tangled > all at once. See how I did it here. Thanks. > Also I'm pretty sure there's no :weave header arg...at least I > haven't seen it used and can't find it documented anywhere. No, that was just me guessing.

Re: “Literate” python?

2019-11-29 Thread Norman Walsh
"Berry, Charles" writes: > A couple of things might help. > > First, use the :noweb-ref argument to mark each of the code blocks > you wish to tangle. […] > The remaining problem (as you will see) is the indentation. Fix this > by adding the `-i' flag to the penultimate code block, viz. […] > See

Re: “Literate” python?

2019-11-29 Thread George Mauer
I've used noweb references to actually assemble what will be tangled all at once. See how I did it here . The reason why the "incorrect" block is outdented is that tangle automatically tries to guess indentation level. (

“Literate” python?

2019-11-29 Thread Norman Walsh
Hi, I’ve seen a couple of pointers recently to using Org mode and tangle to write more literate Emacs configurations. I use Org+babel all the time to write “interactive” documents, so I thought I’d try out tangle from Org. I didn’t want to start with something as comlicated as my Emacs config :-)