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

Fix Rebel Engine API documentation not displaying images #31

Merged

Conversation

madmiraal
Copy link
Contributor

Currently, the Rebel Engine API documentation doesn't display images. Instead of images, there are links to images stored on GitHub; specifically https://raw.githubusercontent.com.

This PR enables images to be displayed in the Rebel Engine API documentation and embeds the images currently linked to on GitHub using the local copies stored on https://docs.rebeltoolbox.com.

For example, this is the Rebel Engine API Color class documentation:

Before After
Color-Before Color-After

Image files still need to be added independently to the RebelDocumentation repository, but they can now be referenced and embedded in the Rebel Engine API documentation using an [img] tag. The image tag follows the BBCode [img] tag format and includes the options supported by the DocUtils Image format used by Sphinx. Spinx is used to create the Rebel Toolbox documentation: https://docs.rebeltoolbox.com/. The [img] tag options included are alt height width scale align and target. In addition it includes a caption option to add the Sphinx figure caption below the image, and it supports the BBCode shorthand for specifying the image size. For example, to embed the image shown above: [img caption="Color constants cheatsheet"]/img/color_constants.png[/img]

Includes a complete refactor of make_rst.py (which has been renamed to rst_from_xml.py) used by RebelDocumentation to convert the RebelEngine API XML files to the Rebel Documentation API ReST files. The ReST files are used to create the Rebel Engine API documentation html files on https://docs.rebeltoolbox.com/. The refactor makes the script easier to understand and maintain; including adding new features such as enabling images in the API documentation.

@madmiraal madmiraal self-assigned this Jan 27, 2024
@DanielaOrtner DanielaOrtner self-requested a review January 27, 2024 19:35
Copy link
Contributor

@DanielaOrtner DanielaOrtner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What an improvement! Thanks for the good work. It's always best to have the images inline rather than having to go to another page.
Thanks :)

@DanielaOrtner DanielaOrtner merged commit 5597f82 into RebelToolbox:main Jan 30, 2024
13 checks passed
@madmiraal madmiraal deleted the update-documentation-image-links branch January 30, 2024 17:55
@madmiraal madmiraal added PR Type: Bug Fix Your current game should now work as expected. PR Type: Enhancement Your current game will work better. and removed bug labels May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR Type: Bug Fix Your current game should now work as expected. PR Type: Enhancement Your current game will work better.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants