Skip to content

Commit 600da3c

Browse files
doc: update documentation theme/style [dst-132]
* update sphinx theme to official 4subsea theme
1 parent 2c53460 commit 600da3c

17 files changed

Lines changed: 290 additions & 74 deletions

docs/_static/4insight-logo.svg

Lines changed: 12 additions & 0 deletions
Loading

docs/_static/4subsea-logo.svg

Lines changed: 11 additions & 0 deletions
Loading

docs/_static/css/custom.css

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/* Provided by the Sphinx base theme template at build time */
2+
@import "../basic.css";
3+
4+
/*****************************************************************************
5+
* 4Subsea tweaks
6+
**/
7+
.navbar{
8+
background-color: #333333 !important;
9+
}
10+
11+
.navbar-brand img {
12+
height: 22px; /* 32px */
13+
}
14+
15+
.fab::before{
16+
color: #f5f5f5;
17+
}
18+
19+
.fas::before{
20+
color: #f5f5f5;
21+
}
22+
23+
:root {
24+
/*****************************************************************************
25+
* Theme config
26+
**/
27+
--pst-header-height: 44px;
28+
29+
/*****************************************************************************
30+
* Font size
31+
**/
32+
--pst-font-size-base: 14px; /* base font size - applied at body / html level */
33+
34+
/*****************************************************************************
35+
* Font family
36+
**/
37+
/* These are adapted from https://systemfontstack.com/ */
38+
--pst-font-family-sansserif-system: "Trebuchet MS", -apple-system, BlinkMacSystemFont, avenir next,
39+
avenir, "segoe ui", "helvetica neue", helvetica, Ubuntu, roboto, noto, arial, sans-serif;
40+
41+
--pst-font-family-serif-system: "Georgia", "Iowan Old Style", "Apple Garamond", Baskerville,
42+
"Times New Roman", "Droid Serif", Times, "Source Serif Pro", serif, "Apple Color Emoji",
43+
"Segoe UI Emoji", "Segoe UI Symbol";
44+
45+
--pst-font-family-monospace-system: SFMono-Regular, Menlo, Consolas, Monaco,
46+
Liberation Mono, "Lucida Console", monospace;
47+
48+
--pst-font-family-base: var(--pst-font-family-sansserif-system);
49+
--pst-font-family-heading: var(--pst-font-family-serif-system);
50+
--pst-font-family-monospace: var(--pst-font-family-monospace-system);
51+
52+
/*****************************************************************************
53+
* Color
54+
*
55+
* Colors are defined in rgb string way, "red, green, blue"
56+
**/
57+
--pst-color-primary: 0, 45, 86;
58+
--pst-color-text-base: 0, 45, 86;
59+
--pst-color-info: 0, 157, 220;
60+
--pst-color-success: 0, 168, 143;
61+
--pst-color-warning: 250, 166, 52;;
62+
--pst-color-danger: 237, 23, 79;;
63+
64+
--pst-color-h1: var(--pst-color-primary);
65+
--pst-color-h2: var(--pst-color-primary);
66+
--pst-color-h3: var(--pst-color-primary);
67+
--pst-color-h4: var(--pst-color-primary);
68+
--pst-color-h5: var(--pst-color-text-base);
69+
--pst-color-h6: var(--pst-color-text-base);
70+
--pst-color-paragraph: var(--pst-color-text-base);
71+
--pst-color-link: 0, 160, 175;
72+
--pst-color-link-hover: 243, 119, 111;
73+
--pst-color-headerlink: 0, 45, 86;;
74+
--pst-color-headerlink-hover: 218, 211, 204;
75+
--pst-color-preformatted-text: 73, 73, 74;
76+
--pst-color-preformatted-background: 250, 250, 250;
77+
--pst-color-inline-code: 237, 23, 79;
78+
79+
--pst-color-active-navigation: 0, 160, 175;
80+
--pst-color-navbar-link: 245, 245, 245;
81+
--pst-color-navbar-link-hover: var(--pst-color-active-navigation);
82+
--pst-color-navbar-link-active: var(--pst-color-active-navigation);
83+
--pst-color-sidebar-link: 119, 117, 122;
84+
--pst-color-sidebar-link-hover: var(--pst-color-active-navigation);
85+
--pst-color-sidebar-link-active: var(--pst-color-active-navigation);
86+
--pst-color-sidebar-expander-background-hover: 244, 244, 244;
87+
--pst-color-sidebar-caption: 218, 211, 204;
88+
--pst-color-toc-link: var(--pst-color-sidebar-link);
89+
--pst-color-toc-link-hover: var(--pst-color-active-navigation);
90+
--pst-color-toc-link-active: var(--pst-color-active-navigation);
91+
92+
/*****************************************************************************
93+
* Admonitions
94+
**/
95+
--pst-color-admonition-default: var(--pst-color-info);
96+
--pst-color-admonition-note: var(--pst-color-info);
97+
}
98+
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
.. py:currentmodule:: fourinsight.api
22
3-
API
4-
###
5-
63
fourinsight.api
7-
***************
4+
===============
85

96
.. autoclass:: UserSession
107
:members: fetch_token, refresh_token
118

129
.. autoclass:: ClientSession
1310
:members: fetch_token, refresh_token
1411

15-
fourinsight.api.authenticate
16-
****************************
17-
18-
.. autoclass:: fourinsight.api.authenticate.BaseAuthSession
19-
:members:
20-
:inherited-members:

