1 PublicInbox::WWW (PSGI interface) design notes
7 /$INBOX/?r=$GIT_COMMIT -> HTML only
8 /$INBOX/new.atom -> Atom feed
10 #### Optional, relies on Search::Xapian
11 /$INBOX/$MESSAGE_ID/t/ -> HTML content of thread (nested)
12 /$INBOX/$MESSAGE_ID/T/ -> HTML content of thread (flat)
14 #u location of $MESSAGE_ID in URL
15 #m<SHA-1> per-message links, where <SHA-1> is of the Message-ID
16 of each message (stable)
17 #s<NUM> relative numeric position of message in thread (unstable)
18 #i<...> diffstat location for patch emails
19 #Z?<...> per-file diff header location for patch emails
21 /$INBOX/$MESSAGE_ID/t.atom -> Atom feed for thread
22 /$INBOX/$MESSAGE_ID/t.mbox.gz -> gzipped mbox of thread
25 /$INBOX/$MESSAGE_ID/ -> HTML content
27 #r location of the current message in thread skeleton
28 (requires Xapian search)
29 #b start of the message body (linked from thread skeleton)
31 /$INBOX/$MESSAGE_ID -> 301 to /$INBOX/$MESSAGE_ID/
32 /$INBOX/$MESSAGE_ID/raw -> raw mbox
33 /$INBOX/$MESSAGE_ID/#R -> HTML reply instructions
35 # Covering up a pre-1.0 design mistake:
36 /$INBOX/$MESSAGE_ID/f/ -> 301 to /$INBOX/$MESSAGE_ID/
38 ### Legacy endpoints (may be ambiguous given Message-IDs with similar suffixes)
39 /$INBOX/m/$MESSAGE_ID/ -> 301 to /$INBOX/$MESSAGE_ID/
40 /$INBOX/m/$MESSAGE_ID.html -> 301 to /$INBOX/$MESSAGE_ID/
41 /$INBOX/m/$MESSAGE_ID.txt -> 301 to /$INBOX/$MESSAGE_ID/raw
42 /$INBOX/f/$MESSAGE_ID.html -> 301 to /$INBOX/$MESSAGE_ID/
43 /$INBOX/f/$MESSAGE_ID.txt [1] -> 301 to /$INBOX/$MESSAGE_ID/raw
45 /$INBOX/atom.xml [2] -> identical to /$INBOX/new.atom
47 Additionally, we support git clone/fetch over HTTP (dumb and smart):
49 git clone --mirror http://$HOSTNAME/$INBOX
51 FIXME: we must refactor/cleanup/add tests for most of our CGI before
52 adding more endpoints and features.
54 [1] These URLs were never linked, but only exist as a convenience to folks
55 who edit existing URLs
57 [2] Do not make this into a 301 since feed readers may not follow them as well
58 as normal browsers do.
63 Raw HTML and XML should only contain us-ascii characters which render
64 to UTF-8. We must not rely on users having the necessary fonts
65 installed to render uncommon characters.
67 Plain text (raw message) endpoints display in the original encoding(s)
68 of the original email.
70 Guidelines for using limited HTML
71 ---------------------------------
73 We mainly use HTML for linking pages together with <a>.
74 We also set <title> to make window management easier.
76 We favor <pre>-formatted text since public-inbox is intended as a place
77 to share and discuss patches and code. Unfortunately, long paragraphs
78 tends to be less readable with fixed-width serif fonts which GUI
81 * No graphics, images, or icons at all. We tolerate, but do not
82 encourage the use of GUIs.
84 * No setting font sizes, power to users to decide those.
85 We will include and document <span class=?> to support colors
86 for user-supplied CSS.
88 * Only one font type: fixed. This is for accessibility, we must
89 not blow certain elements out-of-proportion with different
90 fonts on the page when a reader increases font size.
92 * Bold and underline elements are OK since they should render fine
93 regardless of chosen font and gracefully degrade if a display does
94 not support them. Italics and strike-through elements must be
95 avoided as they do not render well with some displays or user-chosen
98 * No JavaScript. JS is historically too buggy and insecure, and we will
99 never expect our readers to do either of the following:
100 a) read and audit all our code for on every single page load
101 b) trust us and and run code without reading it
103 * We only use CSS for one reason: wrapping pre-formatted text
104 This is necessary because unfortunate GUI browsers tend to be
105 prone to layout widening from unwrapped mailers.
106 Do not expect CSS to be enabled, especially with scary things like:
108 https://thejh.net/misc/website-terminal-copy-paste
110 However, we will try to make it easy for users to supply their
111 own colors via user-side CSS.
113 CSS classes (for user-supplied CSS)
114 -----------------------------------
116 See examples in contrib/css/ and lib/PublicInbox/WwwText.pm
117 (or https://public-inbox.org/meta/_/text/color/ soon)