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

Clean up stuff and migrate docs to MyST-Parser #879

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

ichard26
Copy link
Member

@ichard26 ichard26 commented Apr 15, 2021

  • Migrate markdown documentation to use MyST-Parser since recommonmark
    is going away.

    • The "ReStructuredText syntax in Markdown" feature once provided by
      recommonmark.AutoStructify has been replaced with MyST-Parser's syntax
      extensions
    • Fix the heading depths (i.e. remove a single # from most headers)
      because MyST-Parser was emitting warnings
    • Redo the Sphinx configuration to use the new parser
  • Remove the test and doc_build extra installs because they are
    developer-facing and duplicating them doesn't make sense.

  • Remove sphinx_rtd_theme from the doc_build tox environment since
    it's unnecessary

  • Remove support for the following HTML themes in the Sphinx configuration:
    cloud_sptheme,sphinx_bootstrap_theme, guzzle_sphinx_theme, sphinx_rtd_theme.
    Only pypa_theme was ever actually being used.

Resolves GH-878.

- Migrate markdown documentation to use MyST-Parser since recommonmark
  is going away.
  - The "ReStructuredText syntax in Markdown" feature once provided by
    recommonmark.AutoStructify has been replaced with MyST-Parser's syntax
    extensions
  - Fix the heading depths (i.e. remove a single `#` from most headers)
    because MyST-Parser was emitting warnings
  - Redo the Sphinx configuration to use the new parser

- Remove the `test` and `doc_build` extra installs because they are
  developer-facing and duplicating them doesn't make sense.

- Remove `sphinx_rtd_theme` from the `doc_build` tox environment since
  it's unnecessary

- Remove support for the following HTML themes in the Sphinx configuration:
  cloud_sptheme,sphinx_bootstrap_theme, guzzle_sphinx_theme, sphinx_rtd_theme.
  Only pypa_theme was ever actually being used.
@cooperlees cooperlees self-requested a review April 15, 2021 23:09
Copy link
Contributor

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

All LGTM. CI will be the merge factor here :D

Comment on lines -266 to +200
available_theme_settings["pypa"] = {}
available_theme_settings["pypa"]["theme"] = "pypa_theme"
available_theme_settings["pypa"]["path"] = []
available_theme_settings["pypa"]["options"] = {}
html_theme = "pypa_theme"
except ImportError:
pass

selected_theme = os.environ.get("SPHINX_THEME", available_themes[0])
if selected_theme not in available_themes:
selected_theme = available_themes[0]
print(f"SPHINX_THEME is not installed, using {selected_theme!r} theme")

html_theme = available_theme_settings[selected_theme]["theme"]
html_theme_path = available_theme_settings[selected_theme]["path"]
if available_theme_settings[selected_theme].get("options", None):
html_theme_options = available_theme_settings[selected_theme]["options"]
print("WARNING: 'pypa_theme' isn't available, falling back to 'default' HTML theme")
html_theme = "default"
Copy link
Contributor

Choose a reason for hiding this comment

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

Much more sane! Thanks.

@codecov
Copy link

codecov bot commented Apr 15, 2021

Codecov Report

Merging #879 (258d324) into master (1fc32d8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #879   +/-   ##
=======================================
  Coverage   79.18%   79.18%           
=======================================
  Files          15       15           
  Lines        2234     2234           
  Branches      325      325           
=======================================
  Hits         1769     1769           
  Misses        346      346           
  Partials      119      119           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fc32d8...258d324. Read the comment docs.

@cooperlees cooperlees merged commit c0a9fcd into pypa:master Apr 16, 2021
@ichard26 ichard26 deleted the migrate-and-clean-up-docs branch April 16, 2021 13:51
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.

Convert Docs from recommonmark to MyST-Parser
2 participants