def get_markdown_text_for_pub(self, pub):
    "Gets a dictionary `pub`, returns a markdown formatted text.\n\n           An example pub:\n\n                {'authors': 'McLellan, S. L., and Eren, A. M.',\n                 'doi': '10.1016/j.tim.2014.08.002',\n                 'issue': '22(12), 697-706',\n                 'title': 'Discovering new indicators of fecal pollution.',\n                 'journal': 'Trends Microbiol',\n                 'year': 2014}\n        "
    pub_md = []
    A = (lambda s: pub_md.append(s))
    A('<div class="pub">')
    A(('<div class=\'altmetric-embed\' data-badge-type=\'donut\' data-doi="%s"></div>' % pub['doi']))
    A(('<div class="__dimensions_badge_embed__" data-doi="%s" data-hide-zero-citations="true" data-legend="hover-bottom" data-style="small_circle"></div>' % pub['doi']))
    if pub['doi']:
        A(('    <h3><a href="%s" target="_new">%s</a></h3>' % ((' https://doi.org/%s' % pub['doi']), pub['title'])))
    else:
        A(('    <h3><a href="http://scholar.google.com/scholar?hl=en&q=%s" target="_new">%s</a></h3>' % (('http://scholar.google.com/scholar?hl=en&q=%s' % pub['title'].replace(' ', '+')), pub['title'])))
    A(('    <span class="pub-authors">%s</span>' % self.get_author_highlights(pub)))
    if (pub['co_first_authors'] and (not pub['co_senior_authors'])):
        A('    <span class="pub-co-first-authors"><sup>☯</sup>Co-first authors</span>')
    elif (pub['co_first_authors'] and pub['co_senior_authors']):
        A('    <span class="pub-co-first-authors"><sup>☯</sup>Co-first authors; <sup>‡</sup>Co-senior authors</span>')
    elif (pub['co_senior_authors'] and (not pub['co_first_authors'])):
        A('    <span class="pub-co-first-authors"><sup>‡</sup>Co-senior authors</span>')
    if (pub['doi'] in self.info):
        info = self.info[pub['doi']]
        A(('    <div class="%s">' % ('pub-info' if info['featured_image'] else 'pub-info-no-image')))
        if info['featured_image']:
            A('    <div class="pub-featured-image">')
            A(('    <a href="%s"><img src="%s" style="max-width: 100px; max-height: 80px; width: auto; border: none; height: auto; margin: 0 auto; display: block; transform: translateY(15%%);"/></a>' % (info['featured_image'], info['featured_image'])))
            A('    </div>')
        highlights = (info['highlights'].split(';') if info['highlights'] else None)
        if highlights:
            A(('    <div class="%s">' % ('pub-highlights' if info['featured_image'] else 'pub-highlights-no-image')))
            A(('    %s' % '<br>'.join([('<span style="display: inline-block; padding-bottom: 5px;">- %s</span>' % h) for h in highlights])))
            A('    </div>')
        A('    </div>')
    A(('    <span class="pub-journal"><b>%s</b>, %s.</span>' % (pub['journal'], pub['issue'])))
    A('</div>\n')
    return '\n'.join(pub_md)
Gets a dictionary `pub`, returns a markdown formatted text.

An example pub:

     {'authors': 'McLellan, S. L., and Eren, A. M.',
      'doi': '10.1016/j.tim.2014.08.002',
      'issue': '22(12), 697-706',
      'title': 'Discovering new indicators of fecal pollution.',
      'journal': 'Trends Microbiol',
      'year': 2014}
def get_markdown_text_for_pub(self, pub):
    "Gets a dictionary `pub`, returns a markdown formatted text.\n\n           An example pub:\n\n                {'authors': 'McLellan, S. L., and Eren, A. M.',\n                 'doi': '10.1016/j.tim.2014.08.002',\n                 'issue': '22(12), 697-706',\n                 'title': 'Discovering new indicators of fecal pollution.',\n                 'journal': 'Trends Microbiol',\n                 'year': 2014}\n        "
    pub_md = []
    A = (lambda s: pub_md.append(s))
    A('<div class="pub">')
    A(('<div class=\'altmetric-embed\' data-badge-type=\'donut\' data-doi="%s"></div>' % pub['doi']))
    A(('<div class="__dimensions_badge_embed__" data-doi="%s" data-hide-zero-citations="true" data-legend="hover-bottom" data-style="small_circle"></div>' % pub['doi']))
    if pub['doi']:
        A(('    <h3><a href="%s" target="_new">%s</a></h3>' % ((' https://doi.org/%s' % pub['doi']), pub['title'])))
    else:
        A(('    <h3><a href="http://scholar.google.com/scholar?hl=en&q=%s" target="_new">%s</a></h3>' % (('http://scholar.google.com/scholar?hl=en&q=%s' % pub['title'].replace(' ', '+')), pub['title'])))
    A(('    <span class="pub-authors">%s</span>' % self.get_author_highlights(pub)))
    if (pub['co_first_authors'] and (not pub['co_senior_authors'])):
        A('    <span class="pub-co-first-authors"><sup>☯</sup>Co-first authors</span>')
    elif (pub['co_first_authors'] and pub['co_senior_authors']):
        A('    <span class="pub-co-first-authors"><sup>☯</sup>Co-first authors; <sup>‡</sup>Co-senior authors</span>')
    elif (pub['co_senior_authors'] and (not pub['co_first_authors'])):
        A('    <span class="pub-co-first-authors"><sup>‡</sup>Co-senior authors</span>')
    if (pub['doi'] in self.info):
        info = self.info[pub['doi']]
        A(('    <div class="%s">' % ('pub-info' if info['featured_image'] else 'pub-info-no-image')))
        if info['featured_image']:
            A('    <div class="pub-featured-image">')
            A(('    <a href="%s"><img src="%s" style="max-width: 100px; max-height: 80px; width: auto; border: none; height: auto; margin: 0 auto; display: block; transform: translateY(15%%);"/></a>' % (info['featured_image'], info['featured_image'])))
            A('    </div>')
        highlights = (info['highlights'].split(';') if info['highlights'] else None)
        if highlights:
            A(('    <div class="%s">' % ('pub-highlights' if info['featured_image'] else 'pub-highlights-no-image')))
            A(('    %s' % '<br>'.join([('<span style="display: inline-block; padding-bottom: 5px;">- %s</span>' % h) for h in highlights])))
            A('    </div>')
        A('    </div>')
    A(('    <span class="pub-journal"><b>%s</b>, %s.</span>' % (pub['journal'], pub['issue'])))
    A('</div>\n')
    return '\n'.join(pub_md)