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 #4550: The align attribute of figure nodes becomes None by default #8690

Merged
merged 1 commit into from
Jan 17, 2021

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Jan 16, 2021

Feature or Bugfix

  • Refactoring

Purpose

  • To keep compatibility with the standard doctree model of docutils,
    this stops to use 'default' value as a default value of the align
    attribute for figure and table nodes.
  • refs: Tables should be centered by default. #4550

@tk0miya
Copy link
Member Author

tk0miya commented Jan 16, 2021

@brechtm Could you check this please?

… by default

To keep compatibility with the standard doctree model of docutils,
this stops to use 'default' value as a default value of the align
attribute for figure and table nodes.
@tk0miya tk0miya force-pushed the 4550_align_default branch from e69e458 to 3248bef Compare January 16, 2021 12:29
@brechtm
Copy link
Contributor

brechtm commented Jan 16, 2021

@brechtm Could you check this please?

Looks good to me, except for the one remark above.

@brechtm
Copy link
Contributor

brechtm commented Jan 17, 2021

One more thing that occurred to me. The code changes the doctree (adding the align attribute) in-place. I'm assuming this these changes aren't visible to other builders or saved (pickled) to the doctrees dir?

@tk0miya
Copy link
Member Author

tk0miya commented Jan 17, 2021

One more thing that occurred to me. The code changes the doctree (adding the align attribute) in-place. I'm assuming this these changes aren't visible to other builders or saved (pickled) to the doctrees dir?

Yes. I modified the attribute only inside the HTML writers (HTML4 and HTML5). So the change is not stored into the doctrees. And it does not affect other builders (except HTML-inherited-builders).

@tk0miya tk0miya merged commit 4cae0ec into sphinx-doc:master Jan 17, 2021
@tk0miya tk0miya deleted the 4550_align_default branch January 17, 2021 17:14
@tk0miya
Copy link
Member Author

tk0miya commented Jan 17, 2021

Merged.

@brechtm Thank you for reviewing!

jdknight added a commit to sphinx-contrib/confluencebuilder that referenced this pull request May 2, 2021
Sphinx has been refactoring [1][2] its implementation to adjust the use
of the `default` alignment back to `None`, to follow with docutils.
Adjusting a series of lines which rely on the `default` assignment as a
hint for default alignment, where now an unset alignment applies the
default alignment as well.

[1]: sphinx-doc/sphinx#4550 (comment)
[2]: sphinx-doc/sphinx#8690

Signed-off-by: James Knight <james.d.knight@live.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants