mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-17 20:05:24 +00:00
16a7cbca91
Spell checking can now run in automated mode. === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ Author: Yaroslav Halchenko <debian@onerussian.com> Signed-off-by: David Sterba <dsterba@suse.com>
48 lines
883 B
Bash
Executable File
48 lines
883 B
Bash
Executable File
#!/bin/sh
|
|
# Generate manual page preview as rendered to a terminal, without colors or
|
|
# text attributes, encapsulated html, usable for CI summary
|
|
|
|
if ! [ -f "$1" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
width=120
|
|
prefix=Documentation/
|
|
here=$(pwd)
|
|
|
|
if [ "$(basename \"$here\")" = 'Documentation' ]; then
|
|
prefix=
|
|
fi
|
|
|
|
fn="$1"
|
|
bn=$(basename "$fn" .rst)
|
|
|
|
if [ "$bn" = 'btrfs-man5' ]; then
|
|
# This is the only page that does not follow from the file name,
|
|
# the translation could be done using the man_pages table in conf.py
|
|
# but for one entry let's add a exception here
|
|
man="${prefix}_build/man/btrfs.5"
|
|
else
|
|
man=$(find "${prefix}"_build/man -name "$bn".'[0-9]')
|
|
fi
|
|
|
|
if ! [ -f "$man" ]; then
|
|
#echo "ERROR: cannot find manual page '$man' from bn $bn fn $fn <br/>"
|
|
exit 0
|
|
fi
|
|
|
|
cat << EOF
|
|
<details>
|
|
<summary>$fn</summary>
|
|
|
|
\`\`\`
|
|
EOF
|
|
|
|
COLUMNS="$width" man -P cat "$man"
|
|
|
|
cat << EOF
|
|
\`\`\`
|
|
|
|
</details>
|
|
EOF
|