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
Switch to entrypoint-based themes handling #829
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good move! (and docs 👍 )
docs/creating-theme.md
Outdated
- reuses without image (`reuse.png`) | ||
- territory without logo or flag (`territory.png`) | ||
|
||
Then your free to add any static assets reuired by your theme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reQuired + point at the end
docs/creating-theme.md
Outdated
<link rel="shortcut icon" href="{{ theme_static('img/favicon.png') }}"> | ||
{% endblock %} | ||
``` | ||
You can reference static assets from you theme with the `theme_static` global function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of your theme
docs/creating-theme.md
Outdated
You can reference static assets from you theme with the `theme_static` global function. | ||
|
||
!!! note | ||
Don't forget to call `{{ super() }}` to includes the original block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include without an S
docs/creating-theme.md
Outdated
|
||
### Hooks | ||
|
||
You're theme can also customize some behavior be using hooks in you ``__init__.py``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YouR + behaviors + bY + youR => Your theme can also customize some behaviors by using hooks in your ``__init__.py``.
docs/creating-theme.md
Outdated
### Hooks | ||
|
||
You're theme can also customize some behavior be using hooks in you ``__init__.py``. | ||
Currently there is 2 available hooks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there ARE
## Publish and use | ||
|
||
Once your theme is ready, you can publish it on [PyPI][] to share it to the world | ||
(and notify us so we can be glad of your work). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and link to your theme from the documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a "Known themes" section with a note on contributions
CHANGELOG.md
Outdated
@@ -8,6 +8,9 @@ | |||
[Flask-Security-Fork](https://pypi.python.org/pypi/Flask-Security-Fork) | |||
[#813](https://github.com/opendatateam/udata/pull/813) | |||
- Ensure URLs are stripped [#823](https://github.com/opendatateam/udata/pull/823) | |||
- Themes are now entrypoint-based [#829](https://github.com/opendatateam/udata/pull/829). | |||
This is now documented, see [the related documention](https://udata.readthedocs.io/en/stable/creating-theme/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now
is used twice, I'd remove the second one.
docs/creating-theme.md
Outdated
### `setup.py` | ||
|
||
The `setup.py` is a classic python `setup.py` file. | ||
The only requirements is that you properly expose the udata theme packaging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requirement without an S
docs/creating-theme.md
Outdated
|
||
### Static assets | ||
|
||
The `static` should contains at least 2 files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contain without an S
docs/creating-theme.md
Outdated
The `static` should contains at least 2 files: | ||
|
||
- `theme.css` which is loaded automatically on every page | ||
- `admin.css` which is loaded automatically on on the amdin page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin (typo on second occurrence)
@davidbgk Good to merge ? |
docs/creating-theme.md
Outdated
- reuses without image (`reuse.png`) | ||
- territory without logo or flag (`territory.png`) | ||
|
||
Then your free to add any static assets required by your theme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are
This PR switch to entrypoint-based themes handling as it offers many advantages:
There theming process has also been documented.