diff options
author | Lars Hjemli | 2011-05-23 23:28:38 +0200 |
---|---|---|
committer | Lars Hjemli | 2011-05-23 23:28:38 +0200 |
commit | ab350a77b1d3b0e251cc28329f2e16f0566e521e (patch) | |
tree | 1af2b0760858fcd87ce1e628465f9b60af7815e3 /cgitrc.5.txt | |
parent | 652a5a18db3b0409fedfaf8c5720446d87628ba0 (diff) | |
parent | c2b58ed8539fcfa4f05cc9da316bbc782f4b8f10 (diff) | |
download | cgit-ab350a77b1d3b0e251cc28329f2e16f0566e521e.tar.gz cgit-ab350a77b1d3b0e251cc28329f2e16f0566e521e.tar.bz2 cgit-ab350a77b1d3b0e251cc28329f2e16f0566e521e.zip |
Merge branch 'fh/filter-api'
Conflicts:
cgit.c
Diffstat (limited to 'cgitrc.5.txt')
-rw-r--r-- | cgitrc.5.txt | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 875d51f..5903a93 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
@@ -31,7 +31,7 @@ about-filter:: | |||
31 | about pages (both top-level and for each repository). The command will | 31 | about pages (both top-level and for each repository). The command will |
32 | get the content of the about-file on its STDIN, and the STDOUT from the | 32 | get the content of the about-file on its STDIN, and the STDOUT from the |
33 | command will be included verbatim on the about page. Default value: | 33 | command will be included verbatim on the about page. Default value: |
34 | none. | 34 | none. See also: "FILTER API". |
35 | 35 | ||
36 | agefile:: | 36 | agefile:: |
37 | Specifies a path, relative to each repository path, which can be used | 37 | Specifies a path, relative to each repository path, which can be used |
@@ -81,6 +81,7 @@ commit-filter:: | |||
81 | The command will get the message on its STDIN, and the STDOUT from the | 81 | The command will get the message on its STDIN, and the STDOUT from the |
82 | command will be included verbatim as the commit message, i.e. this can | 82 | command will be included verbatim as the commit message, i.e. this can |
83 | be used to implement bugtracker integration. Default value: none. | 83 | be used to implement bugtracker integration. Default value: none. |
84 | See also: "FILTER API". | ||
84 | 85 | ||
85 | css:: | 86 | css:: |
86 | Url which specifies the css document to include in all cgit pages. | 87 | Url which specifies the css document to include in all cgit pages. |
@@ -323,7 +324,7 @@ source-filter:: | |||
323 | and the name of the blob as its only command line argument. The STDOUT | 324 | and the name of the blob as its only command line argument. The STDOUT |
324 | from the command will be included verbatim as the blob contents, i.e. | 325 | from the command will be included verbatim as the blob contents, i.e. |
325 | this can be used to implement e.g. syntax highlighting. Default value: | 326 | this can be used to implement e.g. syntax highlighting. Default value: |
326 | none. | 327 | none. See also: "FILTER API". |
327 | 328 | ||
328 | summary-branches:: | 329 | summary-branches:: |
329 | Specifies the number of branches to display in the repository "summary" | 330 | Specifies the number of branches to display in the repository "summary" |
@@ -356,7 +357,7 @@ REPOSITORY SETTINGS | |||
356 | ------------------- | 357 | ------------------- |
357 | repo.about-filter:: | 358 | repo.about-filter:: |
358 | Override the default about-filter. Default value: none. See also: | 359 | Override the default about-filter. Default value: none. See also: |
359 | "enable-filter-overrides". | 360 | "enable-filter-overrides". See also: "FILTER API". |
360 | 361 | ||
361 | repo.clone-url:: | 362 | repo.clone-url:: |
362 | A list of space-separated urls which can be used to clone this repo. | 363 | A list of space-separated urls which can be used to clone this repo. |
@@ -364,7 +365,7 @@ repo.clone-url:: | |||
364 | 365 | ||
365 | repo.commit-filter:: | 366 | repo.commit-filter:: |
366 | Override the default commit-filter. Default value: none. See also: | 367 | Override the default commit-filter. Default value: none. See also: |
367 | "enable-filter-overrides". | 368 | "enable-filter-overrides". See also: "FILTER API". |
368 | 369 | ||
369 | repo.defbranch:: | 370 | repo.defbranch:: |
370 | The name of the default branch for this repository. If no such branch | 371 | The name of the default branch for this repository. If no such branch |
@@ -435,7 +436,7 @@ repo.section:: | |||
435 | 436 | ||
436 | repo.source-filter:: | 437 | repo.source-filter:: |
437 | Override the default source-filter. Default value: none. See also: | 438 | Override the default source-filter. Default value: none. See also: |
438 | "enable-filter-overrides". | 439 | "enable-filter-overrides". See also: "FILTER API". |
439 | 440 | ||
440 | repo.url:: | 441 | repo.url:: |
441 | The relative url used to access the repository. This must be the first | 442 | The relative url used to access the repository. This must be the first |
@@ -455,6 +456,42 @@ Note: the "repo." prefix is dropped from the option names in repo-specific | |||
455 | config files, e.g. "repo.desc" becomes "desc". | 456 | config files, e.g. "repo.desc" becomes "desc". |
456 | 457 | ||
457 | 458 | ||
459 | FILTER API | ||
460 | ---------- | ||
461 | - about filter:: | ||
462 | This filter is given no arguments. | ||
463 | The about text that is to be filtered is available on standard input and the | ||
464 | filtered text is expected on standard output. | ||
465 | - commit filter:: | ||
466 | This filter is given no arguments. | ||
467 | The commit message text that is to be filtered is available on standard input | ||
468 | and the filtered text is expected on standard output. | ||
469 | - source filter:: | ||
470 | This filter is given a single parameter: the filename of the source file to | ||
471 | filter. The filter can use the filename to determine (for example) the syntax | ||
472 | highlighting mode. | ||
473 | The contents of the source file that is to be filtered is available on | ||
474 | standard input and the filtered contents is expected on standard output. | ||
475 | |||
476 | Also, all filters are handed the following environment variables: | ||
477 | - CGIT_REPO_URL ( = repo.url setting ) | ||
478 | - CGIT_REPO_NAME ( = repo.name setting ) | ||
479 | - CGIT_REPO_PATH ( = repo.path setting ) | ||
480 | - CGIT_REPO_OWNER ( = repo.owner setting ) | ||
481 | - CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) | ||
482 | - CGIT_REPO_SECTION ( = section setting ) | ||
483 | - CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) | ||
484 | |||
485 | If a setting is not defined for a repository and the corresponding global | ||
486 | setting is also not defined (if applicable), then the corresponding | ||
487 | environment variable will be an empty string. | ||
488 | |||
489 | Note that under normal circumstance all these environment variables are | ||
490 | defined. If however the total size of the defined settings exceed the | ||
491 | allocated buffer within cgit then only the environment variables that fit | ||
492 | in the allocated buffer are handed to the filter. | ||
493 | |||
494 | |||
458 | EXAMPLE CGITRC FILE | 495 | EXAMPLE CGITRC FILE |
459 | ------------------- | 496 | ------------------- |
460 | 497 | ||