GithubHelp home page GithubHelp logo

happy-ferret / literate-programming Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jostylr/literate-programming

0.0 2.0 0.0 1.12 MB

Creating programs from Markdown code blocks

License: MIT License

JavaScript 41.36% HTML 57.85% CSS 0.79%

literate-programming's Introduction

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

literate-programming's People

Contributors

adamnbowen avatar erossignon avatar jostylr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.