thuliteio / doks

Everything you need to build a stellar documentation website. Fast, accessible, and easy to use.
https://getdoks.org
MIT License
2.1k stars 359 forks source link

feat: allow custom kroki host #1266

Closed l-zeuch closed 2 months ago

l-zeuch commented 2 months ago

See https://github.com/gethyas/doks-core/pull/102. Body copied below.

Summary

Allow users to provide a custom Kroki URL instead of hard-coding https://kroki.io.

Basic example

In params.toml, users of this theme can set a custom Kroki URL, such as a local instance:

[doks]
    krokiURL = "http://localhost:8000"

I tried my best to keep proper backwards compatibility should users not provide this configuration key at all—see the diff. Should this not be acceptable, please let me know.

Motivation

At times, the upstream kroki.io service may run into resource exhaustion. This can be due to a high volume of requests or a temporary outage. During an automated build, this isn't so bad—caches should exist and therefore not hit Kroki as often.

However, especially during the writing phase of documentation, where fast iteration is often needed, it is not helpful when the upstream service runs into said resource exhaustion and responds with an unhelpful "Bad Request" error.

This issue is known and understood by the Kroki team; the fix is to run your own instance.^1

Checks

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 009064ad81d018521992ea2b6451b0906a02a1a0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---- | ----- | | doks | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR