-
Notifications
You must be signed in to change notification settings - Fork 2
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
How to document variadic arguments #3
Comments
Hi @johannes-wolf ,
is (will be) the correct way. I am currently working on the interface for allowing ouput style customization and this delayed the update. |
By the way, I've already seen the current documentation of CeTZ (amazing work you have done there) some weeks ago and it features a lot of visual examples. Can I invite you to a discussion about (hopefully) supporting that in function descriptions? |
Yes :). I was also thinking about support for examples. My idea was to support custom tags/blocks that one can register callbacks for. When rendering these tags/blocks, the callback is called to return content.
|
Oh sorry, the #4 was intended to be the link for the disussion and I explained the current status there but anyway :D This is a great idea! |
Hi @johannes-wolf,
Or would the custom blocks and tags suggested by you add extra benefit or elegance? Because we could also have it both in that case. |
I think the version your example uses is fine. 👍 |
alright, thanks for your feedback :) |
Hi @johannes-wolf , You can now pass arbitrary variables to the docstring parser and they will be available in every docstring. The nice thing is that this even works with modules. For your project this would go along the lines of
It would be even be feasible (and surely worth) writing a function that displays and executes example code (avoiding the duplication). A rough idea for that:
It forwards the The docstring can now call it like this:
or something similar. Documenting variadic arguments is possible now as well ;) Have fun! |
Thank you for this project!
In CeTZ we use a lot of var-args
my-fun(..options)
, but I could find no way toget typst-doc to match the argument to my docstring line:
does not work. Is this currently possible?
The text was updated successfully, but these errors were encountered: