Skip to content

[Improvement suggestion] Use Class Tag to enable any element copy to clipboard #9

@MacHu-GWU

Description

@MacHu-GWU

I checked your code, looks like it assign a unique copy to each code block, and use that ID to copy code block to clipboard.

I am wondering, is it possible to just assign a special class to any html element, then your library automatically assign an ID to it, and do the same trick?

If you can implement that, you can define a custom rst:

.. role::
    :class: scb

Then you can use this to allow copy anything to clipboard:

Copy :scb:`This` to clipboard.

How's that sounds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions