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