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

Documentation only renders when there are at least two spaces at the end of .md file #50

Closed
ieaves opened this issue Apr 12, 2022 · 5 comments · Fixed by #69
Closed

Comments

@ieaves
Copy link

ieaves commented Apr 12, 2022

I'm a new user to mkdocs-click so apologies if I'm doing something wrong but I've been stuck trying to get even the basic Readme example working. I found this comment in issue #46 which referred to the issue changing when "hitting enter." As it turns out, the CLI documentation will only render for me if there are at least two spaces at the end of the markdown file, otherwise it renders the header but not CLI documentation.

e.g. this will only render the heading CLI Reference

# CLI Reference

::: mkdocs-click
    :module: app.cli
    :command: cli

but this will render the heading and generated documentation.

# CLI Reference

::: mkdocs-click
    :module: app.cli
    :command: cli
<newline>
<newline>

It's a particular challenge for new users where they are likely to copy / paste the readme example into a new text file in order to begin testing and immediately hit a deadend. In my case, I assumed there was something arcane about the :module: reference (does it follow standard library import hierarchies, are they directory hierarchies, something else, etc...)

@ofek
Copy link
Collaborator

ofek commented Apr 12, 2022

I think part of the issue is that h1 is set as the CLI's name. Can you try :depth: 1 or removing header?

@ieaves
Copy link
Author

ieaves commented Apr 12, 2022

Hey @ofek. Sure! Here are a few of the variations I've attempted based on your suggestion

  • Changing the h1 label (just to test in this case), one space at the end of the file, with and without :depth: 1 tag
  • Removing the header, one space at the end of the file, with and without :depth: 1 tag

None of those work, however, they all work if there are two spaces at the end of the file.

EDIT: I can also add, the issue was identical for me in two different environments, one arch linux and the other macOS.

Double edit: It also works with a newline + space or newline + tab.

@sveint
Copy link

sveint commented Apr 21, 2022

I can confirm the issue.

I thought something was misconfigured, but then I found this issue and thought I'd try it out. For me a single newline with no extra characters fixes the problem.

@Gustavo-SF
Copy link

I also had this same issue on macOS 12.4, Python3.10 and mkdocs-click version 0.8.0.
Fixed it with a double newline at the end.

@matroscoe
Copy link

I also ran into this issue, if it is required (it is really okay that it is) ideally there would be a check for this at build time (or a note in the README). I spent a fair amount of time banging my head against a wall to find out why I couldn't get my docs to generate.

Python 3.11, Ubuntu 22.04, mkdocs-click = "^0.8.0"

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.

5 participants