Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xiaq/poorweb

A poor man's literate programming tool
https://github.com/xiaq/poorweb

Last synced: 21 days ago
JSON representation

A poor man's literate programming tool

Awesome Lists containing this project

README

        

# A poor man's literate programming tool

Write your documentation and code in one file. Usage:

poorweb.py

# How it works

poorweb looks for code chunks enclosed by a line beginning with `>>` and a
line beginning with `<<`. It then collects those code chunks into the file
named after the starting `>>` (the name after `<<` is ignored). When no file
is named, it collects them into the default code file.

# An example

Write the following in `hello.web`:

\documentclass{article}
\begin{document}
Hello world in \textsf{Python}:

>>
print 'Hello world!'
<<

Hello world in \textsf{PHP}:

>>hello.php

<>
print 'Hello world again!'
<<
\end{document}

Run:

python twoweb.py hello.web hello.tex hello.py

`hello.php`, which is named in the source, will also be created.