From 14710581adf76b7931df09ce7ce9df4501ffde41 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 16 Jul 2020 00:12:20 +0200 Subject: [PATCH] Use inline highlighting Signed-off-by: DL6ER --- docs/api/dns/blocking.md | 10 +++++++++- docs/api/dns/cache.md | 8 ++++---- docs/api/domainlists.md | 14 +++++++++----- docs/api/index.md | 4 ++++ mkdocs.yml | 3 +++ 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/docs/api/dns/blocking.md b/docs/api/dns/blocking.md index 222df37..7b9dbeb 100644 --- a/docs/api/dns/blocking.md +++ b/docs/api/dns/blocking.md @@ -52,6 +52,10 @@ } ``` + **Reply type** + + Object + **Fields** ??? info "Status (`"blocking": boolean`)" @@ -73,7 +77,7 @@ - `POST /api/dns/blocking` -???+ example "Request (required authorization)" +???+ example "Request (requires authorization)" === "cURL" @@ -125,6 +129,10 @@ } ``` + **Reply type** + + Object + **Fields** See description of the `GET` request above. Remember that `timer` may be `null` if there is no active timer. diff --git a/docs/api/dns/cache.md b/docs/api/dns/cache.md index b84cecc..125341f 100644 --- a/docs/api/dns/cache.md +++ b/docs/api/dns/cache.md @@ -5,7 +5,7 @@ - `GET /api/dns/cache` -???+ example "Request (required authorization)" +???+ example "Request (requires authorization)" === "cURL" @@ -53,13 +53,13 @@ ??? info "DNS cache size (`"cache_size": number`)" Size of the DNS domain cache, defaulting to 10,000 entries. You typically specify this number directly in `/etc/dnsmasq.d/01-pihole.conf`. It is the number of entries that can be actively cached at the same time. There is no benefit in enlarging this number *except* if the DNS cache evictions count is larger than zero. - This information may also be queried using `dig +short chaos txt cachesize.bind` + This information may also be queried using `#!bash dig +short chaos txt cachesize.bind` ??? info "DNS cache insertions (`"cache_inserted": number`)" Number of total insertions into the cache. This number can be substantially larger than DNS cache size as expiring cache entries naturally make room for new insertions over time. Each lookup with a non-zero TTL will be cached. - This information may also be queried using `dig +short chaos txt insertions.bind` + This information may also be queried using `#!bash dig +short chaos txt insertions.bind` ??? info "DNS cache evictions (`"cache_evicted": number`)" @@ -67,7 +67,7 @@ The cache size should be increased when the number of evicted cache entries is larger than zero. - This information may also be queried using `dig +short chaos txt evictions.bind` + This information may also be queried using `#!bash dig +short chaos txt evictions.bind` diff --git a/docs/api/domainlists.md b/docs/api/domainlists.md index 575a01e..5edde38 100644 --- a/docs/api/domainlists.md +++ b/docs/api/domainlists.md @@ -8,7 +8,7 @@ - `GET /api/blacklist/regex` -???+ example "Request (required authorization)" +???+ example "Request (requires authorization)" === "cURL" @@ -73,9 +73,13 @@ ??? info "Addition time (`"date_added": number`)" Unix timestamp of addition of this item to Pi-hole's database. + Use `#!bash date -d @1589108911` to obtain a human-readable datetime string. + ??? info "Modification time (`"date_modified": number`)" Unix timestamp of modification of this item in Pi-hole's database. + Use `#!bash date -d @1589104951` to obtain a human-readable datetime string. + ??? info "Comment (`"comment": [null|string]`)" User-provided free-text comment for this item. May be `null` if not specified. @@ -104,7 +108,7 @@ - `GET /api/blacklist/regex/` -???+ example "Request (required authorization)" +???+ example "Request (requires authorization)" === "cURL" @@ -186,7 +190,7 @@ - `PATCH /api/blacklist/regex` -???+ example "Request (required authorization)" +???+ example "Request (requires authorization)" === "cURL" @@ -278,7 +282,7 @@ - `DELETE /api/blacklist/regex/` -???+ example "Request (required authorization)" +???+ example "Request (requires authorization)" === "cURL" @@ -339,7 +343,7 @@ Response code: `HTTP/1.1 204 No Content` -??? failure "Error response (database permission error)" +??? failure "Error response" Response code: `HTTP/1.1 402 - Request failed` diff --git a/docs/api/index.md b/docs/api/index.md index a82cdf0..a35d54d 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -99,6 +99,10 @@ The form of replies to successful requests strongly depends on the selected endp } ``` + **Reply type** + + Object or Array + In contrast, errors have a uniform style to ease their programatic treatment: ???+ failure "Example reply: Error (unauthorized access)" diff --git a/mkdocs.yml b/mkdocs.yml index 46f14ee..950d20b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -94,6 +94,9 @@ markdown_extensions: # Tabbed provides a syntax to easily add tabbed Markdown content. # (https://facelessuser.github.io/pymdown-extensions/extensions/tabbed/) - pymdownx.tabbed + # InlineHilite is an inline code highlighter inspired by CodeHilite. + # (https://facelessuser.github.io/pymdown-extensions/extensions/inlinehilite/) + - pymdownx.inlinehilite nav: - Overview: index.md