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

Copy Code Button #572

Closed
Number-3434 opened this issue Jan 15, 2024 · 3 comments
Closed

Copy Code Button #572

Number-3434 opened this issue Jan 15, 2024 · 3 comments

Comments

@Number-3434
Copy link

Number-3434 commented Jan 15, 2024

Please add a button to copy code in code spans in markdown documentation comments.

Like the following:

/// There is a copy code button to the right!
void insubstantialMethod() { ... }

Also open here.

@DanTup
Copy link

DanTup commented Jan 15, 2024

Adding a way to copy the code is something that would need to be done in the IDE extension (Dart-Code/Dart-Code#4939). There's nothing specific to do here in the markdown package besides the existing request for offsets/lengths in parsed results (#369).

(I think we should close this as a dupe of those issues)

@jonasfj
Copy link
Member

jonasfj commented Mar 15, 2024

This exists on pub.dev, I don't see how it's related to markdown parsing.

If you're suggesting it be done in generated documentation, that's an issue for dartdoc.

We did on pub.dev using javascript to find the code tags that should have a copy button added.

@jonasfj jonasfj closed this as completed Mar 15, 2024
@DanTup
Copy link

DanTup commented Mar 15, 2024

The request here was about allowing it in the IDE (eg. code blocks inside doc comments can easily be copied). To do this, we need to reliably know the offset/lengths of the code blocks within the doc comments (while we could approximate this with regex, it should really be done with real parsing).

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

3 participants