-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert man pages to AsciiDoc #20
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
SUBDIRS = . examples | ||
|
||
dist_man_MANS = man/lttng-gen-tp.1 \ | ||
man/lttng-ust.3 \ | ||
man/lttng-ust-dl.3 \ | ||
man/lttng-ust-cyg-profile.3 | ||
SUBDIRS = . man examples | ||
|
||
dist_doc_DATA = java-agent.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Man pages are only built if they are enabled at configure time. | ||
# | ||
# They should always be built before creating a distribution tarball. | ||
|
||
# Function which adds the source directory prefix and adds a given suffix: | ||
manaddsuffix = $(addsuffix $(1),$(addprefix $(srcdir)/,$(2))) | ||
|
||
# List only the names without the .*.txt extension here: | ||
MAN1_NAMES = \ | ||
lttng-gen-tp | ||
MAN3_NAMES = \ | ||
lttng-ust \ | ||
tracef \ | ||
tracelog \ | ||
lttng-ust-dl \ | ||
lttng-ust-cyg-profile | ||
|
||
# troff man pages: | ||
MAN3_TROFF = do_tracepoint.3 tracepoint.3 tracepoint_enabled.3 | ||
|
||
# AsciiDoc sources and outputs: | ||
MAN1_TXT = $(call manaddsuffix,.1.txt,$(MAN1_NAMES)) | ||
MAN3_TXT = $(call manaddsuffix,.3.txt,$(MAN3_NAMES)) | ||
MAN_TXT = $(MAN1_TXT) $(MAN3_TXT) $(MAN8_TXT) | ||
MAN_XML = $(patsubst $(srcdir)/%.txt,%.xml,$(MAN_TXT)) | ||
|
||
# Common AsciiDoc source files: | ||
COMMON_TXT = \ | ||
$(srcdir)/common-footer.txt \ | ||
$(srcdir)/common-authors.txt \ | ||
$(srcdir)/common-copyrights.txt \ | ||
$(srcdir)/log-levels.txt \ | ||
$(srcdir)/tracef-tracelog-limitations.txt | ||
|
||
# AsciiDoc configuration and XSL files: | ||
ASCIIDOC_CONF = $(srcdir)/asciidoc.conf | ||
XSL_FILES = \ | ||
manpage.xsl \ | ||
manpage-callouts.xsl \ | ||
manpage-bold-literal.xsl \ | ||
manpage-links.xsl \ | ||
manpage-headings.xsl | ||
XSL_SRC_FILES = $(addprefix $(srcdir)/xsl/,$(XSL_FILES)) | ||
|
||
# Common dependencies: | ||
COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT) | ||
|
||
# Man pages destinations: | ||
MAN1 = $(addsuffix .1,$(MAN1_NAMES)) | ||
MAN3 = $(addsuffix .3,$(MAN3_NAMES)) | ||
MAN = $(MAN1) $(MAN3) | ||
|
||
if MAN_PAGES_OPT | ||
# At this point, we know the user asked to build the man pages. | ||
if HAVE_ASCIIDOC_XMLTO | ||
# Tools to execute: | ||
ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -d manpage \ | ||
-a lttng_version="$(PACKAGE_VERSION)" | ||
ADOC_DOCBOOK = $(ADOC) -b docbook | ||
XTO = $(XMLTO) -m $(firstword $(XSL_SRC_FILES)) man | ||
|
||
# Recipes: | ||
%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS) | ||
$(ADOC_DOCBOOK) -o $@ $< | ||
|
||
%.1: %.1.xml $(XSL_SRC_FILES) | ||
$(XTO) $< | ||
|
||
%.3.xml: $(srcdir)/%.3.txt $(COMMON_DEPS) | ||
$(ADOC_DOCBOOK) -o $@ $< | ||
|
||
%.3: %.3.xml $(XSL_SRC_FILES) | ||
$(XTO) $< | ||
|
||
# Only clean the generated files if we have the tools to generate them again. | ||
CLEANFILES = $(MAN_XML) $(MAN) | ||
else # HAVE_ASCIIDOC_XMLTO | ||
# Create man page targets used to stop the build if we want to | ||
# build the man pages, but we don't have the necessary tools to do so. | ||
ERR_MSG = "Error: Cannot build target because asciidoc or xmlto tool is missing." | ||
ERR_MSG += "Make sure both tools are installed and run the configure script again." | ||
|
||
%.1: $(srcdir)/%.1.txt $(COMMON_DEPS) | ||
@echo $(ERR_MSG) | ||
@false | ||
|
||
%.3: $(srcdir)/%.3.txt $(COMMON_DEPS) | ||
@echo $(ERR_MSG) | ||
@false | ||
endif # HAVE_ASCIIDOC_XMLTO | ||
endif # MAN_PAGES_OPT | ||
|
||
# Start with empty distributed/installed man pages: | ||
dist_man1_MANS = | ||
dist_man3_MANS = | ||
EXTRA_DIST = | ||
|
||
if MAN_PAGES_OPT | ||
# Building man pages: we can install and distribute them. | ||
dist_man1_MANS += $(MAN1) | ||
dist_man3_MANS += $(MAN3) $(MAN3_TROFF) | ||
else # MAN_PAGES_OPT | ||
# Those are not known by automake yet because dist_man3_MANS is empty | ||
# at this point, so make sure they are distributed. | ||
EXTRA_DIST += $(MAN3_TROFF) | ||
endif # MAN_PAGES_OPT | ||
|
||
if !MAN_PAGES_OPT | ||
dist-hook: | ||
@echo "Error: Please enable the man pages before creating a distribution tarball." | ||
@false | ||
endif # !MAN_PAGES_OPT | ||
|
||
# Always distribute the source files. | ||
EXTRA_DIST += $(MAN_TXT) $(COMMON_TXT) $(XSL_SRC_FILES) $(ASCIIDOC_CONF) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
LTTng-UST man pages | ||
=================== | ||
|
||
This directory contains the sources of the LTTng-UST man pages. | ||
|
||
LTTng-UST man pages are written in | ||
[AsciiDoc](http://www.methods.co.nz/asciidoc/), and then converted to | ||
DocBook (XML) using the `asciidoc` command, and finally to troff using | ||
the appropriate DocBook XSL stylesheet (using the `xmlto` command). | ||
|
||
|
||
Custom XSL stylesheets | ||
---------------------- | ||
|
||
There are a few custom XSL stylesheets applied for customizing the | ||
generated man pages in the `xsl` directory. | ||
|
||
|
||
Macros | ||
------ | ||
|
||
AsciiDoc is configured with `asciidoc.conf` which contains a few | ||
macro definitions used everywhere in the man page sources. | ||
|
||
|
||
### `man` | ||
|
||
The `man` macro is used to specify a reference to another man page. | ||
Using the provided `asciidoc.conf` configuration file, the man page | ||
name is rendered in bold and the section is normal. | ||
|
||
Usage example: `man:lttng-enable-channel(1)`, `man:dlopen(3)` | ||
|
||
|
||
### `option` | ||
|
||
The option macro is used to write a command-line option which is | ||
**defined in the same man page**. | ||
|
||
Usage example: `option:--output`, `option:--verbose` | ||
|
||
|
||
### `nloption` | ||
|
||
Command-line option generating no link. This is used when writing | ||
about an option which is **not defined in the same man page**. | ||
|
||
Usage example: `nloption:-finstrument-functions` | ||
|
||
|
||
### `not` | ||
|
||
The `:not:` macro is used to emphasize on _not_. | ||
|
||
|
||
Includes | ||
-------- | ||
|
||
* `common-authors.txt`: common authors section of the LTTng-UST | ||
project. Only use this for man pages which describe | ||
a command/library/function written by the main authors of LTTng-UST. | ||
* `common-copyright.txt`: common copyrights section of the LTTng-UST | ||
project. Only use this for man pages which describe | ||
a command/library/function having the common LTTng-UST license. | ||
* `common-footer.txt`: common footer for all man pages. This goes | ||
before the copyrights section. | ||
* `log-levels.txt`: definition list of LTTng-UST log levels. | ||
* `tracef-tracelog-limitations.txt`: limitations that apply to both | ||
the `tracef(3)` and `tracelog(3)` man pages. | ||
|
||
|
||
Convention | ||
---------- | ||
|
||
Please follow those rules when updating the current man pages or writing | ||
new ones: | ||
|
||
* Always use macros when possible (man page references, command-line | ||
options, _not_, etc.). | ||
* Use callouts with the `term` role for command-line examples. | ||
* Use a verse, possibly with the `term` role, in the synopsis section. | ||
* Always refer to _long_ options in the text. | ||
* Use the `option:--option='PARAM'` format (with `=`) when providing a | ||
parameter to long options. | ||
* Prefer writing _user space_ rather than _userspace_, _user-space_, | ||
or _user land_. | ||
* Write _file system_, not _filesystem_. | ||
* Prefer writing _use case_ rather than _use-case_ or _usecase_. | ||
* Write _log level_, not _loglevel_. | ||
* Write complete LTTng project names: _LTTng-modules_, _LTTng-UST_, | ||
and _LTTng-tools_, not _modules_, _UST_ and _tools_. | ||
* Prefer simple emphasis to strong emphasis for emphasizing text. | ||
* Try to stay behind the 72th column mark if possible, and behind the | ||
80th column otherwise. | ||
* Do not end directory paths with a forward slash (good: | ||
`include/trace/events`, bad: `include/trace/events/`). | ||
* Minimize the use of the future tense (_will_). | ||
* Use an active voice, and prefer using the second person (_you_) when | ||
referring to the user. | ||
* Avoid using Latin abbreviations (_e.g._, _i.e._, _etc._). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if we do make dist on a ./configure --disable-man-pages ? I would be tempted to make the make dist error out, so we don't create tarballs with missing doc by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed by bb28c92#diff-37bc9f58a44f8928402595bc3f2a166dR109