Skip to content

Commit c1ff3b2

Browse files
authored
Update docs (#1097)
Signed-off-by: Ethan S. Chen <[email protected]>
1 parent e3bfa1f commit c1ff3b2

File tree

201 files changed

+1216
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+1216
-355
lines changed

.github/workflows/github-pages.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
build:
3232
runs-on: ubuntu-latest
3333
env:
34-
HUGO_VERSION: 0.115.4
34+
HUGO_VERSION: 0.145.0
3535
steps:
3636
- name: Install Hugo CLI
3737
run: |

docs/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.hugo_build.lock
1+
.hugo_build.lock

docs/README.md

+17-22
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
Docs
2-
----
1+
# Docs
32

43
This directory contains [hugo](https://gohugo.io) documentation to be published in Github pages.
54

6-
Run Locally
7-
-----------
5+
## Dependencies
86

9-
```
7+
- [Geekdocs v1.5.0](https://github.com/thegeeklab/hugo-geekdoc/releases/tag/v1.5.0)
8+
- [Hugo v0.145.0](https://github.com/gohugoio/hugo/releases/tag/v0.145.0)
9+
10+
## Run Locally
11+
12+
To serve the documentation locally, run the following command:
13+
14+
```shell
1015
hugo server -D
1116
```
1217

1318
This will serve the docs on [http://localhost:1313](http://localhost:1313).
1419

15-
Deploy to Github Pages
16-
----------------------
17-
18-
Changes to the `main` branch will be deployed automatically with Github actions.
19-
20-
Update Geekdocs
21-
---------------
20+
## Update Geekdocs
2221

2322
The docs use the [Geekdocs](https://geekdocs.de/) theme. The theme is checked in to Github in the `./docs/themes/hugo-geekdoc/` folder. To update [Geekdocs](https://geekdocs.de/), remove the current folder and create a new one with the latest [release](https://github.com/thegeeklab/hugo-geekdoc/releases). There are no local modifications in `./docs/themes/hugo-geekdoc/`.
2423

25-
Notes
26-
-----
27-
28-
Here's how the initial `docs/` folder was set up:
29-
30-
```
31-
hugo new site docs
32-
cd docs/
24+
```shell
25+
rm -rf ./docs/themes/hugo-geekdoc
3326
mkdir -p themes/hugo-geekdoc/
34-
curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/download/v0.41.1/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1
27+
curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1
3528
```
3629

37-
Create the initial `hugo.toml` file as described in [https://geekdocs.de/usage/getting-started/](https://geekdocs.de/usage/getting-started/).
30+
## Deploy to Github Pages
31+
32+
Changes to the `master` branch will be deployed automatically with Github actions.

docs/content/_index.md

+46-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
---
2-
title: "client_python"
2+
title: client_python
3+
weight: 1
34
---
45

5-
This is the documentation for the [Prometheus Python client library](https://github.com/prometheus/client_python).
6+
This tutorial shows the quickest way to get started with the Prometheus Python library.
7+
8+
**One**: Install the client:
9+
10+
```shell
11+
pip install prometheus-client
12+
```
13+
14+
**Two**: Paste the following into a Python interpreter:
15+
16+
```python
17+
from prometheus_client import start_http_server, Summary
18+
import random
19+
import time
20+
21+
# Create a metric to track time spent and requests made.
22+
REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request')
23+
24+
# Decorate function with metric.
25+
@REQUEST_TIME.time()
26+
def process_request(t):
27+
"""A dummy function that takes some time."""
28+
time.sleep(t)
29+
30+
if __name__ == '__main__':
31+
# Start up the server to expose the metrics.
32+
start_http_server(8000)
33+
# Generate some requests.
34+
while True:
35+
process_request(random.random())
36+
```
37+
38+
**Three**: Visit [http://localhost:8000/](http://localhost:8000/) to view the metrics.
39+
40+
From one easy to use decorator you get:
41+
42+
* `request_processing_seconds_count`: Number of times this function was called.
43+
* `request_processing_seconds_sum`: Total amount of time spent in this function.
44+
45+
Prometheus's `rate` function allows calculation of both requests per second,
46+
and latency over time from this data.
47+
48+
In addition if you're on Linux the `process` metrics expose CPU, memory and
49+
other information about the process for free!

docs/content/getting-started/_index.md

-4
This file was deleted.

docs/content/getting-started/three-step-demo.md

-48
This file was deleted.

docs/hugo.toml

+95-6
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ theme = "hugo-geekdoc"
55

66
pluralizeListTitles = false
77

8-
# Geekdoc required configuration
9-
#pygmentsUseClasses = true
10-
pygmentsUseClasses = false
8+
# Required to get well formatted code blocks
9+
pygmentsUseClasses = true
1110
pygmentsCodeFences = true
1211
disablePathToLower = true
13-
# geekdocFileTreeSortBy = "linkTitle"
12+
enableGitInfo = true
1413

1514
# Required if you want to render robots.txt template
1615
enableRobotsTXT = true
1716

18-
# Needed for mermaid shortcodes
1917
[markup]
2018
[markup.goldmark.renderer]
21-
# Needed for mermaid shortcode
19+
# Needed for mermaid shortcode or when nesting shortcodes (e.g. img within
20+
# columns or tabs)
2221
unsafe = true
2322
[markup.tableOfContents]
2423
startLevel = 1
@@ -28,3 +27,93 @@ enableRobotsTXT = true
2827

2928
[taxonomies]
3029
tag = "tags"
30+
31+
[params]
32+
# (Optional, default 6) Set how many table of contents levels to be showed on page.
33+
# Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/)
34+
# You can also specify this parameter per page in front matter.
35+
geekdocToC = 3
36+
37+
# (Optional, default static/brand.svg) Set the path to a logo for the Geekdoc
38+
# relative to your 'static/' folder.
39+
geekdocLogo = "brand.svg"
40+
41+
# (Optional, default false) Render menu from data file in 'data/menu/main.yaml'.
42+
# See also https://geekdocs.de/usage/menus/#bundle-menu.
43+
geekdocMenuBundle = false
44+
45+
# (Optional, default false) Collapse all menu entries, can not be overwritten
46+
# per page if enabled. Can be enabled per page via 'geekdocCollapseSection'.
47+
geekdocCollapseAllSections = false
48+
49+
# (Optional, default true) Show page navigation links at the bottom of each docs page.
50+
geekdocNextPrev = true
51+
52+
# (Optional, default true) Show a breadcrumb navigation bar at the top of each docs page.
53+
# You can also specify this parameter per page in front matter.
54+
geekdocBreadcrumb = true
55+
56+
# (Optional, default none) Set source repository location. Used for 'Edit page' links.
57+
# You can also specify this parameter per page in front matter.
58+
geekdocRepo = "https://github.com/prometheus/client_python"
59+
60+
# (Optional, default none) Enable 'Edit page' links. Requires 'geekdocRepo' param
61+
# and the path must point to the parent directory of the 'content' folder.
62+
# You can also specify this parameter per page in front matter.
63+
geekdocEditPath = "edit/master/docs"
64+
65+
# (Optional, default false) Show last modification date of the page in the header.
66+
# Keep in mind that last modification date works best if `enableGitInfo` is set to true.
67+
geekdocPageLastmod = true
68+
69+
# (Optional, default true) Enables search function with flexsearch.
70+
# Index is built on the fly and might slow down your website.
71+
geekdocSearch = true
72+
73+
# (Optional, default false) Display search results with the parent folder as prefix. This
74+
# option allows you to distinguish between files with the same name in different folders.
75+
# NOTE: This parameter only applies when 'geekdocSearch = true'.
76+
geekdocSearchShowParent = true
77+
78+
# (Optional, default true) Add an anchor link to headlines.
79+
geekdocAnchor = true
80+
81+
# (Optional, default true) Copy anchor url to clipboard on click.
82+
geekdocAnchorCopy = true
83+
84+
# (Optional, default true) Enable or disable image lazy loading for images rendered
85+
# by the 'img' shortcode.
86+
geekdocImageLazyLoading = true
87+
88+
# (Optional, default false) Set HTMl <base> to .Site.Home.Permalink if enabled. It might be required
89+
# if a subdirectory is used within Hugos BaseURL.
90+
# See https://developer.mozilla.org/de/docs/Web/HTML/Element/base.
91+
geekdocOverwriteHTMLBase = false
92+
93+
# (Optional, default true) Enable or disable the JavaScript based color theme toggle switch. The CSS based
94+
# user preference mode still works.
95+
geekdocDarkModeToggle = true
96+
97+
# (Optional, default false) Auto-decrease brightness of images and add a slightly grayscale to avoid
98+
# bright spots while using the dark mode.
99+
geekdocDarkModeDim = false
100+
101+
# (Optional, default false) Enforce code blocks to always use the dark color theme.
102+
geekdocDarkModeCode = false
103+
104+
# (Optional, default true) Display a "Back to top" link in the site footer.
105+
geekdocBackToTop = true
106+
107+
# (Optional, default false) Enable or disable adding tags for post pages automatically to the navigation sidebar.
108+
geekdocTagsToMenu = true
109+
110+
# (Optional, default 'title') Configure how to sort file-tree menu entries. Possible options are 'title', 'linktitle',
111+
# 'date', 'publishdate', 'expirydate' or 'lastmod'. Every option can be used with a reverse modifier as well
112+
# e.g. 'title_reverse'.
113+
geekdocFileTreeSortBy = "title"
114+
115+
# (Optional, default none) Adds a "Content licensed under <license>" line to the footer.
116+
# Could be used if you want to define a default license for your content.
117+
[params.geekdocContentLicense]
118+
name = "Apache License 2.0"
119+
link = "https://github.com/prometheus/client_python/blob/master/LICENSE"

docs/themes/hugo-geekdoc/.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

docs/themes/hugo-geekdoc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Geekdoc
22

33
[![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/hugo-geekdoc/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/hugo-geekdoc)
4-
[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io)
4+
[![Hugo Version](https://img.shields.io/badge/hugo-0.124-blue.svg)](https://gohugo.io)
55
[![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest)
66
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors)
77
[![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE)

docs/themes/hugo-geekdoc/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.41.1
1+
v1.5.0

0 commit comments

Comments
 (0)