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

Docs comments do not follow usual markdown newline rules #811

Open
RedMser opened this issue Jul 23, 2024 · 6 comments
Open

Docs comments do not follow usual markdown newline rules #811

RedMser opened this issue Jul 23, 2024 · 6 comments
Labels
bug c: register Register classes, functions and other symbols to GDScript

Comments

@RedMser
Copy link

RedMser commented Jul 23, 2024

In pretty much every markdown implementation I know, a single newline is either treated as a newline or silently ignored.

So when adding a documentation comment to a member like

/// docs for speed
/// with newline
/// 
/// and with paragraph
#[var]
speed: f64,

I expect Godot's documentation viewer to either render like

docs for speed
with newline

and with paragraph

or like

docs for speed with newline

and with paragraph

However, godot-rust markdown parser seems to convert newlines to paragraphs as well:

image

I don't mind which style ends up being chosen here, but the current behavior does not seem correct. Very long lines of documentation are usually split into multiple lines, which would end up creating a lot of paragraphs mid-sentence.


For reference, VSCode ignores newlines and treats double newline as a paragraph.

image

GDScript documentation

## docs for speed
## with newline
##
## and with paragraph

ignores all kinds of newlines (converting newlines to spaces), and is expecting you to write [br] instead.

@Bromeon
Copy link
Member

Bromeon commented Jul 23, 2024

Thanks for reporting! #748 was merged only 18h ago, we're aware it's an initial version and not the perfect one yet. But that doesn't have to stay like this 😉

Would you be interested in opening a pull request to address the issues you mentioned? Let us know if you need some guidance.

@Bromeon Bromeon added bug c: register Register classes, functions and other symbols to GDScript labels Jul 23, 2024
@RedMser
Copy link
Author

RedMser commented Jul 23, 2024

I could have a look at it, though I have not contributed to this project yet. If someone else is willing and interested though, I won't stop them ^^

EDIT: I'm getting a lot of confusing compile errors just trying to run the unit tests, so I'll drop this until I have more time.

@Bromeon
Copy link
Member

Bromeon commented Jul 23, 2024

This issue might be a great place to start 😉 of course only if you want and have the time. As mentioned, in case you need any support or guidance, let us know (either here or on Discord) 👍

@Yarwin
Copy link
Contributor

Yarwin commented Jul 26, 2024

I can take care of it after #815

@Bromeon
Copy link
Member

Bromeon commented Sep 24, 2024

@RedMser or @Yarwin is there still interest in this?

@RedMser
Copy link
Author

RedMser commented Sep 24, 2024

I'm busy with work so @Yarwin is free to work on it if they want. But the issue should definitely be fixed to help readability of docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: register Register classes, functions and other symbols to GDScript
Projects
None yet
Development

No branches or pull requests

3 participants