curl/.github/workflows/spellcheck.yml
Daniel Stenberg 2494b8dd51
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
   as the documentation is now markdown-looking.

 - made the parser treat 4-space indents as quotes

 - switch to building the curl.1 manpage using the "mainpage.idx" file,
   which lists the files to include to generate it, instead of using the
   previous page-footer/headers. Also, those files are now also .md
   ones, using the same format. I gave them underscore prefixes to make
   them sort separately:
   _NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
   _VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
   _OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
   _EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md

 - updated test cases accordingly

Closes #12751
2024-01-23 14:30:15 +01:00

73 lines
2.1 KiB
YAML

# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: spell
on:
push:
branches:
- master
paths:
- '**.md'
- '**.3'
- '**.1'
- '**/spellcheck.yml'
- '**/spellcheck.yaml'
- '**/wordlist.txt'
pull_request:
branches:
- master
paths:
- '**.md'
- '**.3'
- '**.1'
- '**/spellcheck.yml'
- '**/spellcheck.yaml'
- '**/wordlist.txt'
permissions: {}
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install pandoc
run: sudo apt-get install pandoc
- name: build curl.1
run: |
autoreconf -fi
./configure --without-ssl --without-libpsl
make -C docs
- name: strip "uncheckable" sections from .3 pages
run: find docs -name "*.3" -size +40c | sed 's/\.3//' | xargs -t -n1 -I OO ./.github/scripts/cleanspell.pl OO.3 OO.33
- name: convert .3 man pages to markdown
run: find docs -name "*.33" -size +40c | sed 's/\.33//' | xargs -t -n1 -I OO pandoc -f man -t markdown OO.33 -o OO.md
- name: convert .1 man pages to markdown
run: find docs -name "*.1" -size +40c | sed 's/\.1//' | xargs -t -n1 -I OO pandoc OO.1 -o OO.md
- name: trim the curl.1 markdown file
run: |
perl -pi -e 's/^ .*//' docs/curl.md
perl -pi -e 's/\-\-[\a-z0-9-]*//ig' docs/curl.md
perl -pi -e 's!https://[a-z0-9%/.-]*!!ig' docs/curl.md
- name: trim the cmdline docs markdown files
run: find docs/cmdline-opts -name "*.md" ! -name "_*" ! -name MANPAGE.md | xargs -n1 ./.github/scripts/cleancmd.pl
- name: trim the cmdline docs markdown _*.md files
run: find docs/cmdline-opts -name "_*.md" | xargs -n1 ./.github/scripts/cleancmd.pl --no-header
- name: setup the custom wordlist
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@v0
with:
config_path: .github/scripts/spellcheck.yaml