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

Update project description for HTML5 CSS #12080

Merged
merged 4 commits into from
Aug 15, 2022

Conversation

miketheman
Copy link
Member

As proposed in pypa/readme_renderer#249 , warehouse needs to support the HTML5 styles that will be emitted from the docutils html5 writer. Based on the existing test fixtures in that library, these are the necessary changes to add support for rendering correctly.

Commit messages have some more descriptions in them.

Caveat: I'm no Sass/SCSS expert, so if I've got it wrong, more than happy to take feedback and learn!

Docutils HTML5 writer has decided that the emitted style for inline
literals will no longer inherit the (deprecated) `tt` style, rather
place the onus on the author to declare what kind of style to apply to a
literal.

Refs: https://sourceforge.net/p/docutils/bugs/393/

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
docutils HTML5 writer adds `<p>` tags to cells in tables, adding
margins, and bloating the overall size.

Docutils has an inline TODO, contemplating removing this behavior:
https://sourceforge.net/p/docutils/code/HEAD/tree/tags/docutils-0.19/docutils/writers/_html_base.py#l1381

Until such time, inherit the same margins for the `th/td` attributes.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Docutils HTML5 changes the output for lists like `docinfo` and
`field-list` to no longer have `table` semantics, preferring to lean on
CSS to place and style them.

This isn't 100% the same as before, but it's close enough for a
reasonable display.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman requested a review from a team as a code owner August 14, 2022 20:41
@di di enabled auto-merge (squash) August 15, 2022 15:45
@di di merged commit 665eb50 into pypi:main Aug 15, 2022
@miketheman miketheman deleted the miketheman/css-docutils-html5 branch August 15, 2022 16:09
miketheman added a commit to miketheman/readme_renderer that referenced this pull request Aug 16, 2022
Convert the writer class to use HTML5 semantics.
Update allowed tags and attributes for HTML5 to pass the bleach cycle.

Refs: pypi/warehouse#12080
Resolves pypa#249

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
SamirPS pushed a commit to SamirPS/warehouse that referenced this pull request Aug 30, 2022
* feat: render inline literals as code

Docutils HTML5 writer has decided that the emitted style for inline
literals will no longer inherit the (deprecated) `tt` style, rather
place the onus on the author to declare what kind of style to apply to a
literal.

Refs: https://sourceforge.net/p/docutils/bugs/393/

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* fix: reduce margins included in table cells

docutils HTML5 writer adds `<p>` tags to cells in tables, adding
margins, and bloating the overall size.

Docutils has an inline TODO, contemplating removing this behavior:
https://sourceforge.net/p/docutils/code/HEAD/tree/tags/docutils-0.19/docutils/writers/_html_base.py#l1381

Until such time, inherit the same margins for the `th/td` attributes.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* feat: render description lists as grid items

Docutils HTML5 changes the output for lists like `docinfo` and
`field-list` to no longer have `table` semantics, preferring to lean on
CSS to place and style them.

This isn't 100% the same as before, but it's close enough for a
reasonable display.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants