-
Notifications
You must be signed in to change notification settings - Fork 5
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
Generate docs #12
Comments
Aha! If I add some extra indentation within the code fence, it seems to do the trick. So this:
Renders like so:
It seems that lazydocs simply needs at least one space indent from the triple-backticks in order to not wrap the lines, so I'm going to make that slight adjustment to fix the rendering. |
Related to this, I submitted a bug report and a feature request to lazydocs: |
chuckwondo
added a commit
to chuckwondo/maybe
that referenced
this issue
Aug 8, 2024
Fixes rustedpy#12
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@francium, I know you have an old PR for this (#7), but thought I would make a corresponding issue because I am attempting to create a new PR (per your suggestion in #7), but I am finding the following anomaly with lazydocs: it doesn't deal with REPL syntax properly.
In particular, here is a problematic part of a docstring from the
is_some
function (and similarly foris_nothing
):Unfortunately, the generated HTML renders as follows:
This sort of makes sense in terms of pure translation of markdown to HTML because there are no intervening blank lines, so all of the lines are interpreted to be part of the same "paragraph," so each intervening newline is replaced with a single blank, and we end up with all of the "code" joined onto a single line.
Sadly, as far as I can tell, there is no way to completely correct this to allow correct rendering of REPL prompts, which is also sad because that eliminates the possibility of including doctest tests and having them rendered correctly in the generated docs.
For starters, I added a blank line after "Usage:" and surrounded the REPL lines in a plain code fence, like so:
This produced an even worse rendering:
Of course, I realize that the REPL syntax should actually be corrected as follows (notice, the
...
in place of some of the>>>
), if it is to be a true REPL representation:Unfortunately, that does not render any better, nor did I really expect it to, since
...
vs.>>>
is not the source of the rendering problem.The "fix" is to simply remove the REPL prompts, and make it a regular code fence, like so:
This renders like so:
Are you okay with making this type of adjustment to the docstrings for both
is_some
andis_nothing
?The text was updated successfully, but these errors were encountered: