You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
chee rabbits 8c929db2a3
add a basic noweb impl
11 months ago
bin add a trailing newly to errors 11 months ago
src add a basic noweb impl 11 months ago
test/integration-tests add a basic noweb impl 11 months ago
.gitignore initial commit 11 months ago
package-lock.json update deps 11 months ago
package.json add a basic noweb impl 11 months ago
readme.md add a basic noweb impl 11 months ago
tsconfig.json initial commit 11 months ago
yarn.lock update deps 11 months ago

readme.md

lima

lima is the minimal implementation of literate markdown.

tangle

$ lima tangle file.md

options

the syntax is inspired by org-mode.

# welcome to my file

here is some code:

	```c++ filename="main.cc", name="sum"
	auto sum (std::vector<int> numbers) {
		int result = 0;
		for (auto i : numbers) {
			result += i;
		}
		return result;
	 }
	 ```

have a look in ./test/integration-tests/sum to see this example

you see the option is passed in the info string after the file type.

noweb

you can perform replacements with a syntax inspired by knuth's noweb

if you give a block a name (rather than a filename), you can refer to it in a later block and have it included.

have a look in ./test/integration-tests/noweb for an example

valid options

option type info implemented?
filename string required for the block to be tangled, but optional 👍
chmod number (interpreted as octal) the mode the file should have 👍
shebang string the shebang to put at the top of the file. if chmod is unset, this will set the executable bit 👍
name string a name for this codeblock 👍
chown string or number the user name or id the file should have no
chgrp string or number the group name or id the file should have no
sudo bool if the file should be written as root no
if string an environment variable that must be present for the file to be written no
unless string an environment variable that must not be present for the file to be written no

weave

lima markdown files are valid commonmark, any markdown renderer that support fenced code blocks should be able to be used as weavers.

there is room for a future lima weave sub-command allowing more exciting things to happen.

todo

  • add a weave
  • maybe add noweb variable syntax [[m = 1000]]
  • investigate some way of declaring dictionaries
  • add the ability to execute codeblocks during tangle and weave
  • add library-of-babel-like functions