File: justfile

package info (click to toggle)
tmuxp 1.64.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,500 kB
  • sloc: python: 17,788; sh: 22; makefile: 6
file content (210 lines) | stat: -rw-r--r-- 6,266 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# justfile for tmuxp documentation
# https://just.systems/

set shell := ["bash", "-uc"]

# Configuration
http_port := "8031"
builddir := "_build"
sphinxopts := ""
sphinxbuild := "uv run sphinx-build"
sourcedir := "."

# Environment to disable colors in Sphinx + argparse output
export PYTHON_COLORS := "0"
export NO_COLOR := "1"

# File patterns for watching
watch_files := "find .. -type f -not -path '*/\\.*' | grep -i '.*[.]\\(rst\\|md\\)$\\|.*[.]py$\\|CHANGES\\|TODO\\|.*conf\\.py' 2> /dev/null"

# Sphinx options
allsphinxopts := "-d " + builddir + "/doctrees " + sphinxopts + " ."

# List all available commands
default:
    @just --list

# Build HTML documentation
[group: 'build']
html:
    {{ sphinxbuild }} -b html {{ allsphinxopts }} {{ builddir }}/html
    @echo ""
    @echo "Build finished. The HTML pages are in {{ builddir }}/html."

# Build directory HTML files
[group: 'build']
dirhtml:
    {{ sphinxbuild }} -b dirhtml {{ allsphinxopts }} {{ builddir }}/dirhtml
    @echo ""
    @echo "Build finished. The HTML pages are in {{ builddir }}/dirhtml."

# Build single HTML file
[group: 'build']
singlehtml:
    {{ sphinxbuild }} -b singlehtml {{ allsphinxopts }} {{ builddir }}/singlehtml
    @echo ""
    @echo "Build finished. The HTML page is in {{ builddir }}/singlehtml."

# Build EPUB
[group: 'build']
epub:
    {{ sphinxbuild }} -b epub {{ allsphinxopts }} {{ builddir }}/epub
    @echo ""
    @echo "Build finished. The epub file is in {{ builddir }}/epub."

# Build LaTeX files
[group: 'build']
latex:
    {{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }}/latex
    @echo ""
    @echo "Build finished; the LaTeX files are in {{ builddir }}/latex."

# Build PDF via LaTeX
[group: 'build']
latexpdf:
    {{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }}/latex
    @echo "Running LaTeX files through pdflatex..."
    make -C {{ builddir }}/latex all-pdf
    @echo "pdflatex finished; the PDF files are in {{ builddir }}/latex."

# Build plain text files
[group: 'build']
text:
    {{ sphinxbuild }} -b text {{ allsphinxopts }} {{ builddir }}/text
    @echo ""
    @echo "Build finished. The text files are in {{ builddir }}/text."

# Build man pages
[group: 'build']
man:
    {{ sphinxbuild }} -b man {{ allsphinxopts }} {{ builddir }}/man
    @echo ""
    @echo "Build finished. The manual pages are in {{ builddir }}/man."

# Build JSON output
[group: 'build']
json:
    {{ sphinxbuild }} -b json {{ allsphinxopts }} {{ builddir }}/json
    @echo ""
    @echo "Build finished; now you can process the JSON files."

# Clean build directory
[group: 'misc']
[confirm]
clean:
    rm -rf {{ builddir }}/*

# Build HTML help files
[group: 'misc']
htmlhelp:
    {{ sphinxbuild }} -b htmlhelp {{ allsphinxopts }} {{ builddir }}/htmlhelp
    @echo ""
    @echo "Build finished; now you can run HTML Help Workshop with the .hhp project file in {{ builddir }}/htmlhelp."

# Build Qt help files
[group: 'misc']
qthelp:
    {{ sphinxbuild }} -b qthelp {{ allsphinxopts }} {{ builddir }}/qthelp
    @echo ""
    @echo "Build finished; now you can run 'qcollectiongenerator' with the .qhcp project file in {{ builddir }}/qthelp."

# Build Devhelp files
[group: 'misc']
devhelp:
    {{ sphinxbuild }} -b devhelp {{ allsphinxopts }} {{ builddir }}/devhelp
    @echo ""
    @echo "Build finished."

# Build Texinfo files
[group: 'misc']
texinfo:
    {{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }}/texinfo
    @echo ""
    @echo "Build finished. The Texinfo files are in {{ builddir }}/texinfo."

# Build Info files from Texinfo
[group: 'misc']
info:
    {{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }}/texinfo
    @echo "Running Texinfo files through makeinfo..."
    make -C {{ builddir }}/texinfo info
    @echo "makeinfo finished; the Info files are in {{ builddir }}/texinfo."

# Build gettext catalogs
[group: 'misc']
gettext:
    {{ sphinxbuild }} -b gettext {{ sphinxopts }} . {{ builddir }}/locale
    @echo ""
    @echo "Build finished. The message catalogs are in {{ builddir }}/locale."

# Check all external links
[group: 'validate']
linkcheck:
    {{ sphinxbuild }} -b linkcheck {{ allsphinxopts }} {{ builddir }}/linkcheck
    @echo ""
    @echo "Link check complete; look for any errors in the above output or in {{ builddir }}/linkcheck/output.txt."

# Run doctests embedded in documentation
[group: 'validate']
doctest:
    {{ sphinxbuild }} -b doctest {{ allsphinxopts }} {{ builddir }}/doctest
    @echo "Testing of doctests in the sources finished, look at the results in {{ builddir }}/doctest/output.txt."

# Check build from scratch
[group: 'validate']
checkbuild:
    rm -rf {{ builddir }}
    {{ sphinxbuild }} -n -q ./ {{ builddir }}

# Build redirects configuration
[group: 'misc']
redirects:
    {{ sphinxbuild }} -b rediraffewritediff {{ allsphinxopts }} {{ builddir }}/redirects
    @echo ""
    @echo "Build finished. The redirects are in rediraffe_redirects."

# Show changes overview
[group: 'misc']
changes:
    {{ sphinxbuild }} -b changes {{ allsphinxopts }} {{ builddir }}/changes
    @echo ""
    @echo "The overview file is in {{ builddir }}/changes."

# Watch files and rebuild on change
[group: 'dev']
watch:
    #!/usr/bin/env bash
    set -euo pipefail
    if command -v entr > /dev/null; then
        ${{ watch_files }} | entr -c just html
    else
        just html
    fi

# Serve documentation via Python http.server
[group: 'dev']
serve:
    @echo '=============================================================='
    @echo ''
    @echo 'docs server running at http://localhost:{{ http_port }}/'
    @echo ''
    @echo '=============================================================='
    python -m http.server {{ http_port }} --directory {{ builddir }}/html

# Watch and serve simultaneously
[group: 'dev']
dev:
    #!/usr/bin/env bash
    set -euo pipefail
    just watch &
    just serve

# Start sphinx-autobuild server
[group: 'dev']
start:
    uv run sphinx-autobuild "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }}

# Design mode: watch static files and disable incremental builds
[group: 'dev']
design:
    uv run sphinx-autobuild "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }} --watch "." -a