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

Tidy up whitespace #69

Merged
merged 1 commit into from Oct 22, 2022
Merged

Tidy up whitespace #69

merged 1 commit into from Oct 22, 2022

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Oct 17, 2022

Before

The og meta tags have no indent and are double spaced:

<!doctype html>
<html class="no-js">
  <head><meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta property="og:title" content="sphinxext-opengraph" />
  
<meta property="og:type" content="website" />
  
<meta property="og:url" content="index.html" />
  
<meta property="og:description" content="Build Code style: black Sphinx extension to generate OpenGraph metadata (https://ogp.me/) Installation: python -m pip install sphinxext-opengraph Usage: Just add sphinxext.opengraph to your extensi..." />
  <link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" />

    <meta name="generator" content="sphinx-4.2.0, furo 2021.11.12.1"/>
        <title>sphinxext-opengraph 1.0 documentation</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=cb850144ff767e23c5b2a31c47cdfe5847ae013d" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=0af69da206d614734f649b27d4cdc2dd6c31f41d" />

https://sphinxext-opengraph.readthedocs.io/en/latest/

After

Give them four-space indents and only a single newline:

<!doctype html>
<html class="no-js">
  <head><meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
    <meta property="og:title" content="sphinxext-opengraph" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="index.html" />
    <meta property="og:description" content="Build Code style: black Sphinx extension to generate OpenGraph metadata (https://ogp.me/) Installation: python -m pip install sphinxext-opengraph Usage: Just add sphinxext.opengraph to your extensi..." />
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" />

    <meta name="generator" content="sphinx-4.2.0, furo 2021.11.12.1"/>
        <title>sphinxext-opengraph 1.0 documentation</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=cb850144ff767e23c5b2a31c47cdfe5847ae013d" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=0af69da206d614734f649b27d4cdc2dd6c31f41d" />

@TheTripleV
Copy link
Member

I agree that the double spacing should be fixed.

However, I don't think that the indent issue can be solved by whitespace padding. Isn't the correct indent depth based off of the theme template? So it will be wrong depending on the theme used?

@hugovk
Copy link
Contributor Author

hugovk commented Oct 21, 2022

Yes, I guess so.

We should at least have a consistent indent, whether we use zero, two or four spaces.


Looks like the default Sphinx theme uses four spaces:

Furo uses four:

sphinx_rtd_theme uses two:

python-docs-theme extends the default Sphinx theme and uses four spaces for their single meta addition:

@TheTripleV
Copy link
Member

Ah, that's where I noticed the discrepancy. The documentation this extension was created for uses sphinx_rtd_theme while this extension itself uses furo.

I think using zero would be best then, as it doesn't affect the output and makes the code easiest to read.

@hugovk
Copy link
Contributor Author

hugovk commented Oct 22, 2022

Sounds good, updated with zero space indent:

<!doctype html>
<html class="no-js">
  <head><meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta property="og:title" content="sphinxext-opengraph" />
<meta property="og:type" content="website" />
<meta property="og:url" content="index.html" />
<meta property="og:description" content="Build Code style: black Sphinx extension to generate OpenGraph metadata (https://ogp.me/) Installation: python -m pip install sphinxext-opengraph Usage: Just add sphinxext.opengraph to your extensi..." />
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" />

    <meta name="generator" content="sphinx-4.5.0, furo 2021.11.12.1"/>
        <title>sphinxext-opengraph 1.0 documentation</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=cb850144ff767e23c5b2a31c47cdfe5847ae013d" />
    <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=0af69da206d614734f649b27d4cdc2dd6c31f41d" />

@TheTripleV TheTripleV merged commit abfc315 into wpilibsuite:main Oct 22, 2022
@hugovk hugovk deleted the whitespace branch October 22, 2022 15:37
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.

None yet

2 participants