Skip to content

Commit

Permalink
Add configure option to generate html man pages.
Browse files Browse the repository at this point in the history
  ./configure --enable-htmldoc will now use asciidoctor to build
  and then install .html versions of the manual pages (with a
  table of contents) in $FVWM_DATADIR/htmldoc.
  • Loading branch information
somiaj authored and ThomasAdam committed Oct 29, 2023
1 parent 058b6ab commit 5b6ca6b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
36 changes: 33 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ AC_ARG_ENABLE(package-subdirs,

FVWM_MODULEDIR='${libexecdir}'"$FVWM_MODULESUBDIR"
FVWM_DATADIR='${datadir}'"$FVWM_DATASUBDIR"
FVWM_DOCDIR='${datadir}'"$FVWM_DOCSUBDIR"
FVWM_DOCDIR='${datadir}'"$FVWM_DATASUBDIR/htmldoc"
FVWM_PERLLIBDIR='${datadir}'"$FVWM_DATASUBDIR/perllib"
FVWM_CONFDIR='${sysconfdir}'dnl used _only_ to search for system.fvwm2rc

Expand Down Expand Up @@ -321,6 +321,35 @@ if test ! x"$with_mandoc" = xno; then
fi
AM_CONDITIONAL([FVWM_BUILD_MANDOC], [test x"$with_mandoc" = xyes])

AC_ARG_ENABLE(htmldoc,
AS_HELP_STRING([--enable-htmldoc],
[enable generation of html man pages]),
[ if test x"$enableval" = xyes; then
with_htmldoc="yes, check"
else
with_htmldoc="no"
problem_htmldoc=": Explicitly disabled"
fi ],
[ with_htmldoc="no" ]
)

if test ! x"$with_htmldoc" = xno; then
if test x"$ASCIIDOC" = x ; then
with_htmldoc="no"
problem_htmldoc=": No asciidoctor found in PATH"
elif test x"$SED" = x ; then
with_htmldoc="no"
problem_htmldoc=": No sed found in PATH"
elif test x"$HAVE_PERL_FOR_DOCS" = x0 ; then
with_htmldoc="no"
problem_htmldoc=": No perl found in PATH"
else
with_htmldoc="yes"
fi
fi
AM_CONDITIONAL([FVWM_BUILD_HTMLDOC], [test x"$with_htmldoc" = xyes])
AM_CONDITIONAL([FVWM_BUILD_DOC], [test x"$with_mandoc" = xyes || test x"$with_htmldoc" = xyes])

# ********* session management
# Check the availability of SM; we don't have to add any extra libraries,
# since -lSM -lICE are in X_PRE_LIBS when they exist.
Expand Down Expand Up @@ -1461,7 +1490,7 @@ Fvwm3 Configuration:
Man pages: $my_mandir
Modules: $my_moddir
Data files: $my_datdir
Doc files: $my_docdir
HTML docs: $my_docdir
Perl lib: $my_plldir
Locale msg: $my_localedir $INST_LINGUAS

Expand All @@ -1479,5 +1508,6 @@ Fvwm3 Configuration:
With Xrender image support? $with_xrender$problem_xrender
With Golang support? $with_golang$problem_golang
Build man pages? $with_mandoc$problem_mandoc
Build html man pages? $with_htmldoc$problem_htmldoc

"
"
18 changes: 15 additions & 3 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,30 @@ EXTRA_DIST = $(MODULE_ADOC_SRCS)
nothing:

clean:
rm -f *.1 *.ad
rm -f *.1 *.ad *.html

distclean-local: clean

if FVWM_BUILD_MANDOC
if FVWM_BUILD_DOC
M1M = $(filter-out fvwm3_manpage_source.adoc, $(MODULE_ADOC))
if FVWM_BUILD_MANDOC
man1_MANS = $(patsubst %.adoc,%.1, $(M1M))
endif
if FVWM_BUILD_HTMLDOC
html_MANS = $(patsubst %.adoc,%.html, $(M1M))
doc_DATA = $(patsubst %.adoc,%.html, $(M1M))
endif

EXTRACT_SECTIONS = \
commands \
menus \
styles
SECTION_FILES = $(patsubst %,fvwm3_%.ad, $(EXTRACT_SECTIONS))

all: docs
docs: $(man1_MANS)
docs: $(man1_MANS) $(html_MANS)
$(man1_MANS): $(SECTION_FILES)
$(html_MANS): $(SECTION_FILES)

%.ad: fvwm3_manpage_source.adoc
SECTION=$(patsubst fvwm3_%.ad,%,$@); \
Expand All @@ -48,4 +56,8 @@ $(man1_MANS): $(SECTION_FILES)

%.1: %.adoc
"$(ASCIIDOC)" -b manpage -a "$(patsubst %.1,%,$@)" "$<" -o "$@"

%.html: %.adoc
"$(ASCIIDOC)" -b html5 -a toc -a "$(patsubst %.html,%,$@)" "$<" -o "$@"

endif

0 comments on commit 5b6ca6b

Please sign in to comment.