├── jupyter_disqus ├── tests │ ├── __init__.py │ └── test_app.py ├── __init__.py └── app.py ├── MANIFEST.in ├── .coveragerc ├── demo.gif ├── readthedocs.yml ├── .travis.yml ├── setup.py ├── .gitignore ├── LICENSE └── README.rst /jupyter_disqus/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | omit = jupyter_disqus/tests/* 3 | -------------------------------------------------------------------------------- /jupyter_disqus/__init__.py: -------------------------------------------------------------------------------- 1 | from .app import inject 2 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vwxyzjn/jupyter_disqus/HEAD/demo.gif -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | python: 2 | version: 3 3 | pip_install: true 4 | 5 | # For more fields that can be specified here, see: 6 | # http://docs.readthedocs.io/en/latest/yaml-config.html 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # This is a simple Travis config for a project that only needs to install pure 2 | # Python dependencies. For more complex setups, you can use conda on Travis: 3 | # http://conda.pydata.org/docs/travis.html 4 | 5 | language: python 6 | python: 7 | - "3.6" 8 | - "3.5" 9 | - "3.4" 10 | # Install any dependencies for running the tests: 11 | install: 12 | - pip install codecov pytest-cov 13 | - pip install -e . 14 | # command to run tests 15 | script: py.test --cov=jupyter_disqus --cov-config .coveragerc 16 | after_success: 17 | codecov 18 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | with open('README.rst') as f: 4 | readme = f.read() 5 | 6 | setup( 7 | name='jupyter_disqus', 8 | version='0.1.2', 9 | description='Add disqus to your jupyter notebook', 10 | long_description=readme, 11 | author='Costa Huang', 12 | author_email='costa.huang@outlook.com', 13 | install_requires=['IPython', 'htmlmin==0.1.12'], 14 | packages=['jupyter_disqus', 'jupyter_disqus.tests'], 15 | classifiers=[ 16 | 'License :: OSI Approved :: BSD License', 17 | 'Programming Language :: Python :: 3', 18 | ], 19 | url="https://github.com/vwxyzjn/jupyter_disqus" 20 | ) 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # Installer logs 29 | pip-log.txt 30 | pip-delete-this-directory.txt 31 | 32 | # Unit test / coverage reports 33 | htmlcov/ 34 | .tox/ 35 | .coverage 36 | .coverage.* 37 | .cache 38 | nosetests.xml 39 | coverage.xml 40 | *,cover 41 | .hypothesis/ 42 | 43 | # Translations 44 | *.mo 45 | *.pot 46 | 47 | # Sphinx documentation 48 | docs/_build/ 49 | 50 | #Ipython Notebook 51 | .ipynb_checkpoints 52 | 53 | \.mypy_cache/ 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-Present Shengyi (Costa) Huang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /jupyter_disqus/tests/test_app.py: -------------------------------------------------------------------------------- 1 | from jupyter_disqus.app import _format_disqus_code 2 | from unittest.mock import MagicMock 3 | 4 | def test_format_disqus_code(): 5 | assert _format_disqus_code( 6 | page_url="https://costahuang.me/SC2AI/", 7 | page_identifier="1f527ae5-5a59-4dc3-9bb0-d77c2ccf5cab", 8 | site_shortname="costahuang" 9 | ) == "