GithubHelp home page GithubHelp logo

pallets / pallets-sphinx-themes Goto Github PK

View Code? Open in Web Editor NEW
47.0 8.0 19.0 220 KB

Sphinx themes for Pallets and related projects.

License: BSD 3-Clause "New" or "Revised" License

Python 69.84% HTML 4.86% CSS 22.01% JavaScript 3.29%
sphinx sphinx-theme sphinx-extension python pallets

pallets-sphinx-themes's People

Contributors

davidfischer avatar davidism avatar dependabot[bot] avatar flying-sheep avatar garenchan avatar greyli avatar jmg-duarte avatar jugmac00 avatar kdeldycke avatar pre-commit-ci[bot] avatar relrod avatar untitaker avatar yuxiaoy1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pallets-sphinx-themes's Issues

In sidebar, add links to the reST sources (aka html_show_sourcelink).

This is not really a issue, its more a question ...

I guess html_show_sourcelink is not supported by pallets-sphinx-themes .. right?

If so and since the default of html_show_sourcelink is True, is it better to set

 html_show_sourcelink = False

to not copy sources into the dist folder _sources?

What should a PR add, changing the default to False or is it better to implement the function right away?

Move `.. click:example::` and `.. click:run::` implementation to `sphinx-click`

This is a proposal to move the .. click:example:: and .. click:run:: implementation to the aptly named sphinx-click project.

I would love to rely on these 2 directives to document my click-based projects. I found a workaround but adding pallets-sphinx-themes dependency on my project seems awkward, hence my proposal. Moving all Sphinx-related code to sphinx-click will allow for a better maintainership by decoupling it from pallets documentation own release cycles.

There is a mirror issue open on sphinx-click at: click-contrib/sphinx-click#110

Sticky version warning

Use position: sticky for the version warning. Add JavaScript to ensure anchor targets are not obscured by the floating header.

dark mode

I am requesting a dark mode version of the website and documentation. It's not about my personal style preference. It's a usability issue since I am presently dealing with cataracts.

A dark theme can be easier to read because it reduces light and improves contrast. An alternate solution would be having the ability to change the style.

I want to thank you for Flask. It's incredible.

Differentiate between Jinja filter and test names

The Jinja extension automatically generates the docs for the list of filters and tests, but doesn't do anything to distinguish the reference names. This causes collisions for things like float, which is both a filter and a test. Sphinx 3 started treating this as an error.

Support for Sphinx parallel build

I was trying out sphinx-build -j auto in the pytest repo to maybe speed up the docs build a bit. It fails with the following error:

NotImplementedError: merge_domaindata must be implemented in <class 'pallets_sphinx_themes.themes.click.domain.ClickDomain'> to be able to do parallel builds!

Link to merge_domaindata.

I haven't been able to complete a -j build so I'm not sure if it's actually worth the effort.

Build flask docs failed: ImportError: cannot import name 'DocVersion'

Environment

flask: master branch
pallets-sphinx-themes: v1.1.1

Error1

Traceback (most recent call last):
  File "e:\python 3.5\lib\site-packages\sphinx\config.py", line 161, in __init__
    execfile_(filename, config)
  File "e:\python 3.5\lib\site-packages\sphinx\util\pycompat.py", line 150, in execfile_
    exec_(code, _globals)
  File "conf.py", line 7, in <module>
    from pallets_sphinx_themes import DocVersion, ProjectLink, get_version
ImportError: cannot import name 'DocVersion'

Reason

Since pallets-sphinx-themes version 1.1.0, DocVersion api has not been exposed but also not deprecated.

Error2

When I solved the above problem, another error occurred.

Theme error:
no theme named 'flask' found (missing theme.conf?)

Reason

  1. flask docs' conf.py doesn't add pallets-sphinx-themes into its extensions

  2. pallets-sphinx-themes doesn't add sphinx.html_themes entry points.

see if we can remove the rtd docsearch_disabled flag

When RTD was working on their new search feature, we disabled it because the results it returned weren't as useful as Sphinx's search yet.

{%- if READTHEDOCS and not readthedocs_docsearch %}
<script>
if (typeof READTHEDOCS_DATA !== 'undefined') {
if (!READTHEDOCS_DATA.features) {
READTHEDOCS_DATA.features = {};
}
READTHEDOCS_DATA.features.docsearch_disabled = true;
}
</script>
{%- endif %}

I think we can disable this now, we can play around with the setting in one of the projects and compare the results to see if RTD search is okay to use now.

Sticky menus

I could not find any previous discussion about this subject.
I would suggest making the side-menus sticky in most themes.

The side menu usually holds the TOC, and when reading something at the bottom of a very long page (example), we need to scroll all the way up to find a link in the TOC. The default RTD theme has sticky menu, and I find this very convenient.

What do you think?

Strip ".x" suffix when parsing versions for sidebar

Currently using packaging.version.parse to determine which versions to mark latest. However, RTD uses the branch names, like 6.x, which don't parse as versions. Need to strip the suffix before parsing.

Incorrect canonical links on project website

