├── tests ├── __init__.py └── test_slackbot.py ├── .gitmodules ├── setup.cfg ├── flask_slackbot ├── __init__.py ├── exceptions.py └── base.py ├── tox.ini ├── .travis.yml ├── examples └── myapp.py ├── .gitignore ├── setup.py ├── docs ├── index.rst ├── make.bat ├── Makefile └── conf.py └── README.rst /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "docs/_themes"] 2 | path = docs/_themes 3 | url = https://github.com/mitsuhiko/flask-sphinx-themes.git 4 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = --cov flask_slackbot --pep8 3 | pep8ignore = 4 | docs/* ALL 5 | 6 | [wheel] 7 | universal=1 8 | -------------------------------------------------------------------------------- /flask_slackbot/__init__.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from .base import SlackBot 3 | from .exceptions import SlackTokenError 4 | 5 | 6 | __all__ = ['SlackBot', 'SlackTokenError'] 7 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27,py33,py34,pypy 3 | [testenv] 4 | deps= 5 | flask 6 | slacker 7 | pytest 8 | pytest-cov 9 | pytest-pep8 10 | commands = py.test 11 | -------------------------------------------------------------------------------- /flask_slackbot/exceptions.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | class SlackTokenError(Exception): 3 | 4 | def __init__(self, msg): 5 | self.msg = msg 6 | 7 | 8 | class NoSlackerError(Exception): 9 | 10 | def __init__(self, msg): 11 | self.msg = msg 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.7" 4 | - "3.3" 5 | - "3.4" 6 | - "pypy" 7 | install: 8 | - "pip install . --use-mirrors" 9 | - "pip install pytest-cov pytest-pep8 coveralls --use-mirrors" 10 | script: py.test 11 | after_success: 12 | coveralls 13 | -------------------------------------------------------------------------------- /examples/myapp.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from flask import Flask 3 | 4 | from flask_slackbot import SlackBot 5 | 6 | 7 | app = Flask(__name__) 8 | app.config['SLACK_TOKEN'] = 'Your token here' 9 | # if you need to use slacker you should give a slack chat token 10 | app.config['SLACK_CHAT_TOKEN'] = 'Your slack chat token' 11 | app.config['SLACK_CALLBACK'] = '/slack_callback' 12 | app.debug = True 13 | slackbot = SlackBot(app) 14 | 15 | 16 | def fn1(kwargs): 17 | return {'text': '!' + kwargs['text']} 18 | 19 | 20 | def fn4(kwargs): 21 | return {'text': '!' + kwargs['text'], 'private': True} 22 | 23 | 24 | def fn2(kwargs): 25 | slackbot.slack.chat.post_message('#general', 'hello from slacker handler') 26 | return None 27 | 28 | 29 | def fn3(text): 30 | return text.startswith('!') 31 | 32 | 33 | slackbot.set_handler(fn1) 34 | slackbot.filter_outgoing(fn3) 35 | 36 | 37 | if __name__ == "__main__": 38 | app.run() 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | .coveralls.yml 46 | 47 | # Translations 48 | *.mo 49 | *.pot 50 | 51 | # Django stuff: 52 | *.log 53 | 54 | # Sphinx documentation 55 | docs/_build/ 56 | 57 | # PyBuilder 58 | target/ 59 | -------------------------------------------------------------------------------- /tests/test_slackbot.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import sys 3 | import json 4 | 5 | from pytest import fixture 6 | from flask import Flask 7 | from six import b 8 | 9 | from flask_slackbot import SlackBot 10 | 11 | 12 | class App(object): 13 | 14 | def __init__(self): 15 | self.app = Flask(__name__) 16 | self.app.debug = True 17 | self.app.config['SLACK_TOKEN'] = 'Your token here' 18 | self.app.config['SLACK_CHAT_TOKEN'] = 'Your token here' 19 | self.app.config['SLACK_CALLBACK'] = '/slack_callback' 20 | self.slackbot = SlackBot(self.app) 21 | self.slackbot.set_handler(self.fn) 22 | self.client = self.app.test_client() 23 | 24 | @staticmethod 25 | def fn(kwargs): 26 | return {'text': kwargs['text']} 27 | 28 | 29 | @fixture(scope='module') 30 | def app(): 31 | return App() 32 | 33 | 34 | def test_response_directly(app): 35 | rv = app.client.post('/slack_callback', data={ 36 | 'token': 'Your token here', 37 | 'text': 'test', 38 | 'team_id': 'team_id', 39 | 'team_domain': 'team_domain', 40 | 'channel_id': 'channel_id', 41 | 'channel_name': 'channel_name', 42 | 'timestamp': 'timestamp', 43 | 'user_id': 'user_id', 44 | 'user_name': 'user_name', 45 | 'trigger_word': 'trigger_word' 46 | }) 47 | assert rv.status_code == 200 48 | assert rv.content_type == 'application/json' 49 | if sys.version_info.major == 2: 50 | assert json.loads(rv.data)['text'] == 'test' 51 | else: 52 | assert json.loads(rv.data.decode())['text'] == 'test' 53 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import setup 4 | 5 | 6 | def fread(fname): 7 | filepath = os.path.join(os.path.dirname(__file__), fname) 8 | with open(filepath) as f: 9 | return f.read() 10 | 11 | 12 | setup(name='flask_slackbot', 13 | version='0.2.1', 14 | url='https://github.com/python-cn/flask-slackbot', 15 | license='MIT', 16 | author='halfcrazy', 17 | author_email='hackzhuyan@gmail.com', 18 | maintainer='dongweiming', 19 | maintainer_email='ciici123@gmail.com', 20 | description='Deal with slack outgoing webhook ', 21 | long_description=fread('README.rst'), 22 | packages=['flask_slackbot'], 23 | zip_safe=False, 24 | platforms='any', 25 | install_requires=[ 26 | 'Flask', 27 | 'slacker', 28 | 'six' 29 | ], 30 | tests_require=[ 31 | 'pytest', 32 | 'pytest-cov', 33 | 'pytest-pep8', 34 | ], 35 | classifiers=[ 36 | 'Development Status :: 3 - Alpha', 37 | 'Environment :: Web Environment', 38 | 'Intended Audience :: Developers', 39 | 'License :: OSI Approved :: MIT License', 40 | 'Operating System :: OS Independent', 41 | 'Programming Language :: Python', 42 | 'Programming Language :: Python :: 2.6', 43 | 'Programming Language :: Python :: 2.7', 44 | 'Programming Language :: Python :: 3', 45 | 'Programming Language :: Python :: 3.3', 46 | 'Programming Language :: Python :: 3.4', 47 | 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 48 | 'Topic :: Software Development :: Libraries :: Python Modules' 49 | ]) 50 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Flask-SlackBot 2 | =================== 3 | 4 | Flask-SlackBot is a Flask extension which helps you deal with slack's outgoing webhook. 5 | 6 | Installation 7 | ------------ 8 | :: 9 | 10 | $ pip install flask-slackbot 11 | 12 | 13 | Usage 14 | ----- 15 | 16 | .. code-block:: python 17 | 18 | # coding=utf-8 19 | from flask import Flask 20 | 21 | from flask_slackbot import SlackBot 22 | 23 | 24 | app = Flask(__name__) 25 | app.config['SLACK_TOKEN'] = 'Your token here' 26 | # if you need to use slacker you should give a slack chat token 27 | app.config['SLACK_CHAT_TOKEN'] = 'Your slack chat token' 28 | app.config['SLACK_CALLBACK'] = '/slack_callback' 29 | app.debug = True 30 | slackbot = SlackBot(app) 31 | 32 | ''' 33 | The parameter of the callback function is a dict returns from the slack's outgoing api. 34 | Here is the detail: 35 | kwargs 36 | { 37 | 'token': token, 38 | 'team_id': team_id, 39 | 'team_domain': team_domain, 40 | 'channel_id': channel_id, 41 | 'channel_name': channel_name, 42 | 'timestamp': timestamp, 43 | 'user_id': user_id, 44 | 'user_name': user_name, 45 | 'text': text, 46 | 'trigger_word': trigger_word 47 | }''' 48 | def fn1(kwargs): 49 | ''' 50 | This function shows response the slack post directly without an extra post. 51 | In this case, you need to return a dict.''' 52 | return {'text': '!' + kwargs['text']} # Note the '!' character here is an user defined flag to tell the slack, this message is sent from the bot. 53 | 54 | 55 | def fn4(kwargs): 56 | ''' 57 | This function looks like upper one. But a little different, this will only response to the sender. 58 | In this case, you need to return a dict with an extra key private setted as True. 59 | And if you need this function, you should given the slack chat token in config.''' 60 | return {'text': '!' + kwargs['text'], 'private': True} # Note the '!' character here is an user defined flag to tell the slack, this message is sent from the bot. 61 | 62 | 63 | def fn2(kwargs): 64 | ''' 65 | This function shows response the slack post indirectly with an extra post. 66 | In this case, you need to return None. 67 | Now the slack will ignore the response from this request, and if you need do some complex task you can use the built-in slacker. 68 | For more information, see https://github.com/os/slacker''' 69 | slackbot.slack.chat.post_message('#general', 'hello from slacker handler') 70 | return None 71 | 72 | 73 | def fn3(text): 74 | ''' 75 | This function is a filter, which makes our bot ignore the text sent from itself.''' 76 | return text.startswith('!') 77 | 78 | slackbot.set_handler(fn1) 79 | slackbot.filter_outgoing(fn3) 80 | 81 | 82 | if __name__ == "__main__": 83 | app.run() 84 | 85 | 86 | Trap 87 | ------------ 88 | If you have not set a trigger word, and your callback server return some text to slack, there would be a callback hell. You know like ping pong, and then turn into an infinite loop. 89 | 90 | -------------------------------------------------------------------------------- /flask_slackbot/base.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import sys 3 | from functools import partial 4 | 5 | from flask import Blueprint, request, jsonify, make_response 6 | from slacker import Slacker 7 | 8 | 9 | default_response = partial(make_response, '', 200) 10 | MAX_LENGTH = 1000 11 | 12 | 13 | class SlackBot(object): 14 | 15 | def __init__(self, app=None): 16 | self.app = app 17 | if app is not None: 18 | self.init_app(app) 19 | 20 | def init_app(self, app): 21 | self.slack_chat_token = app.config.get('SLACK_CHAT_TOKEN') 22 | 23 | if self.slack_chat_token: 24 | self.slack = Slacker(self.slack_chat_token) 25 | else: 26 | self.slack = None 27 | 28 | self.callback_url = app.config.get('SLACK_CALLBACK') 29 | self.init_bp() 30 | 31 | def init_bp(self): 32 | bp = Blueprint('slack', __name__) 33 | bp.add_url_rule(self.callback_url, 34 | view_func=self.slack_callback, 35 | methods=['POST']) 36 | self.app.register_blueprint(bp) 37 | 38 | def set_handler(self, fn): 39 | self.handler = fn 40 | 41 | def filter_outgoing(self, fn): 42 | self._filter = fn 43 | 44 | def slack_callback(self): 45 | token = request.form.get('token') 46 | team_id = request.form.get('team_id') 47 | team_domain = request.form.get('team_domain') 48 | channel_id = request.form.get('channel_id') 49 | channel_name = request.form.get('channel_name') 50 | timestamp = request.form.get('timestamp') 51 | user_id = request.form.get('user_id') 52 | user_name = request.form.get('user_name') 53 | text = request.form.get('text') 54 | trigger_word = request.form.get('trigger_word') 55 | 56 | if hasattr(self, '_filter') and self._filter(text): 57 | return default_response() 58 | 59 | ''' 60 | use flag to determine whether response directly, 61 | or use slacker to deal''' 62 | rv = self.handler({ 63 | 'token': token, 64 | 'team_id': team_id, 65 | 'team_domain': team_domain, 66 | 'channel_id': channel_id, 67 | 'channel_name': channel_name, 68 | 'timestamp': timestamp, 69 | 'user_id': user_id, 70 | 'user_name': user_name, 71 | 'text': text, 72 | 'trigger_word': trigger_word 73 | }) 74 | 75 | if isinstance(rv, dict): 76 | if not self.slack: 77 | return jsonify({'text': 'you have not initialize slacker'}) 78 | attachments = rv.get('attachments', None) 79 | text = rv['text'] 80 | if sys.version_info.major == 2 and not isinstance(text, str): 81 | text = text.encode('utf-8') 82 | if rv.pop('private', False): 83 | # This will send private message to user 84 | # If message too long. will raise 414 85 | if len(text) >= MAX_LENGTH: 86 | while text: 87 | _text = text[:MAX_LENGTH] 88 | text = text[MAX_LENGTH:] 89 | self.slack.chat.post_message(user_id, _text, 90 | attachments=attachments) 91 | elif len(str(attachments)) >= MAX_LENGTH: 92 | for _attachments in zip(*[iter(attachments)] * 10): 93 | self.slack.chat.post_message( 94 | user_id, text, attachments=list(_attachments)) 95 | else: 96 | self.slack.chat.post_message(user_id, rv['text'], 97 | attachments=attachments) 98 | elif text: 99 | return jsonify(rv) 100 | return default_response() 101 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | |Build Status| |Coverage Status| |PyPI Version| |PyPI Downloads| 2 | 3 | flask_slackbot 4 | =================== 5 | 6 | flask_slackbot is a Flask extension which helps you deal with slack's outgoing webhook. 7 | 8 | Installation 9 | ------------ 10 | :: 11 | 12 | $ pip install flask_slackbot 13 | 14 | 15 | Usage 16 | ----- 17 | 18 | .. code-block:: python 19 | 20 | # coding=utf-8 21 | from flask import Flask 22 | 23 | from flask_slackbot import SlackBot 24 | 25 | 26 | app = Flask(__name__) 27 | app.config['SLACK_TOKEN'] = 'Your token here' 28 | # if you need to use slacker you should give a slack chat token 29 | app.config['SLACK_CHAT_TOKEN'] = 'Your slack chat token' 30 | app.config['SLACK_CALLBACK'] = '/slack_callback' 31 | app.debug = True 32 | slackbot = SlackBot(app) 33 | 34 | ''' 35 | The parameter of the callback function is a dict returns from the slack's outgoing api. 36 | Here is the detail: 37 | kwargs 38 | { 39 | 'token': token, 40 | 'team_id': team_id, 41 | 'team_domain': team_domain, 42 | 'channel_id': channel_id, 43 | 'channel_name': channel_name, 44 | 'timestamp': timestamp, 45 | 'user_id': user_id, 46 | 'user_name': user_name, 47 | 'text': text, 48 | 'trigger_word': trigger_word 49 | }''' 50 | def fn1(kwargs): 51 | ''' 52 | This function shows response the slack post directly without an extra post. 53 | In this case, you need to return a dict.''' 54 | return {'text': '!' + kwargs['text']} # Note the '!' character here is an user defined flag to tell the slack, this message is sent from the bot. 55 | 56 | 57 | def fn4(kwargs): 58 | ''' 59 | This function looks like upper one. But a little different, this will only response to the sender. 60 | In this case, you need to return a dict with an extra key private setted as True. 61 | And if you need this function, you should given the slack chat token in config.''' 62 | return {'text': '!' + kwargs['text'], 'private': True} # Note the '!' character here is an user defined flag to tell the slack, this message is sent from the bot. 63 | 64 | 65 | def fn2(kwargs): 66 | ''' 67 | This function shows response the slack post indirectly with an extra post. 68 | In this case, you need to return None. 69 | Now the slack will ignore the response from this request, and if you need do some complex task you can use the built-in slacker. 70 | For more information, see https://github.com/os/slacker''' 71 | slackbot.slack.chat.post_message('#general', 'hello from slacker handler') 72 | return None 73 | 74 | 75 | def fn3(text): 76 | ''' 77 | This function is a filter, which makes our bot ignore the text sent from itself.''' 78 | return text.startswith('!') 79 | 80 | slackbot.set_handler(fn1) 81 | slackbot.filter_outgoing(fn3) 82 | 83 | 84 | if __name__ == "__main__": 85 | app.run() 86 | 87 | 88 | Trap 89 | ------------ 90 | If you have not set a trigger word, and your callback server return some text to slack, there would be a callback hell. You know like ping pong, and then turn into an infinite loop. 91 | 92 | .. |Build Status| image:: https://travis-ci.org/python-cn/flask-slackbot.svg?branch=master 93 | :target: https://travis-ci.org/python-cn/flask-slackbot 94 | :alt: Build Status 95 | .. |PyPI Version| image:: https://img.shields.io/pypi/v/flask_slackbot.svg 96 | :target: https://pypi.python.org/pypi/flask_slackbot 97 | :alt: PyPI Version 98 | .. |PyPI Downloads| image:: https://img.shields.io/pypi/dm/flask_slackbot.svg 99 | :target: https://pypi.python.org/pypi/flask_slackbot 100 | :alt: Downloads 101 | .. |Coverage Status| image:: https://img.shields.io/coveralls/python-cn/flask-slackbot.svg 102 | :target: https://coveralls.io/r/python-cn/flask-slackbot 103 | :alt: Coverage Status 104 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% source 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | echo. coverage to run coverage check of the documentation if enabled 41 | goto end 42 | ) 43 | 44 | if "%1" == "clean" ( 45 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 46 | del /q /s %BUILDDIR%\* 47 | goto end 48 | ) 49 | 50 | 51 | REM Check if sphinx-build is available and fallback to Python version if any 52 | %SPHINXBUILD% 2> nul 53 | if errorlevel 9009 goto sphinx_python 54 | goto sphinx_ok 55 | 56 | :sphinx_python 57 | 58 | set SPHINXBUILD=python -m sphinx.__init__ 59 | %SPHINXBUILD% 2> nul 60 | if errorlevel 9009 ( 61 | echo. 62 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 63 | echo.installed, then set the SPHINXBUILD environment variable to point 64 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 65 | echo.may add the Sphinx directory to PATH. 66 | echo. 67 | echo.If you don't have Sphinx installed, grab it from 68 | echo.http://sphinx-doc.org/ 69 | exit /b 1 70 | ) 71 | 72 | :sphinx_ok 73 | 74 | 75 | if "%1" == "html" ( 76 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 77 | if errorlevel 1 exit /b 1 78 | echo. 79 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 80 | goto end 81 | ) 82 | 83 | if "%1" == "dirhtml" ( 84 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 85 | if errorlevel 1 exit /b 1 86 | echo. 87 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 88 | goto end 89 | ) 90 | 91 | if "%1" == "singlehtml" ( 92 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 93 | if errorlevel 1 exit /b 1 94 | echo. 95 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 96 | goto end 97 | ) 98 | 99 | if "%1" == "pickle" ( 100 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 101 | if errorlevel 1 exit /b 1 102 | echo. 103 | echo.Build finished; now you can process the pickle files. 104 | goto end 105 | ) 106 | 107 | if "%1" == "json" ( 108 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 109 | if errorlevel 1 exit /b 1 110 | echo. 111 | echo.Build finished; now you can process the JSON files. 112 | goto end 113 | ) 114 | 115 | if "%1" == "htmlhelp" ( 116 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 117 | if errorlevel 1 exit /b 1 118 | echo. 119 | echo.Build finished; now you can run HTML Help Workshop with the ^ 120 | .hhp project file in %BUILDDIR%/htmlhelp. 121 | goto end 122 | ) 123 | 124 | if "%1" == "qthelp" ( 125 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 129 | .qhcp project file in %BUILDDIR%/qthelp, like this: 130 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\flask_slackbot.qhcp 131 | echo.To view the help file: 132 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\flask_slackbot.ghc 133 | goto end 134 | ) 135 | 136 | if "%1" == "devhelp" ( 137 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 138 | if errorlevel 1 exit /b 1 139 | echo. 140 | echo.Build finished. 141 | goto end 142 | ) 143 | 144 | if "%1" == "epub" ( 145 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 146 | if errorlevel 1 exit /b 1 147 | echo. 148 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 149 | goto end 150 | ) 151 | 152 | if "%1" == "latex" ( 153 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 154 | if errorlevel 1 exit /b 1 155 | echo. 156 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 157 | goto end 158 | ) 159 | 160 | if "%1" == "latexpdf" ( 161 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 162 | cd %BUILDDIR%/latex 163 | make all-pdf 164 | cd %~dp0 165 | echo. 166 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 167 | goto end 168 | ) 169 | 170 | if "%1" == "latexpdfja" ( 171 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 172 | cd %BUILDDIR%/latex 173 | make all-pdf-ja 174 | cd %~dp0 175 | echo. 176 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 177 | goto end 178 | ) 179 | 180 | if "%1" == "text" ( 181 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 182 | if errorlevel 1 exit /b 1 183 | echo. 184 | echo.Build finished. The text files are in %BUILDDIR%/text. 185 | goto end 186 | ) 187 | 188 | if "%1" == "man" ( 189 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 190 | if errorlevel 1 exit /b 1 191 | echo. 192 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 193 | goto end 194 | ) 195 | 196 | if "%1" == "texinfo" ( 197 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 198 | if errorlevel 1 exit /b 1 199 | echo. 200 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 201 | goto end 202 | ) 203 | 204 | if "%1" == "gettext" ( 205 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 206 | if errorlevel 1 exit /b 1 207 | echo. 208 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 209 | goto end 210 | ) 211 | 212 | if "%1" == "changes" ( 213 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 214 | if errorlevel 1 exit /b 1 215 | echo. 216 | echo.The overview file is in %BUILDDIR%/changes. 217 | goto end 218 | ) 219 | 220 | if "%1" == "linkcheck" ( 221 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 222 | if errorlevel 1 exit /b 1 223 | echo. 224 | echo.Link check complete; look for any errors in the above output ^ 225 | or in %BUILDDIR%/linkcheck/output.txt. 226 | goto end 227 | ) 228 | 229 | if "%1" == "doctest" ( 230 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 231 | if errorlevel 1 exit /b 1 232 | echo. 233 | echo.Testing of doctests in the sources finished, look at the ^ 234 | results in %BUILDDIR%/doctest/output.txt. 235 | goto end 236 | ) 237 | 238 | if "%1" == "coverage" ( 239 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 240 | if errorlevel 1 exit /b 1 241 | echo. 242 | echo.Testing of coverage in the sources finished, look at the ^ 243 | results in %BUILDDIR%/coverage/python.txt. 244 | goto end 245 | ) 246 | 247 | if "%1" == "xml" ( 248 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 249 | if errorlevel 1 exit /b 1 250 | echo. 251 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 252 | goto end 253 | ) 254 | 255 | if "%1" == "pseudoxml" ( 256 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 257 | if errorlevel 1 exit /b 1 258 | echo. 259 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 260 | goto end 261 | ) 262 | 263 | :end 264 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " applehelp to make an Apple Help Book" 34 | @echo " devhelp to make HTML files and a Devhelp project" 35 | @echo " epub to make an epub" 36 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 37 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 38 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 39 | @echo " text to make text files" 40 | @echo " man to make manual pages" 41 | @echo " texinfo to make Texinfo files" 42 | @echo " info to make Texinfo files and run them through makeinfo" 43 | @echo " gettext to make PO message catalogs" 44 | @echo " changes to make an overview of all changed/added/deprecated items" 45 | @echo " xml to make Docutils-native XML files" 46 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 47 | @echo " linkcheck to check all external links for integrity" 48 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 49 | @echo " coverage to run coverage check of the documentation (if enabled)" 50 | 51 | clean: 52 | rm -rf $(BUILDDIR)/* 53 | 54 | html: 55 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 56 | @echo 57 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 58 | 59 | dirhtml: 60 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 61 | @echo 62 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 63 | 64 | singlehtml: 65 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 66 | @echo 67 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 68 | 69 | pickle: 70 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 71 | @echo 72 | @echo "Build finished; now you can process the pickle files." 73 | 74 | json: 75 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 76 | @echo 77 | @echo "Build finished; now you can process the JSON files." 78 | 79 | htmlhelp: 80 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 81 | @echo 82 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 83 | ".hhp project file in $(BUILDDIR)/htmlhelp." 84 | 85 | qthelp: 86 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 87 | @echo 88 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 89 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 90 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/flask_slackbot.qhcp" 91 | @echo "To view the help file:" 92 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/flask_slackbot.qhc" 93 | 94 | applehelp: 95 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 96 | @echo 97 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 98 | @echo "N.B. You won't be able to view it unless you put it in" \ 99 | "~/Library/Documentation/Help or install it in your application" \ 100 | "bundle." 101 | 102 | devhelp: 103 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 104 | @echo 105 | @echo "Build finished." 106 | @echo "To view the help file:" 107 | @echo "# mkdir -p $$HOME/.local/share/devhelp/flask_slackbot" 108 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/flask_slackbot" 109 | @echo "# devhelp" 110 | 111 | epub: 112 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 113 | @echo 114 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 115 | 116 | latex: 117 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 118 | @echo 119 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 120 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 121 | "(use \`make latexpdf' here to do that automatically)." 122 | 123 | latexpdf: 124 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 125 | @echo "Running LaTeX files through pdflatex..." 126 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 127 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 128 | 129 | latexpdfja: 130 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 131 | @echo "Running LaTeX files through platex and dvipdfmx..." 132 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 133 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 134 | 135 | text: 136 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 137 | @echo 138 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 139 | 140 | man: 141 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 142 | @echo 143 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 144 | 145 | texinfo: 146 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 147 | @echo 148 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 149 | @echo "Run \`make' in that directory to run these through makeinfo" \ 150 | "(use \`make info' here to do that automatically)." 151 | 152 | info: 153 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 154 | @echo "Running Texinfo files through makeinfo..." 155 | make -C $(BUILDDIR)/texinfo info 156 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 157 | 158 | gettext: 159 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 160 | @echo 161 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 162 | 163 | changes: 164 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 165 | @echo 166 | @echo "The overview file is in $(BUILDDIR)/changes." 167 | 168 | linkcheck: 169 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 170 | @echo 171 | @echo "Link check complete; look for any errors in the above output " \ 172 | "or in $(BUILDDIR)/linkcheck/output.txt." 173 | 174 | doctest: 175 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 176 | @echo "Testing of doctests in the sources finished, look at the " \ 177 | "results in $(BUILDDIR)/doctest/output.txt." 178 | 179 | coverage: 180 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 181 | @echo "Testing of coverage in the sources finished, look at the " \ 182 | "results in $(BUILDDIR)/coverage/python.txt." 183 | 184 | xml: 185 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 186 | @echo 187 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 188 | 189 | pseudoxml: 190 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 191 | @echo 192 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 193 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # flask_slackbot documentation build configuration file, created by 4 | # sphinx-quickstart on Thu Jun 11 17:21:20 2015. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | import shlex 18 | 19 | # If extensions (or modules to document with autodoc) are in another directory, 20 | # add these directories to sys.path here. If the directory is relative to the 21 | # documentation root, use os.path.abspath to make it absolute, like shown here. 22 | #sys.path.insert(0, os.path.abspath('.')) 23 | 24 | # -- General configuration ------------------------------------------------ 25 | 26 | # If your documentation needs a minimal Sphinx version, state it here. 27 | #needs_sphinx = '1.0' 28 | 29 | # Add any Sphinx extension module names here, as strings. They can be 30 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 31 | # ones. 32 | extensions = [ 33 | 'sphinx.ext.autodoc', 34 | 'sphinx.ext.intersphinx', 35 | 'sphinx.ext.ifconfig', 36 | ] 37 | 38 | # Add any paths that contain templates here, relative to this directory. 39 | templates_path = ['_templates'] 40 | 41 | # The suffix(es) of source filenames. 42 | # You can specify multiple suffix as a list of string: 43 | # source_suffix = ['.rst', '.md'] 44 | source_suffix = '.rst' 45 | 46 | # The encoding of source files. 47 | #source_encoding = 'utf-8-sig' 48 | 49 | # The master toctree document. 50 | master_doc = 'index' 51 | 52 | # General information about the project. 53 | project = u'flask_slackbot' 54 | copyright = u'2015, halfcrazy' 55 | author = u'halfcrazy' 56 | 57 | # The version info for the project you're documenting, acts as replacement for 58 | # |version| and |release|, also used in various other places throughout the 59 | # built documents. 60 | # 61 | # The short X.Y version. 62 | version = '0.1.12' 63 | # The full version, including alpha/beta/rc tags. 64 | release = '0.1.12' 65 | 66 | # The language for content autogenerated by Sphinx. Refer to documentation 67 | # for a list of supported languages. 68 | # 69 | # This is also used if you do content translation via gettext catalogs. 70 | # Usually you set "language" from the command line for these cases. 71 | language = None 72 | 73 | # There are two options for replacing |today|: either, you set today to some 74 | # non-false value, then it is used: 75 | #today = '' 76 | # Else, today_fmt is used as the format for a strftime call. 77 | #today_fmt = '%B %d, %Y' 78 | 79 | # List of patterns, relative to source directory, that match files and 80 | # directories to ignore when looking for source files. 81 | exclude_patterns = [] 82 | 83 | # The reST default role (used for this markup: `text`) to use for all 84 | # documents. 85 | #default_role = None 86 | 87 | # If true, '()' will be appended to :func: etc. cross-reference text. 88 | #add_function_parentheses = True 89 | 90 | # If true, the current module name will be prepended to all description 91 | # unit titles (such as .. function::). 92 | #add_module_names = True 93 | 94 | # If true, sectionauthor and moduleauthor directives will be shown in the 95 | # output. They are ignored by default. 96 | #show_authors = False 97 | 98 | # The name of the Pygments (syntax highlighting) style to use. 99 | pygments_style = 'sphinx' 100 | 101 | # A list of ignored prefixes for module index sorting. 102 | #modindex_common_prefix = [] 103 | 104 | # If true, keep warnings as "system message" paragraphs in the built documents. 105 | #keep_warnings = False 106 | 107 | # If true, `todo` and `todoList` produce output, else they produce nothing. 108 | todo_include_todos = False 109 | 110 | 111 | # -- Options for HTML output ---------------------------------------------- 112 | 113 | # The theme to use for HTML and HTML Help pages. See the documentation for 114 | # a list of builtin themes. 115 | sys.path.append(os.path.abspath('_themes')) 116 | html_theme_path = ['_themes'] 117 | html_theme = 'flask_small' 118 | 119 | # Theme options are theme-specific and customize the look and feel of a theme 120 | # further. For a list of options available for each theme, see the 121 | # documentation. 122 | #html_theme_options = {} 123 | 124 | # Add any paths that contain custom themes here, relative to this directory. 125 | #html_theme_path = [] 126 | 127 | # The name for this set of Sphinx documents. If None, it defaults to 128 | # " v documentation". 129 | #html_title = None 130 | 131 | # A shorter title for the navigation bar. Default is the same as html_title. 132 | #html_short_title = None 133 | 134 | # The name of an image file (relative to this directory) to place at the top 135 | # of the sidebar. 136 | #html_logo = None 137 | 138 | # The name of an image file (within the static path) to use as favicon of the 139 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 140 | # pixels large. 141 | #html_favicon = None 142 | 143 | # Add any paths that contain custom static files (such as style sheets) here, 144 | # relative to this directory. They are copied after the builtin static files, 145 | # so a file named "default.css" will overwrite the builtin "default.css". 146 | html_static_path = ['_static'] 147 | 148 | # Add any extra paths that contain custom files (such as robots.txt or 149 | # .htaccess) here, relative to this directory. These files are copied 150 | # directly to the root of the documentation. 151 | #html_extra_path = [] 152 | 153 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 154 | # using the given strftime format. 155 | #html_last_updated_fmt = '%b %d, %Y' 156 | 157 | # If true, SmartyPants will be used to convert quotes and dashes to 158 | # typographically correct entities. 159 | #html_use_smartypants = True 160 | 161 | # Custom sidebar templates, maps document names to template names. 162 | #html_sidebars = {} 163 | 164 | # Additional templates that should be rendered to pages, maps page names to 165 | # template names. 166 | #html_additional_pages = {} 167 | 168 | # If false, no module index is generated. 169 | #html_domain_indices = True 170 | 171 | # If false, no index is generated. 172 | #html_use_index = True 173 | 174 | # If true, the index is split into individual pages for each letter. 175 | #html_split_index = False 176 | 177 | # If true, links to the reST sources are added to the pages. 178 | #html_show_sourcelink = True 179 | 180 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 181 | #html_show_sphinx = True 182 | 183 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 184 | #html_show_copyright = True 185 | 186 | # If true, an OpenSearch description file will be output, and all pages will 187 | # contain a tag referring to it. The value of this option must be the 188 | # base URL from which the finished HTML is served. 189 | #html_use_opensearch = '' 190 | 191 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 192 | #html_file_suffix = None 193 | 194 | # Language to be used for generating the HTML full-text search index. 195 | # Sphinx supports the following languages: 196 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' 197 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' 198 | #html_search_language = 'en' 199 | 200 | # A dictionary with options for the search language support, empty by default. 201 | # Now only 'ja' uses this config value 202 | #html_search_options = {'type': 'default'} 203 | 204 | # The name of a javascript file (relative to the configuration directory) that 205 | # implements a search results scorer. If empty, the default will be used. 206 | #html_search_scorer = 'scorer.js' 207 | 208 | # Output file base name for HTML help builder. 209 | htmlhelp_basename = 'flask_slackbotdoc' 210 | 211 | # -- Options for LaTeX output --------------------------------------------- 212 | 213 | latex_elements = { 214 | # The paper size ('letterpaper' or 'a4paper'). 215 | #'papersize': 'letterpaper', 216 | 217 | # The font size ('10pt', '11pt' or '12pt'). 218 | #'pointsize': '10pt', 219 | 220 | # Additional stuff for the LaTeX preamble. 221 | #'preamble': '', 222 | 223 | # Latex figure (float) alignment 224 | #'figure_align': 'htbp', 225 | } 226 | 227 | # Grouping the document tree into LaTeX files. List of tuples 228 | # (source start file, target name, title, 229 | # author, documentclass [howto, manual, or own class]). 230 | latex_documents = [ 231 | (master_doc, 'flask_slackbot.tex', u'flask\\_slackbot Documentation', 232 | u'halfcrazy', 'manual'), 233 | ] 234 | 235 | # The name of an image file (relative to this directory) to place at the top of 236 | # the title page. 237 | #latex_logo = None 238 | 239 | # For "manual" documents, if this is true, then toplevel headings are parts, 240 | # not chapters. 241 | #latex_use_parts = False 242 | 243 | # If true, show page references after internal links. 244 | #latex_show_pagerefs = False 245 | 246 | # If true, show URL addresses after external links. 247 | #latex_show_urls = False 248 | 249 | # Documents to append as an appendix to all manuals. 250 | #latex_appendices = [] 251 | 252 | # If false, no module index is generated. 253 | #latex_domain_indices = True 254 | 255 | 256 | # -- Options for manual page output --------------------------------------- 257 | 258 | # One entry per manual page. List of tuples 259 | # (source start file, name, description, authors, manual section). 260 | man_pages = [ 261 | (master_doc, 'flask_slackbot', u'flask_slackbot Documentation', 262 | [author], 1) 263 | ] 264 | 265 | # If true, show URL addresses after external links. 266 | #man_show_urls = False 267 | 268 | 269 | # -- Options for Texinfo output ------------------------------------------- 270 | 271 | # Grouping the document tree into Texinfo files. List of tuples 272 | # (source start file, target name, title, author, 273 | # dir menu entry, description, category) 274 | texinfo_documents = [ 275 | (master_doc, 'flask_slackbot', u'flask_slackbot Documentation', 276 | author, 'flask_slackbot', 'One line description of project.', 277 | 'Miscellaneous'), 278 | ] 279 | 280 | # Documents to append as an appendix to all manuals. 281 | #texinfo_appendices = [] 282 | 283 | # If false, no module index is generated. 284 | #texinfo_domain_indices = True 285 | 286 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 287 | #texinfo_show_urls = 'footnote' 288 | 289 | # If true, do not generate a @detailmenu in the "Top" node's menu. 290 | #texinfo_no_detailmenu = False 291 | 292 | 293 | # Example configuration for intersphinx: refer to the Python standard library. 294 | intersphinx_mapping = {'https://docs.python.org/': None} 295 | --------------------------------------------------------------------------------