mirror of
https://github.com/vale981/releases
synced 2025-03-05 09:41:42 -05:00
Finally done?!
This commit is contained in:
parent
e170ba54f4
commit
eae7db3055
2 changed files with 14 additions and 13 deletions
|
@ -78,19 +78,20 @@ def issues_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
|
|||
|
||||
|
||||
def release_nodes(text, slug, date, config):
|
||||
my_nodes = [
|
||||
nodes.reference(
|
||||
text=text,
|
||||
refuri=config.releases_release_uri % slug,
|
||||
),
|
||||
]
|
||||
# Doesn't seem possible to do this "cleanly" (i.e. just say "make me a
|
||||
# title and give it these HTML attributes during render time) so...fuckit.
|
||||
# We were already doing fully raw elements elsewhere anyway. And who cares
|
||||
# about a PDF of a changelog? :x
|
||||
link = '<a class="reference external" href="{0}">{1}</a>'.format(
|
||||
config.releases_release_uri % slug,
|
||||
text,
|
||||
)
|
||||
datespan = ''
|
||||
if date:
|
||||
my_nodes.extend([
|
||||
nodes.inline(text=' '),
|
||||
nodes.raw(text='<span style="font-size: 75%%;">%s</span>' % date, format='html'),
|
||||
])
|
||||
datespan = ' <span style="font-size: 75%%;">{0}</span>'.format(date)
|
||||
header = '<h2 style="margin-bottom: 0.3em;">{0}{1}</h2>'.format(link, datespan)
|
||||
return nodes.section('',
|
||||
nodes.title('', '', *my_nodes),
|
||||
nodes.raw(rawtext='', text=header, format='html'),
|
||||
ids=[text]
|
||||
)
|
||||
|
||||
|
|
|
@ -208,6 +208,6 @@ class nodes(Spec):
|
|||
node = self._generate('1.0.2', self.b, raw=True)[0][0]
|
||||
_expect_type(node, raw)
|
||||
# Header w/ bottom margin
|
||||
assert '<h2 style="margin-bottom' in node
|
||||
assert '<h2 style="margin-bottom' in str(node)
|
||||
# Date span w/ font-size
|
||||
assert '<span style="font-size' in node
|
||||
assert '<span style="font-size' in str(node)
|
||||
|
|
Loading…
Add table
Reference in a new issue