Questions tagged [literate-programming]

A literate program embeds source code in an essay documenting the program.

Literate programming was introduced by Donald Knuth as an alternative to the structured programming. Literate programming encourages programmers to structure their programs by the flow of their thoughts, i.e., in a way that makes it easy to present and document.

158 questions
13
votes
3 answers

sweave and ggplot2: no pdfs generated at all

I am trying create a sweave report that contains some graphics done with ggplot2. Though I am looking for some environment for the long run – I just use a simple .Rnw file here that only contains the code and the plot …
Matt Bannert
  • 27,631
  • 38
  • 141
  • 207
12
votes
10 answers

Literate programming

Literate programming is a way of developing software where documentation comes first, then the coding. One writes the documentation of a code snippet, and then writes the implementation of the snippet. The visual appearance of the software source…
user29688
  • 328
  • 2
  • 11
12
votes
8 answers

Literate Coding Vs. std::pair, solutions?

As most programmers I admire and try to follow the principles of Literate programming, but in C++ I routinely find myself using std::pair, for a gazillion common tasks. But std::pair is, IMHO, a vile enemy of literate programming... My point is when…
Robert Gould
  • 68,773
  • 61
  • 187
  • 272
11
votes
1 answer

Make the source code from one code block the input to another code block in Emacs org-mode

I'm getting started with org-mode and there's something I'd like to do that seems like it should be possible, but I'm having trouble figuring out. Let me describe the scenario: I have some SQL code that I want to execute on a remote server. I…
John Horton
  • 4,122
  • 6
  • 31
  • 45
11
votes
3 answers

What is legal Literate Haskell? Formal Syntax somewhere?

Someone had a great idea of combining Literate Haskell and Markdown. Made sense to me, so I wanted to try it. But there is something Haskell doesn't like about the Markdown '#' header syntax: Hello World > main = putStrLn "hello,…
Anm
  • 3,291
  • 2
  • 29
  • 40
11
votes
1 answer

Is there a way to knitr and produce .rmd files using the external tools function of the StatET Eclipse plugin?

I'm becoming a fan of reproducible analyses and of Sweave, Beamer and specially of the knitr package. RStudio allows to Sweave and knit documents with just one click, but although RStudio is easy to install, it is quite unstable and does not have…
rogervv
  • 111
  • 4
10
votes
1 answer

Put result of code right below the code in resulting PDF. Haskell

Is there any way to execute code in a .lhs file and put the result right below the code itself in the resulting PDF? For example: [1,2,3] ++ [4,5,6] [1,2,3,4,5,6]
Jcao02
  • 794
  • 8
  • 24
9
votes
2 answers

Is there a way to customize output of Doxygen index.html (and latex equivalent)?

I am interested in writing an "introduction" on the index.html page, rather than have blank space. Is this a feature supported by the Doxygen tool, or must I put together a hack?
Setjmp
  • 27,279
  • 27
  • 74
  • 92
9
votes
2 answers

Setting HTML meta elements with knitr

I'm generating HTML reports using knitr, and I'd like to include author and generation date meta tags. My Rhtml page looks something like this.
Richie Cotton
  • 118,240
  • 47
  • 247
  • 360
9
votes
3 answers

How can I hide code blocks in lhs2TeX?

I want to document my code using latex, but it's really annoying having all those modules and compiler extensions show up at the beginning of the latex document. Is there some flag I can pass to lhs2TeX to prevent it from displaying this section of…
Mike Izbicki
  • 6,286
  • 1
  • 23
  • 53
8
votes
5 answers

How do I Sweave a multiple-file project?

I am writing my thesis in LaTeX and because things got a bit long for my taste, I had split it into several files. Let's call them thesis.tex, intro.tex, mat_n_met.tex, rslts.tex and discsn.tex. I have linked intro.tex, mat_n_met.tex, rslts.tex and…
Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
8
votes
0 answers

Literate programming in intellij IDEA?

the problem is that we have very complex/complicated interactions which can't really be described as text, so we need images to illustrate it. So the question is, is there a plugin or some java friendly literate programming environment so we can…
Quonux
  • 2,975
  • 1
  • 24
  • 32
7
votes
2 answers

Converting literate Haskell (.lhs) to Haskell (.hs)

Is there an easy way to convert a literate Haskell file (.lhs) to a regular Haskell (.hs) source file? I thought there might be a GHC option, but the GHC manual doesn't seem to have much information on literate programs or the .lhs format. The word…
Tomer
  • 1,159
  • 7
  • 15
7
votes
2 answers

Interesting / well written unit tests to read (literate programming)

Do you know any open software projects that had particularly interesting / well written unit tests ? Writing unit tests often feels odd to me, because it seems either too random, too dense, to sparse, .. It would be great to read some real world…
Jörg Haubrichs
  • 2,215
  • 3
  • 24
  • 26
7
votes
3 answers

Control indentation with Org–Babel

When writing literate Python with Org–Babel, I need to be able to control the indentation level (either explicitly with :indentation-level 3 or implicitly with some clever indication). Here's an example file that demonstrates the…
Sean Allred
  • 3,558
  • 3
  • 32
  • 71
1
2
3
10 11