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
Is this package abandoned? #19
Comments
@ccordoba12 Since there still appears to be interest in this package by others, unless there is a drop-in replacement, we should consider appointing a new community maintainer. If there's someone willing to contribute to help with basic maintenance, making releases and reviewing PRs, that would appear to be the responsible course of action rather than leaving it to rot. @ma-sadeghi @iwanb @scarabeusiv any interest? It likely wouldn't require much too much work for someone already familiar with the package (I'd offer to help, but I've never actually used it). |
@CAM-Gerlach I'm inclined to help, but not sure how much time it would require, as I'm not that familiar with the package. |
Sure, I have no problem with that. For now, it would only require to update things to work with the latest Sphinx version. |
Edit 1 the below has been updated after I solved the issue described initially 😄
@ccordoba12 thanks for this note! I was able to get docrepr to generate Setup: create a fresh conda environment: conda create -n sphinx-docrepr-stuff-issue
conda activate sphinx-docrepr-stuff-issue
conda install -c conda-forge sphinx numpy ipython Test: running the following script when inside the docrepr repo import docrepr # Set module options
from docrepr import sphinxify # html generator
from IPython.core.oinspect import Inspector # oinfo generator
import numpy as np
oinfo = Inspector().info(np.sin)
oinfo['name'] = 'sin'
url = sphinxify.rich_repr(oinfo)
print('file://' + url) immediately fails, but with a few small fixes, it does work! The git diff follows: diff --git a/docrepr/conf.py b/docrepr/conf.py
index 665ba42..6d94595 100644
--- a/docrepr/conf.py
+++ b/docrepr/conf.py
@@ -46,7 +46,7 @@ exclude_trees = ['.build']
# TODO: This role has to be set on a per project basis, i.e. numpy, sympy,
# mpmath, etc, use different default_role's which give different rendered
# docstrings. Setting this to None until it's solved.
-default_role = 'None'
+default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
@@ -65,10 +65,10 @@ html_style = 'default.css'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
-html_title = None
+html_title = "HTML_TITLE"
# A shorter title for the navigation bar. Default is the same as html_title.
-html_short_title = None
+html_short_title = "HTML_SHORT_TITLE"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
diff --git a/docrepr/sphinxify.py b/docrepr/sphinxify.py
index f806120..60ad57a 100644
--- a/docrepr/sphinxify.py
+++ b/docrepr/sphinxify.py
@@ -172,7 +172,7 @@ def init_template_vars(oinfo):
# Argspec
tmpl_vars['argspec'] = ''
- if oinfo['argspec'] is None:
+ if 'argspec' not in oinfo or oinfo['argspec'] is None:
argspec = getsignaturefromtext(oinfo['docstring'], oinfo['name'])
if argspec:
tmpl_vars['argspec'] = argspec
@@ -262,7 +262,9 @@ def sphinxify(docstring, srcdir, output_format='html', temp_confdir=False):
suffix = '.html'
else:
suffix = '.txt'
- output_name = base_name + suffix
+ from tempfile import mkdtemp
+ destdir = mkdtemp()
+ output_name = osp.join(destdir, 'docstring') + suffix
# This is needed so users can type \\ on latex eqnarray envs inside raw
# docstrings
@@ -295,8 +297,8 @@ def sphinxify(docstring, srcdir, output_format='html', temp_confdir=False):
# Create Sphinx app
doctreedir = osp.join(srcdir, 'doctrees')
- sphinx_app = Sphinx(srcdir, confdir, srcdir, doctreedir, output_format,
- confoverrides, status=None, warning=None,
+ sphinx_app = Sphinx(srcdir, confdir, destdir, doctreedir, output_format,
+ confoverrides,
freshenv=True, warningiserror=False, tags=None)
# Run the app
diff --git a/docrepr/templates/layout.html b/docrepr/templates/layout.html
index 48ac59b..0bc6a55 100644
--- a/docrepr/templates/layout.html
+++ b/docrepr/templates/layout.html
@@ -10,7 +10,7 @@
#}
{# Docstring text #}
-{% if warning %}
+{% if warning and warn_message %}
<div id="doc-warning">
{{warn_message}}
</div> The diff above contains:
Running the little script above produces the following output: Full output of Sphinx (contains a number of warnings but no errors)
I have some questions about some of the warnings encountered by Sphinx above—are they expected?—and I also have some concerns about the formatting of the but I think this is looking pretty good! What do you think? |
(Forgive me for pinging everyone on this thread, but I substantially rewrote my earlier comment to fix the issue I was encountering. Please re-read and feel free to share your feedback. Thanks!) |
Any chance this package will be updated any time soon? We want to use it as a dependency in our package, but it seems to need a bit of updating, couldn't get it to work.
The text was updated successfully, but these errors were encountered: