Personal tools

Literate programming/Bird conversion via sed

From HaskellWiki

< Literate programming(Difference between revisions)
Jump to: navigation, search
(Breaking out from main page of literate programming)
 
(fix missing slashes and provide some html)

Revision as of 12:38, 28 March 2008

# bird2code.sed
/^>/ !p
/^>/ {
  i\
\\begin{code}

  :loop
  N
  /\n>[^\n]*$/{
    b loop
  }
  s/^> //
  s/\(\n\)> /\1/g
  s/\n$//
  a\
\\end{code}\

  p
}

should be run as:

sed -nf bird2code.sed < code.lhs > code.tex