Giter Site home page Giter Site logo

robpol86 / sphinx-disqus Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 16.0 122 KB

Embed Disqus comments in Sphinx documents/pages.

Home Page: https://sphinx-disqus.readthedocs.io

License: BSD 2-Clause "Simplified" License

Python 74.16% JavaScript 4.04% Makefile 21.80%
sphinx-extension disqus-comments sphinx disqus

sphinx-disqus's Introduction

sphinx-disqus

Embed Disqus comments in Sphinx documents/pages.

  • Python 3.6, 3.7, 3.8, and 3.9 supported on Linux, macOS, and Windows.

๐Ÿ“– Full documentation: https://sphinx-disqus.readthedocs.io

Github-CI Coverage Status Documentation Status Code style: black PyPI PyPI Downloads

Quickstart

To install run the following:

pip install sphinx-disqus

To use in Sphinx simply add to your conf.py:

extensions = ["sphinx_disqus.disqus"]
disqus_shortname = "my-cool-project"

Also add this to any document you wish to have comments:

.. disqus::

sphinx-disqus's People

Contributors

rmk135 avatar robpol86 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

sphinx-disqus's Issues

Build fails when ..disquss:: is added to index.

I have ..disquss:: added to all my pages.
When I add it to the index.rst, the build fails with the traceback is below:

Running Sphinx v1.4.8
making output directory...
DOC_DIR: /home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/checkouts/latest/docs
ROOT_DIR: /home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/checkouts/latest
[ERROR] No module named 'clr'
[WARNING] Could not Revit Document. Will Import Sphinx Compat Vars
[CRITICAL] Could Not load Forms dependencies
[WARNING] No module named 'forms'
loading translations [en]... done
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [readthedocssinglehtmllocalmedia]: all documents
updating environment: 15 added, 0 changed, 0 removed
reading sources... [  6%] base
reading sources... [ 13%] collector
reading sources... [ 20%] dynamo
reading sources... [ 26%] element
reading sources... [ 33%] enumeration
reading sources... [ 40%] exceptions
reading sources... [ 46%] forms
[ERROR] Import Error: No module named 'clr'
reading sources... [ 53%] globals
reading sources... [ 60%] index
reading sources... [ 66%] known_issues
reading sources... [ 73%] revitpythonshell
reading sources... [ 80%] selection
reading sources... [ 86%] tests
reading sources... [ 93%] transaction
reading sources... [100%] utils

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
assembling single document... 
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/cmdline.py", line 244, in main
    app.build(opts.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/application.py", line 297, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 246, in build_update
    self.build(['__all__'], to_build)
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 322, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/builders/html.py", line 1050, in write
    doctree = self.assemble_doctree()
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/builders/html.py", line 973, in assemble_doctree
    tree = inline_all_toctrees(self, set(), master, tree, darkgreen, [master])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/util/nodes.py", line 245, in inline_all_toctrees
    tree = tree.deepcopy()
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in deepcopy
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in <listcomp>
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in deepcopy
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in <listcomp>
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in deepcopy
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in <listcomp>
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in deepcopy
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1008, in <listcomp>
    copy.extend([child.deepcopy() for child in self.children])
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/docutils/nodes.py", line 1007, in deepcopy
    copy = self.copy()
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/util/nodes.py", line 299, in _new_copy
    newnode = self.__class__(self.rawsource, **self.attributes)
TypeError: __init__() got an unexpected keyword argument 'dupnames'

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/revitpythonwrapper/envs/latest/local/lib/python3.5/site-packages/sphinx/util/nodes.py", line 299, in _new_copy
    newnode = self.__class__(self.rawsource, **self.attributes)
TypeError: __init__() got an unexpected keyword argument 'dupnames'
The full traceback has been saved in /tmp/sphinx-err-_rlco9qy.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug rep

Failure on Sphinx v6.2.1

This extension does not seem to work on a more recent version of Sphinx. There is an issue when creating the disqus_shortname config value. And it happens regardless of whether I set the value in conf.py or not.

It errors out with an ExtensionError ("Config value 'disqus_shortname' already present").

Here is what my venv looks like:

ablog==0.11.5
accessible-pygments==0.0.4
alabaster==0.7.13
Babel==2.12.1
beautifulsoup4==4.12.2
certifi==2023.7.22
charset-normalizer==3.2.0
docutils==0.19
feedgen==0.9.0
idna==3.4
imagesize==1.4.1
insegel==1.3.1
invoke==2.2.0
Jinja2==3.1.2
livereload==2.6.3
lxml==4.9.3
markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdit-py-plugins==0.4.0
mdurl==0.1.2
myst-parser==2.0.0
packaging==23.1
pydata-sphinx-theme==0.13.3
Pygments==2.16.1
python-dateutil==2.8.2
PyYAML==6.0.1
requests==2.31.0
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.5
Sphinx==6.2.1
sphinx-book-theme==1.0.1
sphinx-disqus==1.2.0
sphinx-favicon==1.0.1
sphinx-notfound-page==1.0.0
sphinx-sitemap==2.5.1
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-serializinghtml==1.1.9
tornado==6.3.3
typing_extensions==4.7.1
urllib3==2.0.4
watchdog==3.0.0

And here is the stack trace right up to the moment when the exception is thrown:

File "[...]/sphinxhome/venv/bin/sphinx-build", line 8, in <module>
    sys.exit(main())
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/cmd/build.py", line 319, in main
    return make_main(argv)
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/cmd/build.py", line 199, in make_main
    return make_mode.run_make_mode(argv[1:])
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/cmd/make_mode.py", line 166, in run_make_mode
    return make.run_generic_build(args[0])
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/cmd/make_mode.py", line 154, in run_generic_build
    return build_main(args + opts)
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/application.py", line 229, in __init__
    self.setup_extension(extension)
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/application.py", line 404, in setup_extension
    self.registry.load_extension(self, extname)
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/registry.py", line 455, in load_extension
    metadata = setup(app)
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx_disqus/disqus.py", line 122, in setup
    app.add_config_value("disqus_shortname", None, True)
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/application.py", line 536, in add_config_value
    self.config.add(name, default, rebuild, types)
  File "[...]/sphinxhome/venv/lib/python3.11/site-packages/sphinx/config.py", line 309, in add
    traceback.print_stack()

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.