diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fe120fde..72fde7ad 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,10 +26,11 @@ jobs: - name: Install dependencies run: ./ci/installdeps.sh - - name: Build API docs + - name: Build API docs and manpages run: | - ./autogen.sh --enable-gtk-doc + ./autogen.sh --enable-gtk-doc --enable-man --enable-man-html make -C apidoc + make manhtml - name: Build and publish jekyll docs uses: helaili/jekyll-action@v2 diff --git a/Makefile-man.am b/Makefile-man.am index 78025fff..5c7f2413 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -19,6 +19,8 @@ if ENABLE_MAN +# If you add a new man page here, add a reference to it in index.xml and +# ostree.xml. man1_files = ostree.1 ostree-admin-cleanup.1 \ ostree-admin-config-diff.1 ostree-admin-deploy.1 \ ostree-admin-init-fs.1 ostree-admin-instutil.1 ostree-admin-os-init.1 \ @@ -52,9 +54,25 @@ man5_files = ostree.repo.5 ostree.repo-config.5 man1_MANS = $(addprefix man/,$(man1_files)) man5_MANS = $(addprefix man/,$(man5_files)) -EXTRA_DIST += $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml) +manhtml_files = \ + man/html/index.html \ + $(addprefix man/html/,$(man1_files:.1=.html)) \ + $(addprefix man/html/,$(man5_files:.5=.html)) \ + $(NULL) -XSLT_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl +if ENABLE_MAN_HTML +noinst_DATA += $(manhtml_files) + +# Convenience target for building the just the HTML man pages +manhtml: $(manhtml_files) +.PHONY: manhtml +endif + +EXTRA_DIST += man/index.xml $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml) + +XSLT_MAN_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl +XSLT_HTML_STYLESHEET = man/html.xsl +EXTRA_DIST += $(XSLT_HTML_STYLESHEET) XSLTPROC_FLAGS = \ --nonet \ @@ -67,14 +85,19 @@ XSLTPROC_FLAGS = \ XSLTPROC_MAN = $(XSLTPROC) $(XSLTPROC_FLAGS) %.1: %.xml - $(AM_V_GEN) $(XSLTPROC_MAN) --output $@ $(XSLT_STYLESHEET) $< + $(AM_V_GEN) $(XSLTPROC_MAN) --output $@ $(XSLT_MAN_STYLESHEET) $< %.5: %.xml - $(AM_V_GEN) $(XSLTPROC_MAN) --output $@ $(XSLT_STYLESHEET) $< + $(AM_V_GEN) $(XSLTPROC_MAN) --output $@ $(XSLT_MAN_STYLESHEET) $< + +man/html/%.html: man/%.xml + @mkdir -p man/html + $(AM_V_GEN) $(XSLTPROC_MAN) --output $@ $(XSLT_HTML_STYLESHEET) $< CLEANFILES += \ $(man1_MANS) \ $(man5_MANS) \ + $(manhtml_files) \ $(NULL) endif diff --git a/configure.ac b/configure.ac index 8ca2f451..693261ca 100644 --- a/configure.ac +++ b/configure.ac @@ -292,6 +292,16 @@ AS_IF([test "$enable_man" != no], [ ]) AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no) +AC_ARG_ENABLE([man-html], + [AS_HELP_STRING([--enable-man-html], + [generate man HTML pages [default=no]])],, + enable_man_html=no) + +AS_IF([test "$enable_man_html" = yes && test "$enable_man" = no], [ + AC_MSG_ERROR([--enable-man is required for --enable-man-html]) +]) +AM_CONDITIONAL(ENABLE_MAN_HTML, test "$enable_man_html" = yes) + AC_ARG_WITH(libarchive, AS_HELP_STRING([--without-libarchive], [Do not use libarchive]), :, with_libarchive=maybe) diff --git a/docs/_config.yml b/docs/_config.yml index ed1c2a63..991d2adc 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -20,9 +20,9 @@ exclude: - prep-docs.sh - vendor/ -# This is a copy of the apidoc/html directory. Run prep-docs.sh before -# jekyll to put it in place. -include: [reference] +# These are copies of the apidoc/html and man/html directories. Run +# prep-docs.sh before jekyll to put it in place. +include: [reference, man] remote_theme: coreos/just-the-docs plugins: diff --git a/docs/index.md b/docs/index.md index db729be3..b1c4da3b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -146,6 +146,10 @@ make install DESTDIR=/path/to/dest The libostree API documentation is available in [Reference](reference/). +## Manual Pages + +The ostree manual pages are available in [Manual](man/). + ## Contributing See [Contributing]({{ site.baseurl }}{% link CONTRIBUTING.md %}). diff --git a/docs/prep-docs.sh b/docs/prep-docs.sh index 2ae15a74..5975d5cc 100755 --- a/docs/prep-docs.sh +++ b/docs/prep-docs.sh @@ -21,3 +21,17 @@ fi echo "Copying $apidocs to $refdir" rm -rf "$refdir" cp -r "$apidocs" "$refdir" + +# Make sure the manpages have been generated and copy them to the man +# directory. +manhtml="$topdir/man/html" +mandir="$docsdir/man" +if [ ! -d "$manhtml" ]; then + echo "error: HTML manpages $manhtml have not been generated" >&2 + echo "Rebuild with --enable-man option and run `make manhtml`" >&2 + exit 1 +fi + +echo "Copying $manhtml to $mandir" +rm -rf "$mandir" +cp -r "$manhtml" "$mandir" diff --git a/man/html.xsl b/man/html.xsl new file mode 100644 index 00000000..17a425d4 --- /dev/null +++ b/man/html.xsl @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + .html + + + + + + diff --git a/man/index.xml b/man/index.xml new file mode 100644 index 00000000..e20ae871 --- /dev/null +++ b/man/index.xml @@ -0,0 +1,202 @@ + + + + + + + OSTree Manual + + + ostree1 + + + + ostree-admin-cleanup1 + + + + ostree-admin-config-diff1 + + + + ostree-admin-deploy1 + + + + ostree-admin-init-fs1 + + + + ostree-admin-instutil1 + + + + ostree-admin-os-init1 + + + + ostree-admin-pin1 + + + + ostree-admin-set-origin1 + + + + ostree-admin-status1 + + + + ostree-admin-switch1 + + + + ostree-admin-undeploy1 + + + + ostree-admin-unlock1 + + + + ostree-admin-upgrade1 + + + + ostree-admin1 + + + + ostree-cat1 + + + + ostree-checkout1 + + + + ostree-checksum1 + + + + ostree-commit1 + + + + ostree-config1 + + + + ostree-create-usb1 + + + + ostree-diff1 + + + + ostree-export1 + + + + ostree-find-remotes1 + + + + ostree-fsck1 + + + + ostree-gpg-sign1 + + + + ostree-init1 + + + + ostree-log1 + + + + ostree-ls1 + + + + ostree-prune1 + + + + ostree-pull-local1 + + + + ostree-pull1 + + + + ostree-refs1 + + + + ostree-remote1 + + + + ostree.repo-config5 + + + + ostree.repo5 + + + + ostree-reset1 + + + + ostree-rev-parse1 + + + + ostree-show1 + + + + ostree-sign1 + + + + ostree-static-delta1 + + + + ostree-summary1 + + + + ostree-trivial-httpd1 + + + + rofiles-fuse1 + + diff --git a/man/ostree.xml b/man/ostree.xml index c06c6121..39f78845 100644 --- a/man/ostree.xml +++ b/man/ostree.xml @@ -151,7 +151,7 @@ License along with this library. If not, see . ostree-admin-cleanup1 -  Delete untagged + Delete untagged deployments and repository objects. @@ -160,7 +160,7 @@ License along with this library. If not, see . ostree-admin-config-diff1 -  See changes to + See changes to /etc as compared to the current default (from /usr/etc). @@ -171,7 +171,7 @@ License along with this library. If not, see . ostree-admin-deploy1 -  Takes a particular + Takes a particular commit or revision, and sets it up for the next boot. @@ -181,7 +181,7 @@ License along with this library. If not, see . ostree-admin-init-fs1 -  Initialize a root filesystem + Initialize a root filesystem in a specified path. @@ -190,7 +190,7 @@ License along with this library. If not, see . ostree-admin-instutil1 -  Utility functions intended primarily for operating system installation programs + Utility functions intended primarily for operating system installation programs @@ -198,7 +198,7 @@ License along with this library. If not, see . ostree-admin-os-init1 -  Initialize the + Initialize the deployment location for an operating system with a specified name. @@ -208,7 +208,7 @@ License along with this library. If not, see . ostree-admin-status1 -  Show and list the deployments. + Show and list the deployments. @@ -216,7 +216,7 @@ License along with this library. If not, see . ostree-admin-switch1 -  Choose a different ref + Choose a different ref to track from the same remote as the current tree. @@ -226,7 +226,7 @@ License along with this library. If not, see . ostree-admin-undeploy1 -  Remove the previously + Remove the previously INDEX deployed tree from the bootloader configuration. @@ -237,7 +237,7 @@ License along with this library. If not, see . ostree-admin-upgrade1 -  Download the latest version for the + Download the latest version for the current ref, and deploy it. @@ -253,7 +253,7 @@ License along with this library. If not, see . ostree-cat1 -  Concatenate contents of files + Concatenate contents of files @@ -261,7 +261,7 @@ License along with this library. If not, see . ostree-checkout1 -  Check out a commit into a filesystem tree. + Check out a commit into a filesystem tree. @@ -269,7 +269,7 @@ License along with this library. If not, see . ostree-checksum1 -  Gives checksum of any file. + Gives checksum of any file. @@ -277,7 +277,7 @@ License along with this library. If not, see . ostree-commit1 -  Given one or more + Given one or more trees, create a new commit using those contents. @@ -286,7 +286,7 @@ License along with this library. If not, see . ostree-config1 -  Change settings. + Change settings. @@ -294,7 +294,7 @@ License along with this library. If not, see . ostree-create-usb1 -  Put the given refs on an external drive for P2P distribution. + Put the given refs on an external drive for P2P distribution. @@ -302,7 +302,7 @@ License along with this library. If not, see . ostree-diff1 -  Concisely list + Concisely list differences between the given refs. @@ -311,7 +311,7 @@ License along with this library. If not, see . ostree-find-remotes1 -  Find remotes to serve the given refs. + Find remotes to serve the given refs. @@ -319,7 +319,7 @@ License along with this library. If not, see . ostree-fsck1 -  Check a repository for consistency. + Check a repository for consistency. @@ -327,7 +327,7 @@ License along with this library. If not, see . ostree-init1 -  Initialize a new repository. + Initialize a new repository. @@ -335,7 +335,7 @@ License along with this library. If not, see . ostree-log1 -  Show revision log. + Show revision log. @@ -343,7 +343,7 @@ License along with this library. If not, see . ostree-ls1 -  List the contents of a given commit. + List the contents of a given commit. @@ -351,7 +351,7 @@ License along with this library. If not, see . ostree-prune1 -  Search for unreachable objects. + Search for unreachable objects. @@ -359,7 +359,7 @@ License along with this library. If not, see . ostree-pull-local1 -  Copy data from source-repo. + Copy data from source-repo. @@ -367,7 +367,7 @@ License along with this library. If not, see . ostree-pull1 -  Download data from remote repo. If you have libsoup. + Download data from remote repo. If you have libsoup. @@ -375,7 +375,7 @@ License along with this library. If not, see . ostree-refs1 -  List refs. + List refs. @@ -383,7 +383,7 @@ License along with this library. If not, see . ostree-remote1 -  Manipulate remote archive configuration. + Manipulate remote archive configuration. @@ -391,7 +391,7 @@ License along with this library. If not, see . ostree-reset1 -  Reset a ref to a previous commit. + Reset a ref to a previous commit. @@ -399,7 +399,7 @@ License along with this library. If not, see . ostree-rev-parse1 -  Show the SHA256 corresponding to a given rev. + Show the SHA256 corresponding to a given rev. @@ -407,7 +407,7 @@ License along with this library. If not, see . ostree-show1 -  Given an OSTree SHA256 checksum, display its contents. + Given an OSTree SHA256 checksum, display its contents. @@ -415,7 +415,7 @@ License along with this library. If not, see . ostree-static-delta1 -  Manage static delta files. + Manage static delta files. @@ -423,7 +423,7 @@ License along with this library. If not, see . ostree-summary1 -  Regenerate the repository summary metadata. + Regenerate the repository summary metadata. @@ -431,7 +431,7 @@ License along with this library. If not, see . ostree-trivial-httpd1 -  Simple webserver. + Simple webserver.