]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwText.pm
$INBOX/_/text/color/ and sample user-side CSS
[public-inbox.git] / lib / PublicInbox / WwwText.pm
index b0f262cd08d823af81944b5484b63d849c913570..d3413ad72862d557511952a7867484cc3cfb5a79 100644 (file)
@@ -1,7 +1,7 @@
-# Copyright (C) 2016 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-#
-# serves the /$INBOX/_/* endpoints from :text/* of the git tree
+
+# used for displaying help texts and other non-mail content
 package PublicInbox::WwwText;
 use strict;
 use warnings;
@@ -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};
@@ -182,6 +217,10 @@ message threading
        $WIKI_URL/Atom_(standard)
        https://tools.ietf.org/html/rfc4287
 
+      Atom Threading Extensions (RFC4685) is supported:
+
+       https://tools.ietf.org/html/rfc4685
+
     Finally, the gzipped mbox for a thread is available for
     downloading and importing into your favorite mail client: