Skip to content

Commit

Permalink
Merge pull request #440 from carpedm20/fix-docs
Browse files Browse the repository at this point in the history
Fix and clean up documentation
  • Loading branch information
madsmtm authored Jul 3, 2019
2 parents 281a20f + a9c6818 commit 3a0b986
Show file tree
Hide file tree
Showing 19 changed files with 349 additions and 286 deletions.
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2

formats:
- pdf
- htmlzip

python:
version: 3.6
install:
- path: .
extra_requirements:
- docs

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
fail_on_warning: true
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ Installation:
$ pip install fbchat
You can also install from source, by using `flit`:
You can also install from source if you have ``pip>=19.0``:

.. code-block::
$ pip install flit
$ git clone https://github.com/carpedm20/fbchat.git
$ cd fbchat
$ flit install
$ pip install fbchat
Maintainer
Expand Down
3 changes: 1 addition & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3.6 -msphinx
SPHINXPROJ = fbchat
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build

Expand Down
76 changes: 61 additions & 15 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,79 @@
.. module:: fbchat
.. highlight:: python
.. _api:

.. Note: we're using () to hide the __init__ method where relevant
Full API
========

If you are looking for information on a specific function, class, or method, this part of the documentation is for you.


.. _api_client:

Client
------

This is the main class of `fbchat`, which contains all the methods you use to interact with Facebook.
You can extend this class, and overwrite the events, to provide custom event handling (mainly used while listening)
.. autoclass:: Client

.. autoclass:: Client(email, password, user_agent=None, max_tries=5, session_cookies=None, logging_level=logging.INFO)
:members:
Threads
-------

.. autoclass:: Thread()
.. autoclass:: ThreadType(Enum)
:undoc-members:
.. autoclass:: Page()
.. autoclass:: User()
.. autoclass:: Group()

.. _api_models:
Messages
--------

Models
------
.. autoclass:: Message
.. autoclass:: Mention
.. autoclass:: EmojiSize(Enum)
:undoc-members:
.. autoclass:: MessageReaction(Enum)
:undoc-members:

Exceptions
----------

.. autoexception:: FBchatException()
.. autoexception:: FBchatFacebookError()
.. autoexception:: FBchatUserError()

Attachments
-----------

.. autoclass:: Attachment()
.. autoclass:: ShareAttachment()
.. autoclass:: Sticker()
.. autoclass:: LocationAttachment()
.. autoclass:: LiveLocationAttachment()
.. autoclass:: FileAttachment()
.. autoclass:: AudioAttachment()
.. autoclass:: ImageAttachment()
.. autoclass:: VideoAttachment()
.. autoclass:: ImageAttachment()

Miscellaneous
-------------

.. autoclass:: ThreadLocation(Enum)
:undoc-members:
.. autoclass:: ThreadColor(Enum)
:undoc-members:
.. autoclass:: ActiveStatus()
.. autoclass:: TypingStatus(Enum)
:undoc-members:

.. autoclass:: QuickReply
.. autoclass:: QuickReplyText
.. autoclass:: QuickReplyLocation
.. autoclass:: QuickReplyPhoneNumber
.. autoclass:: QuickReplyEmail

These models are used in various functions, both as inputs and return values.
A good tip is to write ``from fbchat.models import *`` at the start of your source, so you can use these models freely
.. autoclass:: Poll
.. autoclass:: PollOption

.. automodule:: fbchat.models
:members:
.. autoclass:: Plan
.. autoclass:: GuestStatus(Enum)
:undoc-members:
Loading

0 comments on commit 3a0b986

Please sign in to comment.