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

Add initial improved click-to-copy for resources page #2514

Merged
merged 42 commits into from
Jan 24, 2025

Conversation

pushfoo
Copy link
Member

@pushfoo pushfoo commented Jan 24, 2025

TL;DR: Click-to-copy buttons for every built-in asset + start of in-.rst file :resource: embeds elsewhere

Why?

  1. This makes it easier to answer the most common beginner questions:

    How do I use that specific asset?

  2. Add Liberation font family to Arcade #2477

  3. Make post-3.0 life easier

  4. The code is less bad than it was

    • Yes there are known issues I will fix later today
    • It's more maintainable now

What?

Rough versions of things we will improve on in future PRs:

  1. In-tile copy buttons:

    1. Find asset on page
    2. Click button
    3. Paste resource handle for file
  2. Liberation font family preview

  3. Various other fixes

* Create doc/_includes

* Move links.rst there

* Move the resource inclusion there using the include_file feature from the Vfs
* Add custom JS to the force-copy temp fix and clean up header

* Add custom JS call to target ezcopy class

* Add CSS for buttons

* Very ugly code for generating the buttons
* Wrap the literal and button in a span

* Add styling

* Remove indent argument from function likely to be removed soon
* Use iterators instead of non-stop modulo and variable references

* Simplify column detection: 1 column when n=1, 3 for fonts, 2 for all else

* Add arguments to allow passing in the value to the table generation from outside
* fix missing variable name in create_resources_path

* rename create_resources_path to path_as_resource_handle:
* s/quote(/html_quote(/g

* use better resource paths

* explain a few things better
* Start switching over config reading

* Partly decruft the methods
* Use Python's standard library to handle HTML escaping

* Remove custom html quote function

* Add prefix of handle string as table caption with CSS to make it match the copyables more
* Fix heading generation and start improving the ordering for auto-generation

* Fix the include ordering for the resources pages

* Add site-wide |Copy Button substitution

* Add rough instructions for the copy buttons based on feedback
* Remove code from .rst generation

* Remove CSS supporting the .. raw:: html for unknown file types
* Styles almost correctly with hover (inline is breaking)

* Add .doc-ui-example-dummy class intended to shut off UI behavior on dummy elements

* CSS changes to support the UI elements and on-page instructions

* Document some flaws better

* Add |Example Copy Button| substitution for Sphinx embeds
@pvcraven pvcraven merged commit 5a220f1 into development Jan 24, 2025
9 checks passed
@einarf einarf deleted the copy-button-and-resources branch January 26, 2025 10:56
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

Successfully merging this pull request may close these issues.

2 participants