Skip to content

Commit

Permalink
Making bullet points for extra urls.
Browse files Browse the repository at this point in the history
  • Loading branch information
drvinceknight committed Sep 10, 2015
1 parent 02b8c60 commit a070f09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ghtalks/talk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import yaml


class Talk:
def __init__(self, title, date, path, file_type, urls=None):
self.title = title
Expand All @@ -17,9 +18,11 @@ def html(self):
<a class="post-link" href="%s">%s</a>
""" % (self.date, self.file_type, self.path, self.title)
if self.urls:
out += "<ul>"
urls = yaml.load(open(self.urls, 'r'))
for key in sorted(urls.keys()):
out += """
<p><a href=%s>%s</a></p>
<li><a href=%s>%s</a></li>
""" % (urls[key], key)
out += "</ul>"
return out
2 changes: 1 addition & 1 deletion ghtalks/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestIndex(unittest.TestCase):


expected_output="""
<body>\n<div class="page-content">\n<div class="wrap">\n<div class="home">\n<ul class=\'posts\'>\n<li>\n<span class="post-date">2015-07-27 [.link]</span>\n<a class="post-link" href="http://vknight.org/Talks/\n">links</a>\n\n</li>\n<li>\n<span class="post-date">2015-04-05 [.html]</span>\n<a class="post-link" href="./examples/2015-04-05-Organise-and-share-talks/index.html">Organise and share talks</a>\n\n<p><a href=http://lab.hakim.se/reveal-js/#/>(slides written in reveal.js)</a></p>\n\n<p><a href=https://github.com/drvinceknight/ghtalks>github repository</a></p>\n\n</li>\n<li>\n<span class="post-date">2014-12-25 [.pdf]</span>\n<a class="post-link" href="./examples/archive/2014-12-25-Auraya/index.pdf">Auraya</a>\n\n</li>\n</ul>\n</div>\n</div>\n</div>\n\n</body>\n"""
<body>\n<div class="page-content">\n<div class="wrap">\n<div class="home">\n<ul class=\'posts\'>\n<li>\n<span class="post-date">2015-07-27 [.link]</span>\n<a class="post-link" href="http://vknight.org/Talks/\n">links</a>\n\n</li>\n<li>\n<span class="post-date">2015-04-05 [.html]</span>\n<a class="post-link" href="./examples/2015-04-05-Organise-and-share-talks/index.html">Organise and share talks</a>\n<ul>\n<li><a href=http://lab.hakim.se/reveal-js/#/>(slides written in reveal.js)</a></li>\n\n<li><a href=https://github.com/drvinceknight/ghtalks>github repository</a></li>\n</ul>\n</li>\n<li>\n<span class="post-date">2014-12-25 [.pdf]</span>\n<a class="post-link" href="./examples/archive/2014-12-25-Auraya/index.pdf">Auraya</a>\n\n</li>\n</ul>\n</div>\n</div>\n</div>\n\n</body>\n"""

def test_init(self):
root = os.getcwd()
Expand Down

0 comments on commit a070f09

Please sign in to comment.