Questions tagged [noweb]

noweb is a literate programming tool for a variety of languages.

noweb is a literate programming tool written by Norman Ramsey which works for a variety of programming languages. It is a modern alternative to programs like Knuth's CWEB.

noweb takes a single specially formatted file, and generates both code and documentation; in this sense, it is kind of like the reverse of a Javadoc - instead of embedding documentation inside code, noweb embeds code inside documentation. Since "chunks" of code are named, code can even be reordered and repeated.

The documentation parts can be in LaTeX or HTML so that printed output or web pages can be generated from noweb input. noweb is language independent, so it can process any programming language (since noweb respects indentation, it can even process languages like Python and Haskell, and produce valid output).

See Nweb's Home Page for more information and downloads; Wikipedia contains a good example of what noweb's format looks like and how to generate code and documentation from it.

This tag should be used for questions about how to use the noweb program.

35 questions
3
votes
1 answer

Emacs polymode for Markdown and Python

I use the python3 pweave library (http://mpastell.com/pweave/usage.html) for literate programming. pweave uses as text mode markdown, as code mode python3, and it is possible to use noweb (https://en.wikipedia.org/wiki/Noweb) literate programming…
bue
  • 333
  • 2
  • 12
3
votes
1 answer

"$" symbol in a code chunk of noweb (literate programming) file

I have following javascript code inside a code chunk of a noweb (i.e., .nw) file: <>= $("span").tooltip({ tip: 'tooltip', predelay: 30, delay: 3000, onShow: function(){} }); @ The generated javascript code is correct. But…
2
votes
2 answers

LyXliteral programming

I keep writing codes in gedit but at the end of the week we need to submit a lyx literal programming file. Copying and pasting or importing is painful, since , we need to keep pressing tabs or enters. Can anyone suggest a simple alternative to this?…
Vishwanath
  • 835
  • 1
  • 7
  • 19
2
votes
3 answers

How do I identify which Sweave code chunk gives an error?

When running Sweave from emacs-ess, errors are provided with a code chunk number. Is there an easy way to navigate among the code chunks by number? Otherwise, they are difficult to identify.
David LeBauer
  • 31,011
  • 31
  • 115
  • 189
2
votes
1 answer

Any way to make org-babel properly indent noweb tangled code?

Tangling this: #+BEGIN_SRC C :tangle no :noweb-ref begin int main() { printf("Line 1\n"); #+END_SRC #+BEGIN_SRC C :tangle no :noweb-ref middle printf("Second\n"); #+END_SRC #+BEGIN_SRC C :tangle no :noweb-ref end } #+END_SRC #+BEGIN_SRC C…
William Everett
  • 751
  • 1
  • 8
  • 18
2
votes
2 answers

using scons for literate programming

Using noweb, I would either like to generate a document file (or a source file) from a noweb input file **.nw From hand I would do something like that: notangle my_program.nw > my_program.cpp g++ -c my_program.o my_program.cpp ln -o myapp ...…
Leonard7E
  • 75
  • 5
2
votes
1 answer

Undefined control sequence in a NOWEB document (\nwstartdeflinemarkup)

In a document NOWEB compiled with the following command noweave -tex -filter "elide comment:*" adocument.nw > documentation.tex and trying to compile the resulting file with the command xetex -halt-on-error documentation.tex I got the following…
1
vote
1 answer

Can noweb create traversable links in latex like it does in HTML?

When you generate html documents with noweb each chunk of code can be clicked when referenced elsewhere and you can jump to this definition but I'm not able to get the same functionality with the generated Latex document. Can the generated latex…
tonicebrian
  • 4,715
  • 5
  • 41
  • 65
1
vote
1 answer

What's the safe, easy way to install noweb on Windows 10?

Apparently there's only one person that managed to do it. I'm following his installations step by step precisely, but I do not have the iconc compiler. Following the instructions of the Makefile, I'm using icont (which I do have), but then Jim's…
user9654148
  • 125
  • 7
1
vote
0 answers

Unwanted asterisks appearing in noweb html output

I'm getting asterisks appearing before each documentation section in my noweb html output (even before the html doctype!) when running noweave -html -index -n hello.nw > hello.htm given the following hello.nw file:
Luka Aleksić
  • 347
  • 2
  • 10
1
vote
2 answers

How to write homebrew formula that keep their files in the Cellar?

I'm trying to write a formula for the Icon programming language (necessary for noweb), but its binary distribution contains TONS of files (almost 1000) in the lib/ directory. I'd like to leave them out of the symlink-to-/usr/local/lib process since…
Will Robertson
  • 62,540
  • 32
  • 99
  • 117
1
vote
0 answers

How Does One Handle Identical Method Names when Using Literate Programming?

I would like to use a literate programming tool to write a python program. My tool of choice is noweb. My IDE is emacs. The problem I have is that I have classes with identical method names. For example, the python program implements web service…
1
vote
1 answer

Unwanted question marks in noweb output

I have the following noweb file, titled test \documentclass{article} \usepackage{noweb} \begin{document} \section{Hello World} This is a program <>= print("Hello, world!") @ \end{document} I type the following commands: pdflatex…
user2201041
1
vote
1 answer

emacs, auctex, noweb-mode - how to keep screen from recentering around point?

When in auctex and noweb-mode (using Sweave in emacs), I find it distracting when the screen recenters itself as I use next-line, previous-line, etc. (C-n, C-p, and mouse-1). Does anyone know how to turn it off? Thanks much!
hatmatrix
  • 42,883
  • 45
  • 137
  • 231
1
vote
1 answer

Chunk arguments for noweb

In nuweb, I can do something like this @d Define the chunk with argument echo "Hello, @1"; Then I can use it in other chunks by passing arguments: @d Second chunk @ It will generate the following line: echo…
SPIRiT_1984
  • 2,717
  • 3
  • 29
  • 46