-
Notifications
You must be signed in to change notification settings - Fork 25
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
Proposal: Improved docstring handling #213
Comments
What's the difference between this and the
Yeah, I have to admit there haven't been many efforts in the help page formatter of Comonicon (it just re-uses whatever Julia's Markdown module provides), it would be nice to have something more specific for the CLI help page (or even man page). I was too lazy to write it but yes, ideally we should also include the markdown AST in the |
Ah, I may have got the behavior of If I'd say the advantage of not bothering with Reading the first sentence of the description sounds a bit dodgy, considering that you could have a sub-command like
Thinking more about this, I think you've actually done too much work perhaps. The |
Sorry, I forgot that convention is actually as follows.
I don't think so? https://github.com/JuliaLang/julia/blob/master/stdlib/Markdown/src/render/plain.jl#L116 |
So I think the current behaviour is actually already what you want, but need to document it better, I have to admit the documentation has been a bit out of date... and need some more work to make it more understandable |
I have some further thoughts on this, I think
So I'll close this issue after having more documentation mentioning the docstring syntax. |
OK I added more description about this in the convention section now. |
If you're going to write an expanded description, you're going to write a second paragraph naturally. Without reading any documentation I'd think many people would write something like this (I know I have):
A large part of what's nice about Comonicon is implicit information/specification, such as being able to do:
Instead of being more explicit with something like:
Also, with
|
This is hard to decide as I don't want people not aware of what effects it has in their produced CLI, but I agree to separate these into paragraphs is more natural. Myabe I'll just leave this issue open for now and see if there is anyone else want to comment. |
I also lean towards the first/second paragraph division, which is what is usually done in documentation for Python. I would leave the "Intro" section for more detailed docstrings maybe (?) |
As described in #212, I think the current state of docstring parsing could benefit from some TLC. I see there's been some effort with the (undocumented)
# Intro
/# Introduction
section, however this isn't enough.I propose that docstrings be handled the following way:
When called/rendered
splitlines
currently does), ideally not counting control sequences as part of the line length (see tecosaur/Org.jl:src/render/formatting.jl#L28-L102 as an example, there's also an equivalent function in stdlib/Markdown:src/render/terminal/formatting.jl but it simply isn't as good)e.g. wrapped items should be indented appropriately, but this is very much a lower priority compared to the rest
What do you think?
The text was updated successfully, but these errors were encountered: