diff options
Diffstat (limited to 'pkgs/simple')
| -rw-r--r-- | pkgs/simple/cgit-about-filter/cgit-about-filter.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/simple/cgit-about-filter/cgit-about-filter.lua b/pkgs/simple/cgit-about-filter/cgit-about-filter.lua index 86468f5..d4f441a 100644 --- a/pkgs/simple/cgit-about-filter/cgit-about-filter.lua +++ b/pkgs/simple/cgit-about-filter/cgit-about-filter.lua @@ -66,6 +66,36 @@ local function md2html(markdown) return output end +local table_style = [[ +<style> +div#cgit div#summary table { + width: 100%; + table-layout: fixed; + margin: 1em 0; + border-collapse: collapse; +} +div#cgit div#summary th, +div#cgit div#summary td { + padding: 0.35em 0.6em; + text-align: left; + vertical-align: top; +} +div#cgit div#summary thead th { + border-bottom: 2px solid #888; +} +div#cgit div#summary tbody td { + border-bottom: 1px solid #ddd; +} +div#cgit div#summary tbody tr:nth-child(even) { + background: #f7f7f7; +} +div#cgit div#summary th + th, +div#cgit div#summary td + td { + border-left: 1px solid #eee; +} +</style> +]] + local buffer = "" local should_render = true local current_dir = "" -- Stores the directory prefix of the file being processed @@ -137,6 +167,9 @@ function filter_close() local output = md2html(processed) if output then + if output:find("<table>", 1, true) then + emit(table_style) + end emit(output) else emit("<p>Error: Could not execute md2html.</p>") |
