Skip to content

cvdlab/larlib-literate

Repository files navigation

larlib-literate

Literate programming approach (with nuweb) for LAR in Julia. This is the development repo for the LARLIB.jl package. If you are looking only for the LARLIB.jl package, this is not the right place.

How to contribute

Here a quick start for the people who contribute to a literate programming project for the first time:

  1. Fork this repo

  2. Put your Julia code inside a LaTEX file called ch_<name>.tex in the src/pkg/tex/ folder. The barebone structure of this file must be:

\chapter{<fancy name>}
\label{ch:<name>}

@O lib/jl/<name>.jl
@{<Julia code>
@}

@O test/jl/<name>.jl
@{using Base.Test
using LARLIB
<Julia unit tests>
@}

(refer to src/pkg/tex/ch_planar_arrangement.tex for a well structured LaTEX+nuweb file)

  1. Modify src/pkg/tex/intro.tex by appending to it a LaTEX chapter with the high-level description of the algorithm you implemented.

  2. Add the line \input{ch_<name>.tex} right before \input{ch_utilities.tex} inside src/pkg/tex/book.tex.

  3. Add the line include("./<name>.jl") anywhere inside the @O lib/jl/LARLIB.jl nuweb macro defined at the beginning of src/pkg/tex/ch_larlib.tex.

  4. Add the line include("./<name>.jl") anywhere inside the @O test/jl/runtests.jl nuweb macro defined at the bottom of src/pkg/tex/ch_larlib.tex.

  5. Do a pull request. If it gets accepted, we will take care of the insertion of your contribution inside the LARLIB.jl package repo.

Makefile Usage

make all generates Julia scripts and pdf docs of LARLIB and its test units.
make lib_code generates only the scripts and the tests.
make lib_pdf generates the pdf docs and the scripts and tests.

Docker

You can use the previous build commands prepending docker- so that, e.g. make all becomes make docker-all, to use a docker image that contains everything to perform the building.