Skip to content

Commit 722018d

Browse files
jirikuncarnmueschKaylyn
authored
Add mkdocs configuration (#61)
* Add mkdocs configuration * Update mkdocs + images + github action to build * Update docs/README.md Co-authored-by: Kaylyn <[email protected]> * Update docs/README.md Co-authored-by: Kaylyn <[email protected]> * Update docs/README.md Co-authored-by: Kaylyn <[email protected]> Co-authored-by: Nicholas Muesch <[email protected]> Co-authored-by: Kaylyn <[email protected]>
1 parent 8cf0e4c commit 722018d

File tree

6 files changed

+253
-2
lines changed

6 files changed

+253
-2
lines changed

.github/workflows/docs.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
# Fetch all history for applying timestamps to every page
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: '3.8'
25+
26+
- name: Upgrade Python packaging tools
27+
run: pip install --disable-pip-version-check --upgrade pip setuptools wheel
28+
29+
- name: Install tox
30+
run: pip install tox
31+
32+
- name: Build documentation
33+
run: tox -e docs build
34+
35+
- uses: actions/upload-artifact@v2
36+
with:
37+
name: documentation
38+
path: site
39+
40+
publish:
41+
runs-on: ubuntu-latest
42+
43+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
44+
needs:
45+
- build
46+
47+
steps:
48+
- uses: actions/download-artifact@v2
49+
with:
50+
name: documentation
51+
path: site
52+
53+
- uses: peaceiris/actions-gh-pages@v3
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
publish_dir: ./site
57+
commit_message: ${{ github.event.head_commit.message }}
58+
# Write .nojekyll at the root, see:
59+
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
60+
enable_jekyll: false
61+
# Only deploy if there were changes
62+
allow_empty_commit: false

docs/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# datadog-api-client-python
2+
3+
Collection of all of the Datadog public endpoints. For the official documentation, see the [Datadog API Reference](https://docs.datadoghq.com/api/).
4+
5+
This python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
6+
7+
Need help? Reach out to our awesome [support team](https://www.datadoghq.com/support/).
8+
9+
## Author
10+
11+

docs/assets/images/favicon.ico

39.5 KB
Binary file not shown.

docs/assets/images/logo.svg

Lines changed: 39 additions & 0 deletions
Loading

mkdocs.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
site_name: Datadog API Client for Python
2+
site_description: The home of Datadog API Python Client documentation
3+
site_author: Datadog
4+
site_url: https://datadoghq.dev/datadog-api-client-python/
5+
repo_name: datadog/datadog-api-client-python
6+
repo_url: https://github.com/DataDog/datadog-api-client-python
7+
edit_uri: blob/master/docs
8+
copyright: 'Copyright &copy; Datadog, Inc. 2020-present'
9+
10+
docs_dir: docs
11+
site_dir: site
12+
theme:
13+
name: material
14+
language: en
15+
# features:
16+
# - navigation.tabs
17+
# https://github.com/facelessuser/pymdown-extensions/issues/876#issuecomment-610164436
18+
# - navigation.instant
19+
palette:
20+
scheme: slate
21+
primary: deep purple
22+
accent: deep purple
23+
font:
24+
text: Roboto
25+
code: Roboto Mono
26+
icon:
27+
repo: fontawesome/brands/github-alt
28+
favicon: assets/images/favicon.ico
29+
logo: assets/images/logo.svg
30+
31+
nav:
32+
- API:
33+
- 'Version 1': v1/
34+
- 'Version 2': v2/
35+
36+
plugins:
37+
# Built-in
38+
- search:
39+
# Extra
40+
- minify:
41+
minify_html: true
42+
- git-revision-date-localized:
43+
type: date
44+
- mkdocstrings:
45+
default_handler: python
46+
handlers:
47+
python:
48+
rendering:
49+
show_if_no_docstring: yes
50+
show_root_heading: yes
51+
show_source: true
52+
53+
markdown_extensions:
54+
# Built-in
55+
- markdown.extensions.abbr:
56+
- markdown.extensions.admonition:
57+
- markdown.extensions.footnotes:
58+
- markdown.extensions.tables:
59+
- markdown.extensions.toc:
60+
permalink: true
61+
toc_depth: "1-6"
62+
# Extra
63+
- pymdownx.arithmatex:
64+
- pymdownx.betterem:
65+
smart_enable: all
66+
- pymdownx.caret:
67+
- pymdownx.critic:
68+
- pymdownx.details:
69+
- pymdownx.emoji:
70+
# https://github.com/twitter/twemoji
71+
# https://raw.githubusercontent.com/facelessuser/pymdown-extensions/master/pymdownx/twemoji_db.py
72+
emoji_index: !!python/name:materialx.emoji.twemoji
73+
emoji_generator: !!python/name:materialx.emoji.to_svg
74+
- pymdownx.highlight:
75+
guess_lang: false
76+
linenums_style: pymdownx-inline
77+
use_pygments: true
78+
- pymdownx.inlinehilite:
79+
- pymdownx.keys:
80+
- pymdownx.magiclink:
81+
repo_url_shortener: true
82+
repo_url_shorthand: true
83+
social_url_shortener: true
84+
social_url_shorthand: true
85+
provider: github
86+
user: DataDog
87+
repo: datadog-api-client-python
88+
- pymdownx.mark:
89+
- pymdownx.progressbar:
90+
- pymdownx.smartsymbols:
91+
- pymdownx.superfences:
92+
custom_fences:
93+
- name: mermaid
94+
class: mermaid
95+
format: !!python/name:pymdownx.superfences.fence_code_format
96+
- name: math
97+
class: arithmatex
98+
format: !!python/name:pymdownx.arithmatex.fence_mathjax_format
99+
- pymdownx.tabbed:
100+
- pymdownx.tasklist:
101+
custom_checkbox: true
102+
- pymdownx.tilde:
103+
104+
extra:
105+
social:
106+
- icon: fontawesome/solid/blog
107+
link: https://www.datadoghq.com/blog/engineering/
108+
- icon: fontawesome/brands/github-alt
109+
link: https://github.com/DataDog
110+
- icon: fontawesome/brands/twitter
111+
link: https://twitter.com/datadoghq
112+
- icon: fontawesome/brands/instagram
113+
link: https://www.instagram.com/datadoghq

tox.ini

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
[tox]
2-
envlist = py36, py37, py38
2+
envlist = py36, py37, py38, docs
33

44
[testenv]
55
extras= tests
6-
76
commands=pytest
7+
8+
9+
[testenv:docs]
10+
skip_install = true
11+
passenv = *
12+
basepython = python3
13+
deps =
14+
--use-feature=2020-resolver
15+
mkdocs>=1.1.1
16+
; theme
17+
mkdocs-material>=5.2.1
18+
; plugins
19+
mkdocs-minify-plugin>=0.3.0
20+
mkdocs-git-revision-date-localized-plugin>=0.5.2
21+
mkdocstrings>=0.11.0
22+
; Extensions
23+
pymdown-extensions>=7.1
24+
mkdocs-material-extensions>=1.0
25+
mkpatcher>=1.0.2
26+
; Necessary for syntax highlighting in code blocks
27+
Pygments>=2.6.1
28+
setenv =
29+
; Use a set timestamp for reproducible builds.
30+
; See https://reproducible-builds.org/specs/source-date-epoch/
31+
SOURCE_DATE_EPOCH=1580601600
32+
commands =
33+
python -m mkdocs {posargs}

0 commit comments

Comments
 (0)