On the flask website, every page has a tag with the canonical link for the page. However, the canonical link for a page (for example, https://flask.palletsprojects.com/en/2.0.x/foreword/) includes .html at the end (for example, https://flask.palletsprojects.com/en/2.0.x/foreword.html). The problem is that following the canonical link (with the .html) results in a 404. This seems to be true for all pages except for those ending /index.html (such as the home page, whose canonical link is https://flask.palletsprojects.com/en/2.0.x/index.html). I noticed this behavior when a friend shared a link to the website, and the browser used the canonical link, resulting in a 404.

This seems to be the best venue to report this, if not, please point me in the right direction.

2.10 is sorting below 2.9

The Jinja 2.10.x build on Read the Docs is showing "this is an old version, the latest is 2.9.x".

Extension error: Unknown event name: autodoc-skip-member

Hello!

So I followed the instructions and installed the theme via pip.

I then added the following to my conf.py file, as requested:

extensions = [
    'pallets_sphinx_themes'
]

html_theme = 'flask'

Now, when I run make clean; make html, the resulting error is:

Removing everything under 'build'...
Running Sphinx v1.6.6
making output directory...

Extension error:
Unknown event name: autodoc-skip-member
make: *** [html] Error 1

Any insights? I don't have any issues when running any of the default themes...

Search on Flask/Werkzeug/jinja... website is broken (redirect loop)

I'm not sure this is the right place to raise this issue, but the search feature seems to be broken on the documentation websites of Flask, Werkzeug, Jinja, ...

e.g. if I search for "flask" on the flask doc website: get this result page:
https://flask.palletsprojects.com/en/2.0.x/search/?q=flask

the first hit is for example "flask (Python module, in API)", linking to url https://flask.palletsprojects.com/en/2.0.x/search/api/?highlight=flask#module-flask

When I click that link, my browser (Firefox) complains with "The page isn't redirecting properly". In Chromium I get "flask.palletsprojects.com redirected you too many times.". Chromium suggest to clear my cookies, but that does not help.

seems like the page is redirecting to itself:

$ curl -I 'https://flask.palletsprojects.com/en/2.0.x/search/api/?highlight=flask#module-flask'
HTTP/1.1 302 Found
...
Location: https://flask.palletsprojects.com/en/2.0.x/search/api/?highlight=flask
...

Extension error on sphinx-build: cannot import name pass_context from jinja2

Hi, I am trying to add sphinx documentation to my project https://github.com/jwg4/flask-selfdoc (so the documentation is currently totally minimal. I was able to build the docs by running sphinx-build, however after adding "pallets_sphinx_themes" as an extension in docs/conf.py, setting the theme to 'flask' and installing pallets-sphinx-themes, I can no longer build the docs, as follows:

jack@yyy:~/flask-selfdoc $ poetry run sphinx-build -b html docs/ docs/_build/html
Running Sphinx v4.4.0

Extension error:
Could not import extension pallets_sphinx_themes (exception: cannot import name 'pass_context' from 'jinja2' (/home/jack/.cache/pypoetry/virtualenvs/flask-selfdoc-vTLo-IC6-py3.8/lib/python3.8/site-packages/jinja2/__init__.py))

I'm using Python 3.8.9, the attached poetry.lock shows all my dev environment dependencies including sphinx, jinja and this project.

poetry.lock.txt

I can try and reproduce minimally without all the other packages, but I wanted to check first in case I'm doing something obviously wrong. Thanks!

ModuleNotFoundError: No module named 'packaging'

Traceback (most recent call last):
  File "/home/travis/build/garenchan/werkzeug/.tox/docs-html/lib/python3.6/site-packages/sphinx/config.py", line 157, in __init__
    execfile_(filename, config)
  File "/home/travis/build/garenchan/werkzeug/.tox/docs-html/lib/python3.6/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
    exec_(code, _globals)
  File "conf.py", line 2, in <module>
    from pallets_sphinx_themes import ProjectLink, get_version
  File "/home/travis/build/garenchan/werkzeug/.tox/docs-html/lib/python3.6/site-packages/pallets_sphinx_themes/__init__.py", line 15, in <module>
    from .versions import load_versions
  File "/home/travis/build/garenchan/werkzeug/.tox/docs-html/lib/python3.6/site-packages/pallets_sphinx_themes/versions.py", line 7, in <module>
    from packaging import version as pv
ModuleNotFoundError: No module named 'packaging'

pallets-sphinx-themes uses packaging library. But packaging may not be installed.

I know newest sphinx depends on packaging but versions older than 1.7.0 not.

Fix image responsiveness

Insert an image using the .. image:: directive. When the page is resized so that it goes into the mobile layout, the image is squished horizontally. I think this is due to a conflict between the theme CSS and the inline CSS the directive inserts into the image tag.

.. image:: _static/click-logo.png
    :align: center
    :scale: 50%
    :target: https://palletsprojects.com/p/click/

The fix may need to be pushed up to Sphinx after fixing it here.

Change the font for better readability

The current font is hard to read, and it makes people feel tired when reading for a long time.

Here is a comparison between the current font and a font that has better readability.

The current font:

flask-font-old

The font with Optima, Segoe, "Segoe UI", Candara, Calibri, Arial (this may not the best font to use, just as an example):

flask-font-new

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.