0.7.2 • Published 5 years ago

@pangrr/tangle v0.7.2

Weekly downloads
18
License
ISC
Repository
github
Last release
5 years ago

Do you enjoy those online tutorial posts? Do you want your program to also look like a tutorial?

You can program in markdown with code inside and use tangle to extract code from markdown files.

To get started creating your tutorial like program: 1. Think and write about key points. - Don't mind the completeness of your program. - Don't mind route works or boilerplates. - Usually you feel good to add some code (possibly as functions) to each of the core parts. - Don't mind where to put the code into code files. - After this process, you should feel 'That's mostly it!' and feel safe to take a break. 2. Think about appendix. - Exception handling. - Boring routes. - Boilerplates. 3. Mind where to put the code.

How to tangle?

Install NodeJS then npm install -g @pangrr/tangle.

Useage:

tangle <markdown_file_path> -d <save_code_directory> -w
tangle --help

Examples

tangle.ts is generated from tangle.md. But basically, tangle can turn the following markdown file

    My program will say hello world to you!
    ```js hello.js @mainLogic
    console.log('hello world!');
    ```

    It's better to create a module for others to use my program.
    ```js hello.js
    module.exports = () => {
      @mainLogic
    }
    ```

into hello.js

module.exports = () => {
  console.log('hello world!');
}

More examples!

Afterwords

This is inspired by literate programming and those online tutoial posts. But the goal is to improve experiece reading and writing programs (at least some species). So I don't strictly follow any classic literate programming decipline.

This project in under active experimentation against different programs.

If you are also interetest, it would be very helpful to drop a issue here.

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago