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

Creating and updating a theme has many steps #34

Open
gabalafou opened this issue Feb 7, 2024 · 1 comment
Open

Creating and updating a theme has many steps #34

gabalafou opened this issue Feb 7, 2024 · 1 comment
Labels
type: enhancement 💅🏼 New feature or request

Comments

@gabalafou
Copy link
Contributor

Working on #33, this is the full set of steps I had to do in order to feel like I fully updated the repo when I updated a theme:

  1. Update the colors in the style.py file
  2. hatch run dev:create_css
  3. hatch run dev:render_html
  4. Pick and choose which updated files to git add, then git restore the irrelevant ones
  5. Update the theme's README file, which requires manually calculating new contrast values for the table in the README
  6. Open one of the example files under test/results/<theme-name>/ in my browser, take a screenshot, save it under a11y_pygments/<theme-name>/images/<theme-name>.png, and then update the link in the theme's README.

Seems to me that more of this could be automated, or at least better documented.

I also get the feeling that some of the file changes could be simplified. It looks like duplicate generated files are getting checked into the repo, for example:

@trallard
Copy link
Member

trallard commented Feb 8, 2024

yes! I have been wanting to automate a lot of these steps because there is indeed a looooot to do.

@trallard trallard added the type: enhancement 💅🏼 New feature or request label Feb 8, 2024
This was referenced Mar 26, 2024
Carreau pushed a commit that referenced this issue Mar 28, 2024
This PR is the second PR in a series to address #34.

This PR:

- Adds a new Python script to the repo under `scripts/` to generate
theme READMEs (in particular the contrast table in the README)
  - Also adds the command to the Hatch "dev" environment
- Updates each theme's README with the script
- Renames two screenshots for consistency
- Adds some color helpers 
- Excludes the scripts folder from the PyPI distribution and from the
"find all themes" function
- Updates the docs with instructions about how to run the script
gabalafou added a commit that referenced this issue Mar 28, 2024
### Purpose

This PR is the final PR to fix issue #34. (Although there will probably
be some cleanup PRs following this work.)

### Summary of changes

- Add Playwright to dev dependencies. (Also added setuptools, which I
think should have been there all along, since it is used by the
render_html script)
- Add Playwright post-install step (`playwright install`) to Hatch "dev"
environment config
- Run the render_html script when the update_readme_for_theme script is
called. (This regenerates the HTML samples of code syntax highlighting
for a given theme, which are saved in the `test/results/` directory.)
- Use Playwright in the update README script to take a screenshot of the
HTML page generated for a particular theme.

---------

Co-authored-by: M Bussonnier <bussonniermatthias@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement 💅🏼 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants