literate-programming

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

泄露秘密 提交于 2019-12-05 01:31:49
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 currently have a python script that takes SQL code as a string and does this for me. Without org-mode, my work flow would be to start with a file like so: echo "SELECT name, grade FROM students" >> basic_query.sql and then I'd run: $ python run_query.py basic_query.sql To do this is in the org-mode setting, I could create a code block for the SQL: #+NAME:

Literate programming

旧时模样 提交于 2019-12-05 00:49:25
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 code would be a plain document like word, with code paragraphs in it. I am trying to convert the dev shop I work to use only literate programming, as it brings great advantages to code readability and maintenance. However, due to the lack of tools the LP usage is limited in the company. For example, the ideal way to program literate is to write a

LHS and Markdown: Codeblocks

 ̄綄美尐妖づ 提交于 2019-12-04 17:06:22
问题 I happen to really like Markdown (probably because of SO) and I like programming in Haskell. I have recently discovered Literate Haskell (LHS) and I want to use Markdown and LHS together. Let me give you this dumb example: Crazy Literate Haskell ====================== This is an example of some literate Haskell Code: > module Main where Look at that IO Monad work: > main = return 2 >>= print Wasn't that cool? That is an example of a literate haskell file written to be parsed by Markdown later

LHS and Markdown: Codeblocks

╄→гoц情女王★ 提交于 2019-12-03 10:08:19
I happen to really like Markdown (probably because of SO) and I like programming in Haskell. I have recently discovered Literate Haskell (LHS) and I want to use Markdown and LHS together. Let me give you this dumb example: Crazy Literate Haskell ====================== This is an example of some literate Haskell Code: > module Main where Look at that IO Monad work: > main = return 2 >>= print Wasn't that cool? That is an example of a literate haskell file written to be parsed by Markdown later. However, I want the code to actually appear in html code blocks and without the > before them.

Sweave for python

六月ゝ 毕业季﹏ 提交于 2019-12-03 02:10:41
问题 I've recently started using Sweave* for creating reports of analyses run with R, and am now looking to do the same with my python scripts. I've found references to embedding python in Sweave docs, but that seems like a bit of a hack. Has anyone worked out a better solution, or is there an equivalent for python I'm not aware of? * Sweave is a tool that allows to embed the R code for complete data analyses in latex documents 回答1: I don't believe that there's a direct equivalent, so Romain