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

[Feature Request] Add button to copy code block content #65

Open
duskmoon314 opened this issue Jun 2, 2024 · 2 comments
Open

[Feature Request] Add button to copy code block content #65

duskmoon314 opened this issue Jun 2, 2024 · 2 comments

Comments

@duskmoon314
Copy link
Contributor

It would be nice to have a button to copy a code block's content like mdBook.


In addition, we can copy content by selecting and using the browser's hotkeys. However, this looks weird, possibly due to many empty elements. There are many span with class typst-content-fallback but have no child elements.

image
@Myriad-Dreamin
Copy link
Owner

I have no idea to identify the raw blocks in a compiled document. Perhaps we can enhance it when typst provides an IR (the IR for HTML export) containing full information for us.

@Myriad-Dreamin
Copy link
Owner

Since we have customized label now, I believe we can experiment it a bit.

Context, there is a "data-typst-label" to utilize:

https://github.com/typst/typst/blob/bb38a01d0625d5bdab0af50daf479e60c774d90e/crates/typst-svg/src/lib.rs#L254-L256C10

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