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

Enhanced samples #3954

Open
CLOVIS-AI opened this issue Dec 12, 2024 · 0 comments
Open

Enhanced samples #3954

CLOVIS-AI opened this issue Dec 12, 2024 · 0 comments
Labels
enhancement An issue for a feature or an overall improvement

Comments

@CLOVIS-AI
Copy link
Contributor

Is your feature request related to a problem? Please describe

I try to always add an example of usage to each function. However, they appear as static text to users, so I have to add links to around the sample to link to methods called in the sample.

Dokka supports "enhanced code blocks" (I don't know how you call them). Typically, one of them is visible in the main section of each page, just below the main title. These blocks are generated by Dokka from source code (not from comments in source code) and can contain links to other functions.

Here is an example in the Prepared documentation:
image
As shown in the capture, symbols referred to in the enhanced code block can be clicked, whereas symbols referred to in regular code blocks cannot.

Describe the solution you'd like

This proposal would be to enable this feature in some Markdown code blocks. The exact restrictions are to be discussed, but a basic list could be:
• Has to be declared with the language kotlin
• Has to compile if put in a .kts environment declared in the same package as the current declaration, using the same imports as present in the current file

Describe alternatives you've considered

N/A

Additional context

Originally requested as a feature of Kotools Samples: kotools/samples#14. The end goal for me is the ability to ensure samples are correct (provided by Kotools Samples) as well as provide navigation in them (this feature).

@CLOVIS-AI CLOVIS-AI added the enhancement An issue for a feature or an overall improvement label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue for a feature or an overall improvement
Projects
None yet
Development

No branches or pull requests

1 participant