Skip to content
Creating programs from Markdown code blocks
HTML JavaScript CSS
Branch: master
Clone or download
jostylr v1.0.0 This updates to v2.0.0 of the library. It removes augments, ad…
…ds in mapc, adds in better log formatting and options. There will be still some more stuff added to this but hopefully nothing changed or taken away of the syntax.
Latest commit e5122dc Feb 26, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests v1.0.0 This updates to v2.0.0 of the library. It removes augments, ad… Feb 26, 2017
.gitignore v0.9.0 Major change. Completely new engine, some syntax changes. Old … Jan 1, 2017
.npmignore v0.9.0 Major change. Completely new engine, some syntax changes. Old … Jan 1, 2017
.travis.yml
LICENSE v0.9.0 Major change. Completely new engine, some syntax changes. Old … Jan 1, 2017
README.md v0.9.4 updated cli to v1.0.3 from adding the z command. Also reworked… Jan 8, 2017
convert.md v0.9.0 Major change. Completely new engine, some syntax changes. Old … Jan 1, 2017
documentation.md added html encode/decode library he Jan 16, 2017
index.js v1.0.0 This updates to v2.0.0 of the library. It removes augments, ad… Feb 26, 2017
lprc.js v1.0.0 This updates to v2.0.0 of the library. It removes augments, ad… Feb 26, 2017
package.json v1.0.0 This updates to v2.0.0 of the library. It removes augments, ad… Feb 26, 2017
project.md v1.0.0 This updates to v2.0.0 of the library. It removes augments, ad… Feb 26, 2017
setup.md v1.0.0 This updates to v2.0.0 of the library. It removes augments, ad… Feb 26, 2017
test.js

README.md

literate-programming Build Status

This is the fat command-line client for literate-programming-lib. It contains the full functionality for literate programming, including useful commands such as jshint included in it. For a thin client, check out litpro

Full documentation: Literate Programming, MD: How to Treat and Prevent Software Project Mess

This is not done being fully baked, hence v0.9. But this does represent a significant break from 0.8.4. You can take a look at convert.md for some observations of mine as I converted from the old version to the new.

Install using npm install literate-programming

Usage is ./node_modules/bin/litpro file and it has some command flags.

If you want a global install so that you just need to write literate-programming then use npm install -g literate-programming.

The library has a full listing of the syntax, commands, and directives. Here we list the flags and new commands and directives.

Example usage

Save the following code to file project.md and run literate-programming project.md.

# Welcome

So you want to make a literate program? Let's have a program that outputs
all numbers between 1 to 10.

Let's save it in file count.js

[count.js](#Structure "save: | jshint")

## Structure 

We have some intial setup. Then we will generate the array of numbers. We
end with outputting the numbers. 

    var numarr = [], start=1, end = 11, step = 1;

    _"Loop"

    _"Output"

## Output 

At this point, we have the array of numbers. Now we can join them with a
comma and output that to the console.

    console.log("The numbers are: ", numarr.join(", ") );

## Loop

Set the loop up and push the numbers onto it. 

    var i;
    for (i = start; i < end; i += step) {
        numarr.push(i);
    }

Documentation

For more information, see the documentation book which is free to read online or available for purchase as a PDF.

Some particularly useful syntax sections are:

Use and Security

It is inherently unsecure to compile literate program documents. No effort has been made to make it secure. Compiling a literate program using this program is equivalent to running arbitrary code on your computer. Only compile from trusted sources, i.e., use the same precautions as running a node module.

LICENSE

MIT-LICENSE

You can’t perform that action at this time.