Skip to content

Commit cda4761

Browse files
authored
Revert copying files due to RTD issues (#2522)
* RTD remap trick since sphinx hides the config * Comments + we are no longer asking nicely to copy files * Fix again * fix * Fix more
1 parent a8d65f9 commit cda4761

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

doc/_includes/resources_Top-Level_Resources.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ This logo of the snake doubles as a quick way to test Arcade's resource handles.
33
.. raw:: html
44

55
<ol>
6-
<li>Look down toward the Arcade logo below until you see the file name<li>
6+
<li>Look down toward the Arcade logo below until you see the file name</li>
77
<li>Look to the right edge of the file name (<code class="docutils literal notranslate"><span class="pre">'logo.png'</span></code>)</li>
8-
<li>There should be a copy button <(<div class="arcade-ezcopy doc-ui-example-dummy" style="display: inline-block;">
8+
<li>There should be a copy button (<div class="arcade-ezcopy doc-ui-example-dummy" style="display: inline-block;">
99
<img src="/_static/icons/tabler/copy.svg"></div>) </li>
1010
<li>Click or tap it.</li>
1111
</ol>

util/create_resources_listing.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def indent( # pending: post-3.0 refactor # why would indent come after the tex
484484
return new.getvalue()
485485

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

490490

@@ -496,13 +496,15 @@ def html_copyable(
496496
if string_quote_char:
497497
value = f"{string_quote_char}{value}{string_quote_char}"
498498
escaped = html.escape(value)
499+
# src = src_kludge(COPY_BUTTON_PATH)
500+
src = FMT_URL_REF_EMBED.format(COPY_BUTTON_PATH)
499501
raw = (
500502
f"<span class=\"resource-handle\">\n"
501503
f" <code class=\"docutils literal notranslate\">\n"
502504
f" <span class=\"pre\">{escaped}</span>\n"
503505
f" </code>\n"
504506
f" <button class=\"arcade-ezcopy\" data-clipboard-text=\"{resource_handle}\">\n"
505-
f" <img src=\"/{src_kludge(COPY_BUTTON_PATH)}\"/>\n"
507+
f" <img src=\"{COPY_BUTTON_PATH}\"/>\n"
506508
# + indent(" " * 2, COPY_BUTTON_RAW) + # pending: post-3.0 cleanup
507509
f" </button>\n"
508510
f"</span>\n"
@@ -718,9 +720,9 @@ def start():
718720
config = MEDIA_EMBED[suffix]
719721
kind = config.get('media_kind')
720722
mime_suffix = config.get('mime_suffix')
721-
# file_path = FMT_URL_REF_EMBED.format(resource_path)
722-
rel = path.relative_to(RESOURCE_DIR)
723-
file_path = f"/_static/{str(rel)}"
723+
file_path = FMT_URL_REF_EMBED.format(resource_path)
724+
#rel = path.relative_to(RESOURCE_DIR)
725+
#file_path = src_kludge(f"/_static/{str(rel)}")
724726
out.write(f" {start()} - .. raw:: html\n\n")
725727
out.write(indent(
726728
" ", resource_copyable))
@@ -729,6 +731,7 @@ def start():
729731
out.write(indent(" ",
730732
# Using preload="none" is gentler on GitHub and readthedocs
731733
f"<{kind} class=\"resource-thumb\" controls preload=\"none\">\n"
734+
f" <source src=\"{file_path}\" type=\"{kind}/{mime_suffix}\">\n"
732735
f" <source src=\"{src_kludge(file_path)}\" type=\"{kind}/{mime_suffix}\">\n"
733736
f"</{kind}>\n\n"))
734737

0 commit comments

Comments
 (0)