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):
|
def release_nodes(text, slug, date, config):
|
||||||
my_nodes = [
|
# Doesn't seem possible to do this "cleanly" (i.e. just say "make me a
|
||||||
nodes.reference(
|
# title and give it these HTML attributes during render time) so...fuckit.
|
||||||
text=text,
|
# We were already doing fully raw elements elsewhere anyway. And who cares
|
||||||
refuri=config.releases_release_uri % slug,
|
# 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:
|
if date:
|
||||||
my_nodes.extend([
|
datespan = ' <span style="font-size: 75%%;">{0}</span>'.format(date)
|
||||||
nodes.inline(text=' '),
|
header = '<h2 style="margin-bottom: 0.3em;">{0}{1}</h2>'.format(link, datespan)
|
||||||
nodes.raw(text='<span style="font-size: 75%%;">%s</span>' % date, format='html'),
|
|
||||||
])
|
|
||||||
return nodes.section('',
|
return nodes.section('',
|
||||||
nodes.title('', '', *my_nodes),
|
nodes.raw(rawtext='', text=header, format='html'),
|
||||||
ids=[text]
|
ids=[text]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -208,6 +208,6 @@ class nodes(Spec):
|
||||||
node = self._generate('1.0.2', self.b, raw=True)[0][0]
|
node = self._generate('1.0.2', self.b, raw=True)[0][0]
|
||||||
_expect_type(node, raw)
|
_expect_type(node, raw)
|
||||||
# Header w/ bottom margin
|
# Header w/ bottom margin
|
||||||
assert '<h2 style="margin-bottom' in node
|
assert '<h2 style="margin-bottom' in str(node)
|
||||||
# Date span w/ font-size
|
# 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