Disable collapsing top-level headline.

This commit is contained in:
Sergio Martínez Portela 2022-10-20 23:44:35 +02:00
parent bcfd8b1d93
commit fcd9854a17

View File

@ -445,7 +445,7 @@ def render_as_document(headline, doc, headlineLevel, title):
<a href='./{topLevelHeadline.id}.node.html#{headline.id}'>Sending you to the main note... [{org_rw.token_list_to_plaintext(topLevelHeadline.title.contents)}]</a>
</body>
</html>
"""
"""
else:
return as_document(render(headline, doc, headlineLevel), title)
@ -482,13 +482,16 @@ def render(headline, doc, headlineLevel):
# display_state = 'expanded'
display_state = 'expanded'
title = render_inline(headline.title, render_tag)
if headlineLevel > 0:
title = f"<a href=\"javascript:toggle_expand('{html.escape(headline.id)}')\">{title}</a>"
return f"""
<div id="{html.escape(headline.id)}" class="node {todo_state} {display_state}">
<h1 class="title">
{state}
<a href=\"javascript:toggle_expand('{html.escape(headline.id)}')\">
{render_inline(headline.title, render_tag)}
</a>
{title}
{tags}
</h1>
<div class='contents'>