Skip to content

Revert copying files due to RTD issues #2522

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

Merged
merged 6 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/_includes/resources_Top-Level_Resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ This logo of the snake doubles as a quick way to test Arcade's resource handles.
.. raw:: html

<ol>
<li>Look down toward the Arcade logo below until you see the file name<li>
<li>Look down toward the Arcade logo below until you see the file name</li>
<li>Look to the right edge of the file name (<code class="docutils literal notranslate"><span class="pre">'logo.png'</span></code>)</li>
<li>There should be a copy button <(<div class="arcade-ezcopy doc-ui-example-dummy" style="display: inline-block;">
<li>There should be a copy button (<div class="arcade-ezcopy doc-ui-example-dummy" style="display: inline-block;">
<img src="/_static/icons/tabler/copy.svg"></div>) </li>
<li>Click or tap it.</li>
</ol>
Expand Down
13 changes: 8 additions & 5 deletions util/create_resources_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def indent( # pending: post-3.0 refactor # why would indent come after the tex
return new.getvalue()

# pending: post-3.0 cleanup, I don't have time to make this CSS nice right now.
COPY_BUTTON_PATH = "_static/icons/tabler/copy.svg"
COPY_BUTTON_PATH = "https://raw.githubusercontent.com/pythonarcade/arcade/refs/heads/development/doc/_static/icons/tabler/copy.svg"
#COPY_BUTTON_RAW = (DOC_ROOT / "_static/icons/tabler/copy.svg").read_text().strip() + "\n"


Expand All @@ -496,13 +496,15 @@ def html_copyable(
if string_quote_char:
value = f"{string_quote_char}{value}{string_quote_char}"
escaped = html.escape(value)
# src = src_kludge(COPY_BUTTON_PATH)
src = FMT_URL_REF_EMBED.format(COPY_BUTTON_PATH)
raw = (
f"<span class=\"resource-handle\">\n"
f" <code class=\"docutils literal notranslate\">\n"
f" <span class=\"pre\">{escaped}</span>\n"
f" </code>\n"
f" <button class=\"arcade-ezcopy\" data-clipboard-text=\"{resource_handle}\">\n"
f" <img src=\"/{src_kludge(COPY_BUTTON_PATH)}\"/>\n"
f" <img src=\"{COPY_BUTTON_PATH}\"/>\n"
# + indent(" " * 2, COPY_BUTTON_RAW) + # pending: post-3.0 cleanup
f" </button>\n"
f"</span>\n"
Expand Down Expand Up @@ -718,9 +720,9 @@ def start():
config = MEDIA_EMBED[suffix]
kind = config.get('media_kind')
mime_suffix = config.get('mime_suffix')
# file_path = FMT_URL_REF_EMBED.format(resource_path)
rel = path.relative_to(RESOURCE_DIR)
file_path = f"/_static/{str(rel)}"
file_path = FMT_URL_REF_EMBED.format(resource_path)
#rel = path.relative_to(RESOURCE_DIR)
#file_path = src_kludge(f"/_static/{str(rel)}")
out.write(f" {start()} - .. raw:: html\n\n")
out.write(indent(
" ", resource_copyable))
Expand All @@ -729,6 +731,7 @@ def start():
out.write(indent(" ",
# Using preload="none" is gentler on GitHub and readthedocs
f"<{kind} class=\"resource-thumb\" controls preload=\"none\">\n"
f" <source src=\"{file_path}\" type=\"{kind}/{mime_suffix}\">\n"
f" <source src=\"{src_kludge(file_path)}\" type=\"{kind}/{mime_suffix}\">\n"
f"</{kind}>\n\n"))

Expand Down
Loading