comparison 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
comparison
equal deleted inserted replaced
5:341a0f4b7ce0 6:5d7c13e998e9
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html>
1 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head> 4 <head>
3 <meta charset="utf-8"/> 5 <meta charset="utf-8"/>
4 <!-- 6 <!--
5 Copyright (C) 2018 Guido Berhoerster <guido+feed-preview@berhoerster.name> 7 Copyright (C) 2018 Guido Berhoerster <guido+feed-preview@berhoerster.name>
7 This Source Code Form is subject to the terms of the Mozilla Public 9 This Source Code Form is subject to the terms of the Mozilla Public
8 License, v. 2.0. If a copy of the MPL was not distributed with this 10 License, v. 2.0. If a copy of the MPL was not distributed with this
9 file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 --> 12 -->
11 <meta name="viewport" content="width=device-width, initial-scale=1"/> 13 <meta name="viewport" content="width=device-width, initial-scale=1"/>
12 <base href=""/> 14 <link rel="stylesheet" href=""/>
13 <link rel="stylesheet" href="style/feed-preview.css"/>
14 <title></title> 15 <title></title>
15 </head> 16 </head>
16 <body> 17 <body>
17 <template id="feed-logo-template"> 18 <template id="feed-logo-template">
18 <img id="feed-logo" src="" alt=""/> 19 <img id="feed-logo" src="" alt=""/>
19 </template> 20 </template>
20 <template id="entry-template"> 21 <template id="entry-template">
21 <article> 22 <article>
22 <details class="entry"> 23 <details class="entry">
23 <summary> 24 <summary>
24 <header class="entry-header"> 25 <header class="entry-header">
25 <p class="entry-date"><time></time></p> 26 <p class="entry-date"><time></time></p>
26 </header> 27 </header>
27 </summary> 28 </summary>
28 <iframe class="entry-content" srcdoc="" title="" sandbox="" 29 <iframe class="entry-content" srcdoc="" title="" sandbox=""
29 width="800" height="360"/> 30 width="800" height="360"></iframe>
30 </details> 31 </details>
31 </article> 32 </article>
32 </template> 33 </template>
33 <template id="entry-title-template"> 34 <template id="entry-title-template">
34 <h1 class="entry-title"></h1> 35 <h1 class="entry-title"></h1>
35 </template> 36 </template>
36 <template id="entry-title-linked-template"> 37 <template id="entry-title-linked-template">
37 <h1 class="entry-title"><a class="entry-link" href="" title=""></a></h1> 38 <h1 class="entry-title"><a class="entry-link" href="" title=""></a></h1>
38 </template> 39 </template>
39 <template id="entry-files-list-template"> 40 <template id="entry-files-list-template">
40 <footer class="entry-files"> 41 <footer class="entry-files">
41 <h2 class="entry-files-title"></h2> 42 <h2 class="entry-files-title"></h2>
42 <ul class="entry-files-list"> 43 <ul class="entry-files-list">
43 </ul> 44 </ul>
44 </footer> 45 </footer>
45 </template> 46 </template>
46 <template id="no-entries-hint-template"> 47 <template id="no-entries-hint-template">
47 <p id="no-entries-hint"></p> 48 <p id="no-entries-hint"></p>
48 </template> 49 </template>
49 <template id="entry-file-template"> 50 <template id="entry-file-template">
50 <li class="entry-file"><a class="entry-file-link" href="" title=""></a> 51 <li class="entry-file"><a class="entry-file-link" href="" title=""></a>
51 <span class="entry-file-info"></span></li> 52 <span class="entry-file-info"></span></li>
52 </template> 53 </template>
53 <header id="feed-header"> 54 <header id="feed-header">
54 <h1 id="feed-title"></h1> 55 <h1 id="feed-title"></h1>
55 <p id="feed-subtitle"></p> 56 <p id="feed-subtitle"></p>
56 </header> 57 </header>
57 </body> 58 </body>
58 </html> 59 </html>