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

Including specific docstring at specific location #6

Open
nignatiadis opened this issue Apr 6, 2023 · 2 comments
Open

Including specific docstring at specific location #6

nignatiadis opened this issue Apr 6, 2023 · 2 comments

Comments

@nignatiadis
Copy link

Hi!

First of all, thanks for this package, it's such an awesome and useful idea!

I wanted to ask if the following is possible: to include a specific docstring in a specific location.

To be concrete, I'd like a command similar to e.g., "[Base.:+](@ref)", that also directly prints the docstring at that location. Currently a URL is provided and the user needs to open another tab to view the docstring.

The closest I found was to use something like:

{{< include docstrings/src/file.qmd >}}

but this prints all docstrings in file.qmd.

Thank you,
Nikos

@nhz2
Copy link
Member

nhz2 commented Apr 10, 2023

There is no way yet to do this using the @ref link target directly.

One option is to use the @doc julia macro. For example:

:::{.callout-note appearance="minimal"}
```{julia}
#| echo: false
@doc Base.:+
```
:::

@nignatiadis
Copy link
Author

That works lovely, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants