This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: distributing man pages in HTML format


Hi Alexandre et al.,

automake has acknowledged the importance of the HTML format for documentation
through addition of the 'html' target. groff 1.17 can now produce quite good
HTML from manual pages in mandoc format.

Here's a suggestion for rules that would support this. Assuming Makefile.am
contains these lines

  html_HTMLMANS = prog.1.html func.3.html

automake would generate the equivalent of the following in Makefile.in:

==============================================================================
  docdir = @docdir@
  htmldir = $(docdir)

  html_HTMLMANS = prog.1.html func.3.html

  EXTRA_DIST += $(html_HTMLMANS)

  # groff 1.17 or newer.
  MAN2HTML = groff -mandoc -Thtml

  all-am: html-am
  install-data-am: install-html-am
  installdirs-am: installdirs-html-am
  uninstall-am: uninstall-html-am

  html-am: $(html_HTMLMANS)

  # Removing the CreationDate is to avoid unnecessary diffs and failures of
  # "make distcheck".
  prog.1.html: prog.1
	$(MAN2HTML) `if test -f prog.1; then echo .; else echo $(srcdir); fi`/prog.1 | sed -e '/CreationDate:/d' > t-$@
	mv t-$@ $@
  func.3.html: func.3
	$(MAN2HTML) `if test -f func.3; then echo .; else echo $(srcdir); fi`/func.3 | sed -e '/CreationDate:/d' > t-$@
	mv t-$@ $@

install-html-am:
	$(mkinstalldirs) $(DESTDIR)$(htmldir)
	for file in $(html_HTMLMANS); do \
	  if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
	  $(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
	done

installdirs-html-am:
	$(mkinstalldirs) $(DESTDIR)$(htmldir)

uninstall-html-am:
	for file in $(html_HTMLMANS); do \
	  $(RM) $(DESTDIR)$(htmldir)/$$file; \
	done
==============================================================================




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]