-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial improved click-to-copy for resources page (#2514)
* WIP: face name and table generation * HIDEOUS code * WIP-ish with tiled images * Copyables copy but too wide and ugly. * Move resources info sections into includes files * Create doc/_includes * Move links.rst there * Move the resource inclusion there using the include_file feature from the Vfs * Move ref check to function for it * WIP we have non-huge copy buttons * 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 * WIP commit: seems to render correctly * Clean up table body generation * Move image tile to new function * Add unknown file handling and clean up more * More indents * Add first draft of inlinable literals for Arcade * Wrap the literal and button in a span * Add styling * Remove indent argument from function likely to be removed soon * Move and comment some things * Quote fix + explain how / why it works * Remove kludges and improve column durability * 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 * Improve clarity and durability for resource paths * fix missing variable name in create_resources_path * rename create_resources_path to path_as_resource_handle: * Fix wrong quoting behavior for copyable embeds * s/quote(/html_quote(/g * use better resource paths * explain a few things better * Partly switch over to a clean nested config dict * Start switching over config reading * Partly decruft the methods * Remove cruft config storage replaced in last commit * Re-enable resource handle prefix as table caption * 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 * Clean imports, constants, and commented-out code * Whitespace + more redundancies removed * Encapsulate font data parsing from filenames * Unify media embeds * Fix header row generation + move a few things * Fix include behavior + add copy button directions * 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 * Encapsulate table header + header row behavior * Some more consolidation * Separate concerns for table body, header, and conf * Add basic file tile thumbing (ty @DigiDuncan) * Remove old thumbnailing for unknown files * Remove code from .rst generation * Remove CSS supporting the .. raw:: html for unknown file types * Improve example copy button (almost-correct style) * 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 * Add fall state as a stop-gap for the blue alien * Remove more cruft * Remove unused code + extra whitespace in a regex * Remove linking experiment for now * Switch glsl shader listing off again * Doc cross-ref trick works sorta?
- Loading branch information
Showing
16 changed files
with
734 additions
and
222 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Arcade includes an number of themed image sets to help you get started | ||
making specific types of games. Some of these help you complete the tutorials | ||
while others are general-purpose prototyping tools. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. figure:: images/fonts_blue.png | ||
:align: center | ||
:alt: The bundled Kenney.nl fonts. | ||
|
||
.. Put the text *after* the CSS, or add <br> via .. raw:: html blocks | ||
.. since the CSS may be broken. | ||
Arcade includes the following fonts from `Kenney.nl's font pack <https://kenney.nl/assets/kenney-fonts>`_ | ||
are available using the path and filenames below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.. figure:: images/fonts_liberation.png | ||
:alt: The bundled Liberation font family trio. | ||
:align: center | ||
|
||
.. Put the text *after* the CSS, or add <br> via .. raw:: html blocks | ||
.. since the CSS may be broken. | ||
Arcade also includes the Liberation font family. This trio is designed and | ||
licensed specifically to be a portable, drop-in set of substitutes for Times, Arial, | ||
and Courier fonts. It uses the proven, commercial-friendly `SIL Open Font License`_. | ||
|
||
To use these fonts, you may use either approach: | ||
|
||
* load files for specific variants via :py:func:`arcade.load_font` | ||
* load all variants at once with :py:func:`arcade.resources.load_liberation_fonts`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This logo of the snake doubles as a quick way to test Arcade's resource handles. | ||
|
||
#. Mouse over the copy button (|Example Copy Button|) below | ||
#. It should change color to indicate you've hovered | ||
#. Click to copy | ||
|
||
Paste in your favorite text editor! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.