diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-01-13 22:18:51 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-01-14 10:00:07 (JST) |
commit | f43b228d0bca5791be98ff3fbb2f8743219635b6 (patch) | |
tree | 2200619d48fd24f5e809736ff94c84a57da4481f /cgitrc.5.txt | |
parent | e83b51b4f6bd53efea0c772e6ecdf1c5605ca611 (diff) | |
download | cgit-f43b228d0bca5791be98ff3fbb2f8743219635b6.zip cgit-f43b228d0bca5791be98ff3fbb2f8743219635b6.tar.gz |
filter: add lua support
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'cgitrc.5.txt')
-rw-r--r-- | cgitrc.5.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 60159f6..78f33c8 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
@@ -564,6 +564,35 @@ specification with the relevant string; available values are: | |||
564 | 'exec:':: | 564 | 'exec:':: |
565 | The default "one process per filter" mode. | 565 | The default "one process per filter" mode. |
566 | 566 | ||
567 | 'lua:':: | ||
568 | Executes the script using a built-in Lua interpreter. The script is | ||
569 | loaded once per execution of cgit, and may be called multiple times | ||
570 | during cgit's lifetime, making it a good choice for repeated filters | ||
571 | such as the 'email filter'. It responds to three functions: | ||
572 | |||
573 | 'filter_open(argument1, argument2, argument3, ...)':: | ||
574 | This is called upon activation of the filter for a particular | ||
575 | set of data. | ||
576 | 'filter_write(buffer)':: | ||
577 | This is called whenever cgit writes data to the webpage. | ||
578 | 'filter_close()':: | ||
579 | This is called when the current filtering operation is | ||
580 | completed. | ||
581 | |||
582 | Additionally, cgit exposes to the Lua the following built-in functions: | ||
583 | |||
584 | 'html(str)':: | ||
585 | Writes 'str' to the webpage. | ||
586 | 'html_txt(str)':: | ||
587 | HTML escapes and writes 'str' to the webpage. | ||
588 | 'html_attr(str)':: | ||
589 | HTML escapes for an attribute and writes "str' to the webpage. | ||
590 | 'html_url_path(str)':: | ||
591 | URL escapes for a path and writes 'str' to the webpage. | ||
592 | 'html_url_arg(str)':: | ||
593 | URL escapes for an argument and writes 'str' to the webpage. | ||
594 | |||
595 | |||
567 | Parameters are provided to filters as follows. | 596 | Parameters are provided to filters as follows. |
568 | 597 | ||
569 | about filter:: | 598 | about filter:: |