annotate web_resources/feed-preview.xhtml @ 6:5d7c13e998e9

Create feed previews using a stream filter Instead of replacing the feed document with an XHTML preview from a content script after it has already been rendered, create an XHTML preview using a stream filter before it is passed into the rendering engine and use an XSL style sheet to convert it to HTML. This has two advantages, firstly it results in an HTMLDocument with the full HTML DOM available and secondly it avoids rendering the document twice. Refactor the feed preview creation and split parsing and rendering into seperate modules.
author Guido Berhoerster <guido+feed-preview@berhoerster.name>
date Thu, 08 Nov 2018 16:30:34 +0100
parents 1c31f4102408
children fcd65cf3f634
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
2 <!DOCTYPE html>
0
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
3 <html xmlns="http://www.w3.org/1999/xhtml">
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
4 <head>
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
5 <meta charset="utf-8"/>
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
6 <!--
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
7 Copyright (C) 2018 Guido Berhoerster <guido+feed-preview@berhoerster.name>
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
8
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
9 This Source Code Form is subject to the terms of the Mozilla Public
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
10 License, v. 2.0. If a copy of the MPL was not distributed with this
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
11 file, You can obtain one at http://mozilla.org/MPL/2.0/.
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
12 -->
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
13 <meta name="viewport" content="width=device-width, initial-scale=1"/>
6
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
14 <link rel="stylesheet" href=""/>
0
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
15 <title></title>
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
16 </head>
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
17 <body>
6
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
18 <template id="feed-logo-template">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
19 <img id="feed-logo" src="" alt=""/>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
20 </template>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
21 <template id="entry-template">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
22 <article>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
23 <details class="entry">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
24 <summary>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
25 <header class="entry-header">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
26 <p class="entry-date"><time></time></p>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
27 </header>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
28 </summary>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
29 <iframe class="entry-content" srcdoc="" title="" sandbox=""
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
30 width="800" height="360"></iframe>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
31 </details>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
32 </article>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
33 </template>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
34 <template id="entry-title-template">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
35 <h1 class="entry-title"></h1>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
36 </template>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
37 <template id="entry-title-linked-template">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
38 <h1 class="entry-title"><a class="entry-link" href="" title=""></a></h1>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
39 </template>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
40 <template id="entry-files-list-template">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
41 <footer class="entry-files">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
42 <h2 class="entry-files-title"></h2>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
43 <ul class="entry-files-list">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
44 </ul>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
45 </footer>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
46 </template>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
47 <template id="no-entries-hint-template">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
48 <p id="no-entries-hint"></p>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
49 </template>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
50 <template id="entry-file-template">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
51 <li class="entry-file"><a class="entry-file-link" href="" title=""></a>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
52 <span class="entry-file-info"></span></li>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
53 </template>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
54 <header id="feed-header">
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
55 <h1 id="feed-title"></h1>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
56 <p id="feed-subtitle"></p>
5d7c13e998e9 Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents: 1
diff changeset
57 </header>
0
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
58 </body>
bc5cc170163c Initial revision
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff changeset
59 </html>