summaryrefslogtreecommitdiffstatshomepage
path: root/html.c
Commit message (Expand)AuthorAge
* Print an error if filename is not found in html_include.Harley Laue2008-04-29
* Merge branch 'lh/cleanup'Lars Hjemli2008-04-08
|\
| * Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()Lars Hjemli2008-04-08
| * Introduce html.hLars Hjemli2008-03-18
* | Merge branch 'stable'Lars Hjemli2008-02-23
|\ \ | |/ |/|
| * Fix segfaultHiroki Hattori2008-02-23
* | Fix html error detected by test-suiteLars Hjemli2007-11-11
|/
* Add html_option() functionLars Hjemli2007-10-28
* Rename dirlink to gitlink.Jeffrey C. Ollie2007-06-04
* Add html_include()Lars Hjemli2007-05-18
* Add submodule links in tree listingLars Hjemli2007-05-11
* Add generic support for search box in page headerLars Hjemli2006-12-28
* Test for NULL-pointers in html_txt() and friendsLars Hjemli2006-12-28
* Only show first 80 characters of commit subject in log and summaryLars Hjemli2006-12-22
* Show list of modified files in ui-commit.cLars Hjemli2006-12-17
* Add license file and copyright noticesLars Hjemli2006-12-10
* Add caching infrastructureLars Hjemli2006-12-10
* Import cgit prototype from git treeLars Hjemli2006-12-09
lor: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh
# This script can be used to implement syntax highlighting in the cgit
# tree-view by refering to this file with the source-filter or repo.source-
# filter options in cgitrc.
#
# This script requires a shell supporting the ${var##pattern} syntax.
# It is supported by at least dash and bash, however busybox environments
# might have to use an external call to sed instead.
#
# Note: the highlight command (http://www.andre-simon.de/) uses css for syntax
# highlighting, so you'll probably want something like the following included
# in your css file (generated by highlight 2.4.8 and adapted for cgit):
#
# table.blob .num  { color:#2928ff; }
# table.blob .esc  { color:#ff00ff; }
# table.blob .str  { color:#ff0000; }
# table.blob .dstr { color:#818100; }
# table.blob .slc  { color:#838183; font-style:italic; }
# table.blob .com  { color:#838183; font-style:italic; }
# table.blob .dir  { color:#008200; }
# table.blob .sym  { color:#000000; }
# table.blob .kwa  { color:#000000; font-weight:bold; }
# table.blob .kwb  { color:#830000; }
# table.blob .kwc  { color:#000000; font-weight:bold; }
# table.blob .kwd  { color:#010181; }

# store filename and extension in local vars
BASENAME="$1"
EXTENSION="${BASENAME##*.}"

# map Makefile and Makefile.* to .mk
[ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk

exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null