From 27c343a5b164f8063470c8e76c6963fd067dd3d6 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Thu, 24 Nov 2016 02:27:00 +0100 Subject: Doc update. Might be breaking. --- docs/conf.py | 1 + docs/index.rst | 33 +++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/conf.py b/docs/conf.py index c6f7b02..5fc673b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,6 +29,7 @@ import os import sys sys.path.insert(0, os.path.abspath('../')) +autodoc_member_order = 'by_source' #print(sys.path) # Add any Sphinx extension module names here, as strings. They can be diff --git a/docs/index.rst b/docs/index.rst index 1334538..2780eaa 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,16 +1,25 @@ -.. Mastodon.py documentation master file, created by - sphinx-quickstart on Thu Nov 24 01:25:38 2016. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +.. py:currentmodule:: mastodon +.. py:class:: Mastodon -Welcome to Mastodon.py's documentation! -======================================= +Mastodon.py +=========== -Contents: +App creation and auth +--------------------- + +Before you can use the mastodon API, you have to register your application (which gets you a client key and client secret) +and then log in (which gets you an access token). These functions allow you to do those things. +For convenience, once you have a client id, secret and access token, you can simply pass them to the constructor of the class, too! + +Note that while it is perfectly reasonable to log back in whenever your app starts, registering a new application on every +startup is not, so don't do that - instead, register an application once, and then persist your client id and secret. Convenience +methods for this are provided. + +.. autofunction:: create_app +.. automethod:: __init__ +.. automethod:: log_in + +Reading timelines +----------------- -.. toctree:: - :maxdepth: 2 -.. py:currentmodule:: mastodon -.. autoclass:: Mastodon - :members: -- cgit v1.2.3