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

How do I add a button to a block of code for copying? #138

Open
239573049 opened this issue Dec 10, 2023 · 3 comments
Open

How do I add a button to a block of code for copying? #138

239573049 opened this issue Dec 10, 2023 · 3 comments

Comments

@239573049
Copy link

How do I add a button to a block of code for copying?
image

Similar to this, show the language and then show the copy button on the right to provide copy of the internal code

@whistyun
Copy link
Owner

We released a test package 11.0.3-a1.

This package display a lang and copy button.
copycodeblock

A button label can be changed using Style.

<Styles xmlns="https://github.com/avaloniaui">
  <Style Selector=".CodeBlock Button.CopyButton TextBlock">
    <Setter Property="Text" Value="📋"/>
  </Style>
</Styles>

image

@239573049
Copy link
Author

Thank you, this is a great feature

@239573049
Copy link
Author

If I have time I would like to use it to write a ChatGpt client

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