commit 36d8e9ed5a94f2d26a8067a906d851670b97d3ca
parent 94edcb41f2c552b6a49d36a716255f23fac38137
Author: Nils Gillmann <ng0@n0.is>
Date: Tue, 9 Oct 2018 20:12:25 +0000
Attempt new layout.
Signed-off-by: Nils Gillmann <ng0@n0.is>
Diffstat:
4 files changed, 108 insertions(+), 40 deletions(-)
diff --git a/BibTeX.py b/BibTeX.py
@@ -632,7 +632,7 @@ class BibTeXEntry:
elif draft:
res = ["<li><div class='draftEntry'><p class='draftEntry'>"]
else:
- res = ["<li><p class='entry'>"]
+ res = ["<p class='item-preview'><p class='item-date'>"]
if imp or not draft:
"""
@@ -724,18 +724,15 @@ class BibTeXEntry:
%htmlize(self['www_remarks']))
if self.get('abstract'):
- res.append("<p class='abstract'>%s</p>"
+ res.append("<p class='abstract item-summary'>%s</p>"
%htmlize(self['abstract']))
- res.append("\n<br>[<a href='#'>Go to top</a>]")
-
- # We might want to make this invisible (and only
- # visible in text browsers:
- res.append("\n<hr>")
+ #res.append("\n<br>[<a href='#'>Go to top</a>]")
+ res.append("\n<p class='item-date'>[<a href='#'>Go to top</a>]</p>")
if imp or draft:
res.append("</div>")
- res.append("</li>\n\n")
+ res.append("</p>\n\n")
return "".join(res)
diff --git a/_template_.html b/_template_.html
@@ -31,9 +31,9 @@
<section>
<h2>Publications by %(field)s</h2>
<div class="sheet">
- <ul class="sections">
+ <!-- <ul class="sections"> -->
%(entries)s
- </ul>
+ <!-- </ul> -->
</div>
<section class="side-bar">
<strong>%(sectiontypes)s:</strong><br>
@@ -42,30 +42,34 @@
</ul>
</section>
</section>
- <hr>
- <p class="contact">
- Please send new or corrected entries to
- <a name="contact">
- <span class="email"><gnunet-developers@gn<!-- -->u.org></span>
- </a>.
- <br />
- If you can, please format them as BibTeX; see our
- <a href="bibtex.html">BibTeX source page</a> for examples.<br />
- <br />
- Remember to include URLs if possible:
- <a href="https://web.archive.org/web/20031231072314/http://citeseer.ist.psu.edu/online-nature01/">offline papers are less useful</a>.
- </p>
- <p>
- The source code to gnunetbib is in Git. See
- <a href="https://gnunet.org/git/gnunetbib.git">the gnunetbib cgit page</a>
- for more information. To contribute to this BibTeX viewer, read
- <a href="https://gnunet.org/git/gnunetbib.git/tree/TODO">TODO</a>
- for possible starting points.
- </p>
- <p>
- When submitting, please try to match the format of our entries in
- gnunetbib.bib. Our tools do not work on arbitrary bibtex, and
- hand-cleaning entries can significantly delay us.
- </p>
+ <hr class="hidden-hr">
+ <footer>
+ <p class="contact">
+ Please send new or corrected entries to
+ <a name="contact">
+ <span class="email">
+ <gnunet-developers@gn<!-- -->u.org>
+ </span>
+ </a>.
+ <br />
+ If you can, please format them as BibTeX; see our
+ <a href="bibtex.html">BibTeX source page</a> for examples.<br />
+ <br />
+ Remember to include URLs if possible:
+ <a href="https://web.archive.org/web/20031231072314/http://citeseer.ist.psu.edu/online-nature01/">offline papers are less useful</a>.
+ </p>
+ <p>
+ The source code to gnunetbib is in Git. See
+ <a href="https://gnunet.org/git/gnunetbib.git">the gnunetbib cgit page</a>
+ for more information. To contribute to this BibTeX viewer, read
+ <a href="https://gnunet.org/git/gnunetbib.git/tree/TODO">TODO</a>
+ for possible starting points.
+ </p>
+ <p>
+ When submitting, please try to match the format of our entries in
+ gnunetbib.bib. Our tools do not work on arbitrary bibtex, and
+ hand-cleaning entries can significantly delay us.
+ </p>
+ </footer>
</body>
</html>
diff --git a/css/main.css b/css/main.css
@@ -230,4 +230,70 @@ H3 {
.sheet-padded {
padding-right: 20px;
}
-
+}
+
+/* item-preview */
+.item-preview,
+.item-preview:link,
+.item-preview:visited {
+ color: #4D4D4D;
+ display: block;
+ padding: 10px 15px;
+ text-align: left;
+}
+
+.item-preview:active,
+ .item-preview:focus,
+ .item-preview:hover {
+ background-color: white;
+}
+
+.item-preview h3 {
+ font-size: 1em;
+ font-weight: bold;
+ margin: 0px;
+}
+
+.item-date {
+ font-size: 0.9em;
+}
+
+
+
+@media screen and (min-width: 1024px) {
+ .item-preview,
+ .item-preview:link,
+ .item-preview:visited {
+ background-color: transparent;
+ border-color: transparent;
+ border-style: solid;
+ border-width: thin;
+ display: inline-block;
+ margin: 10px 0px 15px 0px;
+ vertical-align: top;
+ width: 270px;
+ }
+
+ .item-preview:active,
+ .item-preview:focus,
+ .item-preview:hover {
+ border-color: white;
+ }
+
+ .summary-box {
+ color: #4D4D4D;
+ display: inline-block;
+ font-size: 0.9em;
+ margin: 5px;
+ padding: 10px;
+ text-align: left;
+ vertical-align: top;
+ width: 280px;
+ }
+
+ .summary-box img {
+ display: block;
+ margin: 0px auto;
+ max-width: 100%;
+ }
+}
diff --git a/writeHTML.py b/writeHTML.py
@@ -44,19 +44,20 @@ def writeBody(target_file, sections, section_urls, cache_path, base_url):
u = section_urls.get(s)
sDisp = re.sub(r'\s+', ' ', s.strip())
sDisp = sDisp.replace(" ", " ")
+ print("<section class='item-preview'>", file=target_file)
if u:
- print(('<li><h3><a name="%s"></a><a href="%s">%s</a></h3>'
+ print(('<h3><a name="%s"></a><a href="%s">%s</a></h3>'
%((BibTeX.url_untranslate(s), u, sDisp))),
file=target_file)
else:
- print(('<li><h3><a name="%s">%s</a></h3>'
+ print(('<h3><a name="%s">%s</a></h3>'
%(BibTeX.url_untranslate(s), sDisp)),
file=target_file)
- print("<ul class='expand'>", file=target_file)
+ #print("<section class='item-preview'>", file=target_file)
for e in entries:
print(e.to_html(cache_path=cache_path, base_url=base_url),
file=target_file)
- print("</ul></li>", file=target_file)
+ print("</section>", file=target_file)
def writeHTML(f, sections, sectionType, fieldName, choices,
tag, config, cache_url_path, section_urls={}):