Skip to content
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

Issue with header in README.md #85

Closed
AntoineD opened this issue Nov 22, 2023 · 4 comments · Fixed by #86
Closed

Issue with header in README.md #85

AntoineD opened this issue Nov 22, 2023 · 4 comments · Fixed by #86

Comments

@AntoineD
Copy link
Contributor

When a README.md has a header (like a licence header) as a html comment, like so with one of mkdocs gallery's projects examples docs/examples/no_output/README.md:

<!--
  Header here.
-->
## No image output examples

This section gathers examples which don't produce any figures. Some examples
only output to standard output, others demonstrate how Mkdocs-Gallery handles
examples with errors.

The rendering is broken:
Screenshot from 2023-11-22 12-20-38

@smarie
Copy link
Owner

smarie commented Nov 22, 2023

Hello @AntoineD , thanks for reporting this issue !

This is strange: mkdocs is supposed to correctly tackle markdown pages containing such a header.

When I try to reproduce the issue, the page concatenating all README.md displays correctly (on the right), including the html comment (if I look at the source). The problem seems "just" that the name of the subgallery is not correctly detected so the toc entry appears blank (left)

image

Do you confirm ? If so, the fix should improve the subgallery name detection script extract_readme_title (making it robust to the presence of one or several leading HTML elements), but not remove the HTML comment and users who wrote it might want it to eventually be integrated in the final generated html.

@AntoineD
Copy link
Contributor Author

Hello @smarie,

I'm surprised that you can not reproduce the same rendering. I obtained it by running nox -s docs on my PR without the fix.

Anyway I agree that the comment shall not be removed in the end, I'll change that.

@AntoineD
Copy link
Contributor Author

AntoineD commented Dec 6, 2023

@smarie Would it be possible for you to make a release with that fix?

@smarie
Copy link
Owner

smarie commented Dec 22, 2023

Hi @AntoineD , yes it was done 0.8.0 and 0.9.0 integrate it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants