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

Add sphinx-theme-ext-gen command #3659

Closed

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Apr 23, 2017

A minimal theme extension generator discussed in #3649

Note: no docs and tests (working fine at my local!)

@tk0miya tk0miya added api:cmdline type:proposal a feature suggestion labels Apr 23, 2017
@tk0miya tk0miya added this to the 1.6 milestone Apr 23, 2017
Copy link
Member

@shimizukawa shimizukawa left a comment

Choose a reason for hiding this comment

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

commented.

include_package_data=True,
entry_points="""
[sphinx.html_themes]
{{ name }} = sphinxcontrib.themes.{{ name }}
Copy link
Member

Choose a reason for hiding this comment

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

Nowadays, I felt that namespace packages are fragile.
Namespace is nested. Sometime deep directory structure annoying me.
Namespace is complex.
Namespace __init__.py is ugly.
For this reason, I think that sphinxtheme_{{ name }} is better than namespace package.

USAGE = ('Sphinx v%s\n'
'Usage: %%prog [options] [name]\n' % __display_version__)

parser = optparse.OptionParser(USAGE, version='Sphinx v%s' % __display_version__)
Copy link
Member

Choose a reason for hiding this comment

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

Let's use argparse
There is an issue that replacing optparse with argparse: #3259.
IMO, it seems unnecessary to use optparse with newly introduced code.
(It's ok to release b1 as it is and replace it with argparse in b2)

Copy link
Member

@shimizukawa shimizukawa left a comment

Choose a reason for hiding this comment

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

updated

entry_points="""
[sphinx.html_themes]
{{ name }} = sphinxcontrib.themes.{{ name }}
""",
Copy link
Member

Choose a reason for hiding this comment

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

IMPORTANT: If we provide "namespace package" layout, namespace_packages is needed.

namespace_packages=['sphinxcontrib', 'sphinxcontrib.themes'],


setup(
name='sphinxcontrib-themes-{{ name }}',
version='1.0',
Copy link
Member

Choose a reason for hiding this comment

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

It would be better if classifiers is provided:

classifiers = [
    'Framework :: Sphinx',
    'Framework :: Sphinx :: Theme',
]

@tk0miya
Copy link
Member Author

tk0miya commented Apr 23, 2017

Thank you for quick review.
I understand namespace is complex and confusable. But, personally, I prefer to the namespace machanism.

BTW, current implementation is too young and hacky. So it is needed to improve in fast cycle. I feel the release cycle of sphinx-core is too slow to grow up this. so I'd like to grow this tool as a separated package like sphinx-intl.

@tk0miya tk0miya modified the milestones: some future version, 1.6 Apr 23, 2017
@tk0miya tk0miya force-pushed the 3649_theme_extension_generator branch from 223b799 to 886e12e Compare August 3, 2020 14:43
@tk0miya tk0miya closed this Jan 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2021
@AA-Turner AA-Turner removed this from the some future version milestone Sep 29, 2022
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.

None yet

3 participants