X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/61ff10065b579fa38182fcf10cc7e63839acd53c..f43b228d0bca5791be98ff3fbb2f8743219635b6:/cgitrc.5.txt diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 9d0c089..78f33c8 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -39,7 +39,8 @@ agefile:: to specify the date and time of the youngest commit in the repository. The first line in the file is used as input to the "parse_date" function in libgit. Recommended timestamp-format is "yyyy-mm-dd - hh:mm:ss". Default value: "info/web/last-modified". + hh:mm:ss". You may want to generate this file from a post-receive + hook. Default value: "info/web/last-modified". branch-sort:: Flag which, when set to "age", enables date ordering in the branch ref @@ -132,8 +133,9 @@ enable-filter-overrides:: enable-http-clone:: If set to "1", cgit will act as an dumb HTTP endpoint for git clones. - If you use an alternate way of serving git repositories, you may wish - to disable this. Default value: "1". + You can add "http://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL" to clone-url + to expose this feature. If you use an alternate way of serving git + repositories, you may wish to disable this. Default value: "1". enable-index-links:: Flag which, when set to "1", will make cgit generate extra links for @@ -175,7 +177,7 @@ enable-git-config:: "scan-path", and must be defined prior, to augment repo-specific settings. The keys gitweb.owner, gitweb.category, and gitweb.description will map to the cgit keys repo.owner, repo.section, and repo.desc, - respectivly. All git config keys that begin with "cgit." will be mapped + respectively. All git config keys that begin with "cgit." will be mapped to the corresponding "repo." key in cgit. Default value: "0". See also: scan-path, section-from-path. @@ -283,7 +285,7 @@ nocache:: value: "0". noplainemail:: - If set to "1" showing full author email adresses will be disabled. + If set to "1" showing full author email addresses will be disabled. Default value: "0". noheader:: @@ -555,6 +557,44 @@ config files, e.g. "repo.desc" becomes "desc". FILTER API ---------- +By default, filters are separate processes that are executed each time they +are needed. Alternative technologies may be used by prefixing the filter +specification with the relevant string; available values are: + +'exec:':: + The default "one process per filter" mode. + +'lua:':: + Executes the script using a built-in Lua interpreter. The script is + loaded once per execution of cgit, and may be called multiple times + during cgit's lifetime, making it a good choice for repeated filters + such as the 'email filter'. It responds to three functions: + + 'filter_open(argument1, argument2, argument3, ...)':: + This is called upon activation of the filter for a particular + set of data. + 'filter_write(buffer)':: + This is called whenever cgit writes data to the webpage. + 'filter_close()':: + This is called when the current filtering operation is + completed. + + Additionally, cgit exposes to the Lua the following built-in functions: + + 'html(str)':: + Writes 'str' to the webpage. + 'html_txt(str)':: + HTML escapes and writes 'str' to the webpage. + 'html_attr(str)':: + HTML escapes for an attribute and writes "str' to the webpage. + 'html_url_path(str)':: + URL escapes for a path and writes 'str' to the webpage. + 'html_url_arg(str)':: + URL escapes for an argument and writes 'str' to the webpage. + + +Parameters are provided to filters as follows. + about filter:: This filter is given a single parameter: the filename of the source file to filter. The filter can use the filename to determine (for @@ -591,8 +631,8 @@ environment variable will be unset. MACRO EXPANSION --------------- -The following cgitrc options supports a simple macro expansion feature, -where tokens prefixed with "$" are replaced with the value of a similary +The following cgitrc options support a simple macro expansion feature, +where tokens prefixed with "$" are replaced with the value of a similarly named environment variable: - cache-root @@ -619,7 +659,7 @@ EXAMPLE CGITRC FILE ------------------- .... -# Enable caching of up to 1000 output entriess +# Enable caching of up to 1000 output entries cache-size=1000 @@ -635,7 +675,7 @@ enable-index-owner=1 # Allow http transport git clone -enable-git-clone=1 +enable-http-clone=1 # Show extra links for each repository on the index page @@ -699,7 +739,7 @@ mimetype.png=image/png mimetype.svg=image/svg+xml -# Highlight source code with python pygments-based highligher +# Highlight source code with python pygments-based highlighter source-filter=/var/www/cgit/filters/syntax-highlighting.py # Format markdown, restructuredtext, manpages, text files, and html files