diff --git a/mdx_gallery.py b/mdx_gallery.py index 5c1d3db..069b1de 100644 --- a/mdx_gallery.py +++ b/mdx_gallery.py @@ -14,15 +14,18 @@ class GalleryPattern(Pattern): ul = markdown.util.etree.Element('ul') ul.attrib["class"]='gallery' - for img in imgs: li = markdown.util.etree.Element('li') ul.append(li) + anch = markdown.util.etree.Element('a') + anch.attrib["href"]=img + anch.attrib["target"]="_blank" + li.append(anch) + img_el = markdown.util.etree.Element('img') - li.append(img_el) + anch.append(img_el) img_el.attrib["src"]=img img_el.attrib["alt"]=alt - img_el.attrib["class"]='galleryimage' return ul diff --git a/style.css b/style.css index 4aba6c6..6aff846 100644 --- a/style.css +++ b/style.css @@ -224,7 +224,17 @@ span.pre { font-family:monospace; } - +ul.gallery { + display:block; + padding:0px; +} +ul.gallery li { + display:inline; +} +ul.gallery li img { + height:75px; + margin:2px; +}