docs/api_ref/authentication.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. py:currentmodule:: fourinsight.api.authenticate
2+
3+
fourinsight.api.authenticate
4+
============================
5+
6+
.. autoclass:: BaseAuthSession
7+
:members:
8+
:inherited-members:
9+

docs/api_ref/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
API reference
2+
=============
3+
This section gives an overview of all public ``fourinsight.api`` objects, functions and methods.
4+
5+
All classes and functions exposed in ``fourinsight.api`` namespace are presented in the
6+
following sub pages:
7+
8+
.. toctree::
9+
:maxdepth: 1
10+
11+
api
12+
authentication

docs/conf.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919

2020

2121
# -- Project information -----------------------------------------------------
22+
_TEMPLATE_VERSION = "1.0.0"
2223

2324
project = "fourinsight-api"
2425
copyright = f"{date.today().year}, 4Subsea"
2526
author = "4Subsea"
2627

2728
# The full version, including alpha/beta/rc tags
2829
version = metadata.version(project)
30+
# version = "0.0.1"
2931
release = version
3032

3133

@@ -50,7 +52,7 @@
5052
}
5153

5254
# Add any paths that contain templates here, relative to this directory.
53-
templates_path = []
55+
templates_path = ["_templates"]
5456

5557
# List of patterns, relative to source directory, that match files and
5658
# directories to ignore when looking for source files.
@@ -68,4 +70,25 @@
6870
# Add any paths that contain custom static files (such as style sheets) here,
6971
# relative to this directory. They are copied after the builtin static files,
7072
# so a file named "default.css" will overwrite the builtin "default.css".
71-
html_static_path = []
73+
html_static_path = ["_static"]
74+
html_css_files = ["css/custom.css"]
75+
html_logo = (
76+
"_static/4insight-logo.svg" # "_static/Logo 4Subsea horisontal negative.png"
77+
)
78+
html_theme_options = {
79+
"external_links": [
80+
{"name": "4Insight.io", "url": "https://4insight.io"},
81+
],
82+
"icon_links": [
83+
{
84+
"name": "GitHub",
85+
"url": "https://github.com/4subsea/fourinsight-api-python",
86+
"icon": "fab fa-github",
87+
},
88+
{
89+
"name": "PyPI",
90+
"url": "https://pypi.org/project/fourinsight-api",
91+
"icon": "fas fa-box",
92+
},
93+
],
94+
}

docs/getting_started.rst

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
1-
21
Getting Started
3-
###############
2+
===============
3+
4+
New to Python?
5+
--------------
6+
You need to have Python installed on your system before you can use this package.
7+
Head over to `Python.org`_ for instructions.
8+
9+
Python version support
10+
----------------------
11+
Officially Python 3.7, 3.8, and 3.9. We aim to support the three most
12+
recent major versions.
13+
14+
OS support
15+
----------
16+
This package is tested with the latest Windows, MacOS, and Ubuntu (Linux) versions.
17+
18+
Install
19+
-------
20+
``fourinsight.api`` can be installed via pip from `PyPI`_.
21+
22+
.. code-block:: shell
23+
24+
pip install fourinsight-api
25+
26+
.. _upgrade:
27+
28+
Upgrade
29+
-------
30+
``fourinsight.api`` can be upgraded via pip from `PyPI`_.
31+
32+
.. code-block:: shell
433
5-
Authentication and authorization
6-
******************************************
34+
pip install --upgrade fourinsight-api
735
36+
Authentication
37+
--------------
838
Your data may be your most valued treasure and security is no laughing matter!
939
At least we take it very seriously. Every API call requires authentication and
1040
every bit of data (pun intended) requires authorization to access.
@@ -17,21 +47,5 @@ organization. For single user access, :ref:`contact us <support>` and we will ho
1747
For non-interactive applications (daemons), you would need
1848
a set of ``client_id`` and ``client_secret``. :ref:`Contact us <support>` and we will help you.
1949

20-
How to install
21-
**************
22-
23-
:py:mod:`fourinsight.api` is written in pure Python and supports Windows,
24-
Linux, and MacOS. Python >=3.7 is officially supported.
25-
26-
.. _install-upgrade:
27-
28-
To install using `pip`_::
29-
30-
pip install fourinsight-api
31-
32-
And to upgrade to the latest version::
33-
34-
pip install --upgrade fourinsight-api
35-
36-
37-
.. _pip: https://pypi.org/project/fourinsight-api/
50+
.. _Python.org: https://python.org
51+
.. _PyPI: https://pypi.org/

docs/index.rst

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
.. include:: ../README.rst
22

3-
Contents
4-
========
53

64
.. toctree::
7-
:glob:
8-
:titlesonly:
9-
:maxdepth: 2
5+
:hidden:
106

117
getting_started
12-
basic_usage
13-
logging
14-
api
15-
developer
8+
user_guide/index
9+
api_ref/index
10+
release_notes
1611
support

docs/release_notes.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Release Notes
2+
=============
3+
4+
v0.1.3
5+
------
6+
7+
- Update documentation
8+
9+
v0.1.2
10+
------
11+
12+
- fix: issue with re-authenticating when refresh-token expire
13+
14+
v0.1.1
15+
------
16+
17+
- First public release

0 commit comments

Comments
 (0)