Skip to content

Commit 7df5f70

Browse files
authored
docs: improve documentation and add theme toggle (#17)
1 parent 3803e2b commit 7df5f70

8 files changed

Lines changed: 77 additions & 7 deletions

File tree

docs/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source "https://rubygems.org"
22

3-
gem "jekyll", "~> 4.3"
4-
gem "just-the-docs"
3+
gem "jekyll", "~> 4.4.1"
4+
gem "just-the-docs" , "~> 0.11.0"
55
gem "webrick"
66
gem "jekyll-seo-tag"
77
gem "listen"

docs/_config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ url: "https://reugn.github.io"
1111
# Theme
1212
theme: just-the-docs
1313

14+
# Sass (silence deprecation warnings from theme)
15+
sass:
16+
quiet_deps: true
17+
silence_deprecations:
18+
- import
19+
- global-builtin
20+
- color-functions
21+
1422
# Color scheme
15-
color_scheme: dark
23+
color_scheme: light
1624

1725
# Aux links (top right)
1826
aux_links:

docs/_includes/head_custom.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,56 @@
11
<link rel="icon" href="{{ '/assets/images/favicon.svg' | relative_url }}" type="image/svg+xml">
22

3+
<!-- Determine theme before loading stylesheets -->
4+
<script>
5+
var jtdTheme = localStorage.getItem('jtd-theme') || 'light';
6+
document.documentElement.setAttribute('data-theme', jtdTheme);
7+
</script>
8+
9+
<!-- Theme stylesheets - disabled state set dynamically -->
10+
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-light.css' | relative_url }}" id="jtd-light">
11+
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-dark.css' | relative_url }}" id="jtd-dark">
12+
<script>
13+
(function() {
14+
var isDark = jtdTheme === 'dark';
15+
document.getElementById('jtd-light').disabled = isDark;
16+
document.getElementById('jtd-dark').disabled = !isDark;
17+
})();
18+
19+
function toggleTheme() {
20+
var current = document.documentElement.getAttribute('data-theme') || 'light';
21+
var newTheme = current === 'light' ? 'dark' : 'light';
22+
23+
document.documentElement.setAttribute('data-theme', newTheme);
24+
25+
var lightCss = document.getElementById('jtd-light');
26+
var darkCss = document.getElementById('jtd-dark');
27+
var isDark = newTheme === 'dark';
28+
if (lightCss) lightCss.disabled = isDark;
29+
if (darkCss) darkCss.disabled = !isDark;
30+
31+
try {
32+
localStorage.setItem('jtd-theme', newTheme);
33+
} catch (e) {}
34+
}
35+
</script>
36+
37+
<style>
38+
.theme-toggle {
39+
background: none;
40+
border: none;
41+
cursor: pointer;
42+
padding: 4px 8px;
43+
font-size: 1.1rem;
44+
color: var(--link-color);
45+
vertical-align: middle;
46+
margin-right: 0.5rem;
47+
}
48+
.theme-toggle:hover {
49+
opacity: 0.7;
50+
}
51+
/* Show correct icon based on theme */
52+
.icon-sun { display: none; }
53+
.icon-moon { display: inline; }
54+
[data-theme="dark"] .icon-sun { display: inline; }
55+
[data-theme="dark"] .icon-moon { display: none; }
56+
</style>

docs/_includes/header_custom.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<button class="theme-toggle" onclick="toggleTheme()" title="Toggle theme">
2+
<span class="icon-moon">🌑</span><span class="icon-sun">☀️</span>
3+
</button>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import "just-the-docs";
2+
:root {
3+
--color-scheme: dark;
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "css/just-the-docs.scss";

docs/configuration/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Or create `.github-ci.yaml` manually in your repository root.
2323

2424
```yaml
2525
run:
26-
timeout: 5m # timeout for GitHub API operations
26+
timeout: 5m # maximum duration for command execution
2727
issues-exit-code: 1 # exit code when issues are found
2828

2929
linters:

docs/configuration/run.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ run:
1919
2020
### timeout
2121
22-
Maximum time allowed for GitHub API operations.
22+
Maximum time allowed for command execution.
2323
2424
| Value | Description |
2525
|-------|-------------|
@@ -28,11 +28,11 @@ Maximum time allowed for GitHub API operations.
2828
| `5m` | 5 minutes (default) |
2929
| `1h` | 1 hour |
3030

31-
This is useful for CI/CD environments with strict time limits. If the timeout is reached, the command will fail.
31+
When the timeout is reached, the command is cancelled.
3232

3333
```yaml
3434
run:
35-
timeout: 2m # Fail if API calls take longer than 2 minutes
35+
timeout: 2m # Maximum duration for the entire command execution
3636
```
3737

3838
### issues-exit-code

0 commit comments

Comments
 (0)