Permalink
Browse files

Navigator: add links to some example pages

  • Loading branch information...
1 parent 22cb02c commit 477b849363c944a4704b551be94b6ef2f08f799e @SimonSapin SimonSapin committed Jul 3, 2012
Showing with 16 additions and 1 deletion.
  1. +16 −1 weasyprint/navigator.py
@@ -73,14 +73,15 @@ def render_template(url):
<title>WeasyPrint Navigator</title>
<style>
form { position: fixed; z-index: 1; top: 8px; left: 16px; right: 0; }
- input { font: 24px/30px sans-serif }
+ nav, input { font: 24px/30px sans-serif }
input:not([type]) { background: rgba(255, 255, 255, .9); border-width: 2px;
border-radius: 6px; padding: 0 3px }
input:not([type]):focus { outline: none }
body { margin-top: 0; padding-top: 50px }
section { box-shadow: 0 0 10px 2px #aaa; margin: 25px; position: relative }
section a { position: absolute; display: block }
section a[href]:hover, a[href]:focus { outline: 1px dotted }
+ nav { margin: 25px }
</style>
<body onload="var u=document.forms[0].url; u.value || u.focus()">
<form action="/" onsubmit="
@@ -112,6 +113,20 @@ def render_template(url):
write(' <a style="left: {0}px; top: {1}px;" name="{2}"></a>\n'
.format(pos_x, pos_y - 60, anchor))
write('</section>\n')
+ else:
+ write('''
+<nav>
+<h2>Examples:</h2>
+<ul>
+ <li><a href="/view/http://www.webstandards.org/files/acid2/test.html">
+ Acid2</a></li>
+ <li><a href="/view/http://www.w3.org/Style/CSS/current-work">
+ CSS specifications</a></li>
+ <li><a href="/view/http://en.wikipedia.org/">
+ English Wikipedia</a></li>
+</ul>
+</nav>
+''')
return ''.join(parts).encode('utf8')

0 comments on commit 477b849

Please sign in to comment.