Skip to content

Format docstrings with Runic#5604

Open
fredrikekre wants to merge 1 commit into
MakieOrg:masterfrom
fredrikekre:fe/runic-docstrings
Open

Format docstrings with Runic#5604
fredrikekre wants to merge 1 commit into
MakieOrg:masterfrom
fredrikekre:fe/runic-docstrings

Conversation

@fredrikekre
Copy link
Copy Markdown
Contributor

Since you have adopted Runic I am using your code base for testing things and now to solicit input on new features :p

I have implemented docstring formatting in Runic. This is the results. Runic assumes that fenced code blocks are valid Julia but for indented blocks (typically for function signatures in docstrings) the syntax isn't always valid Julia code, in particular when it comes to using [...] for optional arguments. I initially thought we should filter out such docstrings but I settled on: "if it parses we format it". This leads to some quirks (see inline comments) but I think it might be better to rewrite those cases to valid Julia code anyway.

@github-project-automation github-project-automation Bot moved this to Work in progress in PR review Apr 21, 2026
Comment thread GLMakie/src/screen.jl

"""
render_asap([callback::Function, ]screen, N)
render_asap([callback::Function]screen, N)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look a bit odd now for example. I would (manually) rewrite this as

    render_asap([callback::Function], screen, N)

or

    render_asap(screen, N)
    render_asap(callback::Function, screen, N)

@fredrikekre
Copy link
Copy Markdown
Contributor Author

Also imlemented formatting of julia code in markdown files.

@fredrikekre fredrikekre force-pushed the fe/runic-docstrings branch from b5f2d80 to fd6ae10 Compare April 22, 2026 13:20
@fredrikekre fredrikekre changed the title [RFC/WIP] Format docstrings with Runic Format docstrings with Runic Apr 22, 2026
@fredrikekre fredrikekre marked this pull request as ready for review April 22, 2026 13:20
@fredrikekre
Copy link
Copy Markdown
Contributor Author

Runic 1.7 is released with these changes so I updated the CI files etc too. Probably need some manual edits (but I will let someone else handle that).

@ffreyer
Copy link
Copy Markdown
Collaborator

ffreyer commented Apr 28, 2026

Does this require a function signature like foo(x, y) as the first line? Because that's something we automated away in 0.25/#5484/#5389 for recipes.

@fredrikekre
Copy link
Copy Markdown
Contributor Author

Does this require a function signature like foo(x, y) as the first line?

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Work in progress

Development

Successfully merging this pull request may close these issues.

2 participants