docs: introduce "curldown" for libcurl man page format

curldown is this new file format for libcurl man pages. It is markdown
inspired with differences:

- Each file has a set of leading headers with meta-data
- Supports a small subset of markdown
- Uses .md file extensions for editors/IDE/GitHub to treat them nicely
- Generates man pages very similar to the previous ones
- Generates man pages that still convert nicely to HTML on the website
- Detects and highlights mentions of curl symbols automatically (when
  their man page section is specified)

tools:

- cd2nroff: converts from curldown to nroff man page
- nroff2cd: convert an (old) nroff man page to curldown
- cdall: convert many nroff pages to curldown versions
- cd2cd: verifies and updates a curldown to latest curldown

This setup generates .3 versions of all the curldown versions at build time.

CI:

Since the documentation is now technically markdown in the eyes of many
things, the CI runs many more tests and checks on this documentation,
including proselint, link checkers and tests that make sure we capitalize the
first letter after a period...

Closes #12730
This commit is contained in:
Daniel Stenberg 2024-01-17 11:32:44 +01:00
parent 02f91d5b64
commit eefcc1bda4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
960 changed files with 41083 additions and 39724 deletions

View file

@ -26,24 +26,21 @@ AUTOMAKE_OPTIONS = foreign no-dependencies
# EXTRA_DIST breaks with $(abs_builddir) so build it using this variable
# but distribute it (using the relative file name) in the next variable
man_MANS = $(abs_builddir)/curl.1
man_MANS = $(abs_builddir)/curl.1 mk-ca-bundle.1
noinst_man_MANS = curl.1 mk-ca-bundle.1
dist_man_MANS = curl-config.1
GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html
PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf
MANDISTPAGES = curl.1.dist curl-config.1.dist
HTMLPAGES = $(GENHTMLPAGES)
CURLPAGES = curl-config.md mk-ca-bundle.md
# Build targets in this file (.) before cmdline-opts to ensure that
# the curl.1 rule below runs first
SUBDIRS = . cmdline-opts
DIST_SUBDIRS = $(SUBDIRS) examples libcurl
SUBDIRS = . cmdline-opts libcurl
DIST_SUBDIRS = $(SUBDIRS) examples
CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES) $(MANDISTPAGES) curl.1
CLEANFILES = $(man_MANS) curl.1 curl-config.1 mk-ca-bundle.1
nodist_MANS = $(CLEANFILES)
EXTRA_DIST = \
$(noinst_man_MANS) \
$(CURLPAGES) \
ALTSVC.md \
BINDINGS.md \
BUFREF.md \
@ -59,6 +56,7 @@ EXTRA_DIST = \
CONNECTION-FILTERS.md \
CONTRIBUTE.md \
CURL-DISABLE.md \
CURLDOWN.md \
DEPRECATE.md \
DYNBUF.md \
EARLY-RELEASE.md \
@ -98,9 +96,14 @@ EXTRA_DIST = \
VULN-DISCLOSURE-POLICY.md \
WEBSOCKET.md
MAN2HTML= roffit $< >$@
CD2NROFF = $(top_srcdir)/scripts/cd2nroff $< >$@
SUFFIXES = .1 .html .pdf
CD2 = $(CD2_$(V))
CD2_0 = @echo " RENDER " $@;
CD2_1 =
CD2_ = $(CD2_0)
SUFFIXES = .1 .md
# $(abs_builddir) is to disable VPATH when searching for this file, which
# would otherwise find the copy in $(srcdir) which breaks the $(HUGE)
@ -116,21 +119,10 @@ $(abs_builddir)/curl.1:
&& touch -r "$(srcdir)/curl.1" $@; fi
cd cmdline-opts && $(MAKE)
html: $(HTMLPAGES)
cd libcurl && $(MAKE) html
.md.1:
$(CD2)$(CD2NROFF)
pdf: $(PDFPAGES)
cd libcurl && $(MAKE) pdf
.1.html:
$(MAN2HTML)
.1.pdf:
@(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
groff -Tps -man $< >$$foo.ps; \
ps2pdf $$foo.ps $@; \
rm $$foo.ps; \
echo "converted $< to $@")
curl-config.1: curl-config.md
distclean:
rm -f $(CLEANFILES)