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
Conversation
There was a problem hiding this 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 }} |
There was a problem hiding this comment.
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__) |
There was a problem hiding this comment.
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)
There was a problem hiding this 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 }} | ||
""", |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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',
]
Thank you for quick review. 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 |
223b799
to
886e12e
Compare
A minimal theme extension generator discussed in #3649
Note: no docs and tests (working fine at my local!)