-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix double trailing newline apidoc #7940
Fix double trailing newline apidoc #7940
Conversation
{%- for submodule in submodules %} | ||
{% if show_headings %} | ||
{{- [submodule, "module"] | join(" ") | e | heading(2) }} | ||
{% endif %} | ||
{{ automodule(submodule, automodule_options) }} | ||
{% endfor %} | ||
{%- endif %} | ||
{%- endif -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using stripping mark at both start and end causes template maintainable. I guess the change above (changing "else" to independent "if" statement) came from this change, right? To keep templates clean, it is better to use one of them consistently.
How about the change like this?
@@ -43,9 +46,10 @@ Submodules
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
-{% endif %}
+{%- endif %}
{%- if not modulefirst and not is_namespace %}
+
Module contents
---------------
Notes:
- Inserts a blank line before section headers to add a space only if the block needed.
- Add stripping-mark to the start of "endif" to strip trailing return codes.
I guess some additional change would be needed for this change. But it will keep our templates clean (if my understanding correct). Could you check this please?
Thanks for the feedback. I tried what you suggested, but If using |
Thank you for update. LGTM! |
Subject: Fix apidoc generating two newlines at the end of the package rst file if it contains submodules and
--module-first
is used.Feature or Bugfix
Purpose