about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwText.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-20 09:29:08 +0000
committerEric Wong <e@80x24.org>2019-01-20 09:29:08 +0000
commitc2d12f79e78eb4ea909cac6106880c0f41e8c5fd (patch)
tree57a48e120f597c520bfee2ef6be319f389607236 /lib/PublicInbox/WwwText.pm
parentf026dbdd392c9dd5fddbdad9a2240738d4956640 (diff)
downloadpublic-inbox-c2d12f79e78eb4ea909cac6106880c0f41e8c5fd.tar.gz
Since we now support more CSS classes for coloring,
give this feature more visibility.
Diffstat (limited to 'lib/PublicInbox/WwwText.pm')
-rw-r--r--lib/PublicInbox/WwwText.pm35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index b5874cf6..d3413ad7 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -88,9 +88,44 @@ sub _srch_prefix ($$) {
         1;
 }
 
+sub _colors_help ($$) {
+        my ($ctx, $txt) = @_;
+        my $ibx = $ctx->{-inbox};
+        my $base_url = $ibx->base_url($ctx->{env});
+        $$txt .= "color customization for $base_url\n";
+        $$txt .= <<EOF;
+
+public-inbox provides a stable set of CSS classes for users to
+customize colors for highlighting diffs and code.
+
+Users of browsers such as dillo, Firefox, or some browser
+extensions may start by downloading the following sample CSS file
+to control the colors they see:
+
+        ${base_url}userContent.css
+
+CSS classes
+-----------
+
+           span.q - quoted text in email messages
+
+For diff highlighting, we try to match class names with those
+used by cgit: https://git.zx2c4.com/cgit/
+
+         span.add - diff post-image lines
+
+         span.del - diff pre-image lines
+
+        span.head - diff header (metainformation)
+
+        span.hunk - diff hunk-header
+
+EOF
+}
 
 sub _default_text ($$$) {
         my ($ctx, $key, $txt) = @_;
+        return _colors_help($ctx, $txt) if $key eq 'color';
         return if $key ne 'help'; # TODO more keys?
 
         my $ibx = $ctx->{-inbox};