Commit graph

28 commits

Author SHA1 Message Date
Jeff King 60475183c0 docs: always define git-relative-html-prefix attribute
Commit fe77b41 introduced a new attribute to let the linkgit macro
create cross-directory HTML references from the technical/ and howto/
subdirectories back to the main documentation. We define that attribute
to "../" on the command-line when building inside those subdirectories,
and otherwise leave it unset under the assumption that it would default
to being blank.  Instead, asciidoc omits the link entirely, leading to
broken documentation. Fix this by defining git-relative-html-prefix to
blank in asciidoc.conf (and an instance on the command-line, when
present, will override it).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-20 23:35:08 -07:00
Jeff King fe77b416c7 docs: fix cross-directory linkgit references
Most of our documentation is in a single directory, so using
linkgit:git-config[1] just generates a relative link in the
same directory. However, this is not the case with the API
documentation in technical/*, which need to refer to
git-config from the parent directory.

We can fix this by passing a special prefix attribute when building
in a subdirectory, and respecting that prefix in our linkgit
definitions.

We only have to modify the html linkgit definition.  For
manpages, we can ignore this for two reasons:

  1. we do not generate actual links to the file in
     manpages, but instead just give the name and section of
     the linked manpage

  2. we do not currently build manpages for subdirectories,
     only html

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-08 08:31:52 -07:00
Junio C Hamano 7bdaf0bd1c Merge branch 'jc/maint-doc-em-dash'
* jc/maint-doc-em-dash:
  Work around em-dash handling in newer AsciiDoc
2010-09-03 09:43:42 -07:00
Junio C Hamano 2839478774 Work around em-dash handling in newer AsciiDoc
Older versions of AsciiDoc used to literally pass double dashes when we
used them in our linkgit macros and manpage titles, but newer ones (the
issue was first reported with AsciiDoc 8.5.2) turn them into em dashes.

Define litdd (literal double-dash) custom attribute in asciidoc.conf to
work this around.  While we are at it, fix a few double-dashes (e.g. the
description of "project--devo--version" convention used by tla, among
other things) that used to be incorrectly written as em dashes in the body
text to also use this attribute.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-24 09:48:20 -07:00
Jonathan Nieder f1005987e2 Documentation: unbreak regex in show-ref manual
I am not sure why, but the regular expression "(?:\^\{\})" gets
rendered by asciidoc as "(?:\{})".  The intent seems to be a regex
matching the literal string "^{}", so this rewrites the markup to
produce "(?:\^{})" as output.

Cc: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-20 14:16:21 -07:00
Jonathan Nieder 438ded457b Documentation: quoting trouble in "git rm" discussion
The current output (with Asciidoc 8.5.2) seems a bit broken:

	given two directories ‘d` and d2, there is a difference
	between using git rm 'd*’ and ‘git rm 'd/\*\’`, as the
	former will also remove all of directory d2.

In other words, the markup parses as

	given two directories << d` and _d2_, there is a difference
	between using _git rm 'd* >>_ and << git rm 'd/\*\ >> `.

I suspect there is an asciidoc bug involved (why is ' a candidate
closing-quote mark when it is preceded by a backslash?) but with
all the meanings of ` and ' involved I do not want to track it
down.  Better to use unambiguous {asterisk} and {apostrophe}
entities.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-20 14:16:21 -07:00
Miklos Vajna 1c3acfcd57 git-submodule documentation: fix foreach example
Backtick and apostrophe are asciidoc markup, so they should be escaped
in order to get the expected result in the rendered manual page.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-30 11:17:54 -07:00
Chris Johnsen 0c04f52735 Documentation: asciidoc.conf: fix verse block with block titles
No files use the variant of block-title with verse-block, but
such a case would have generated broken docbook XML (<simpara> is
not allowed inside <para>). This fixes the potential deviation from
valid docbook XML.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 00:33:20 -07:00
Chris Johnsen dad3211503 Documentation: asciidoc.conf: always use <literallayout> for [blocktext]
Make the docbook-xsl-no-raw-roff variant match the
no-docbook-xsl-no-raw-roff variant in terms of which XML tag is
used to wrap listing block text (delimited with lines of dashes).

e920b56 (Tweak asciidoc output to work with broken docbook-xsl,
2006-03-05) says docbook-xsl 1.68 needs <literallayout>. This
<screen> usages was in the old, 1.72-only section. But since it
is now the "roff-less" section, it probably makes sense to make it
symmetric with the "roff-ful" section.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 00:33:19 -07:00
Chris Johnsen 8fa2b45f3a Documentation: rename docbook-xsl-172 attribute to git-asciidoc-no-roff
It seems that the ability to use raw roff codes in asciidoc.conf
was eliminated by docbook-xsl 1.72.0 _and later_. Unlike the
1.72.0-specific XSLT problem, this behavior was not reverted in
later releases.

This patch aims to make it clear that the affected asciidoc
attribute (flag) can be reasonably used with docbook-xsl versions
other than 1.72.0.

Also, document which make variables should be set for various
versions of asciidoc and docbook-xsl.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 00:33:19 -07:00
Alexey Borzenkov 9c0c1b1f28 Define linkgit macro in [macros] section
Starting with asciidoc 8.3.0 linkgit macro is no longer recognized by
asciidoc and user guide suggests
(http://www.methods.co.nz/asciidoc/userguide.html#_macro_definitions)
that macros are supposed to be defined in [macros] section. I'm not
sure whether undefined linkgit macro was working by pure chance or it
is a regression in asciidoc 8.3.0, but this patch adds proper
definition for the linkgit macro, allowing it to work on 8.3.0.

Signed-off-by: Alexey Borzenkov <snaury@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-08 17:11:37 -08:00
Jonas Fonseca 9b6f84d2c2 asciidoc: add minor workaround to add an empty line after code blocks
Insert an empty <simpara> in manpages after code blocks to force and
empty line.

The problem can be seen on the manpage for the git tutorial, where an
example command and the following paragraph is printed with no empty
line between them:

     First, note that you can get documentation for a command such as git
     log --graph with:

         $ man git-log
     It is a good idea to introduce yourself to git [...]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 23:41:28 -07:00
Nicolas Pitre c0a5e2d477 pack.indexversion config option now defaults to 2
As announced for 1.6.0.

Git older than version 1.5.2 (or any other git version with this option
set to 1) may revert to version 1 of the pack index by manually deleting
all .idx files and recreating them using 'git index-pack'.  Communication
over the git native protocol is unaffected since the pack index is never
transferred.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-25 21:30:55 -07:00
Dan McGee 5162e69732 Documentation: rename gitlink macro to linkgit
Between AsciiDoc 8.2.2 and 8.2.3, the following change was made to the stock
Asciidoc configuration:

@@ -149,7 +153,10 @@
 # Inline macros.
 # Backslash prefix required for escape processing.
 # (?s) re flag for line spanning.
-(?su)[\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
+
+# Explicit so they can be nested.
+(?su)[\\]?(?P<name>(http|https|ftp|file|mailto|callto|image|link)):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
+
 # Anchor: [[[id]]]. Bibliographic anchor.
 (?su)[\\]?\[\[\[(?P<attrlist>[\w][\w-]*?)\]\]\]=anchor3
 # Anchor: [[id,xreflabel]]

This default regex now matches explicit values, and unfortunately in this
case gitlink was being matched by just 'link', causing the wrong inline
macro template to be applied. By renaming the macro, we can avoid being
matched by the wrong regex.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-06 18:41:44 -08:00
Jonas Fonseca 7f55cf451c Documentation: Fix man page breakage with DocBook XSL v1.72
From version 1.72 it will replace all dots in roff requests with U+2302
("house" character), and add escaping in output for all instances of dot
that are not in roff requests. This caused the ".ft" hack forcing
monospace font in listingblocks to end up as "\&.ft" and being visible
in the resulting man page.

The fix adds a DOCBOOK_XSL_172 build variable that will disable the
hack. To allow this variable to be defined in config.mak it also moves
build variable handling below the inclusion of config.mak.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 02:01:54 -08:00
Junio C Hamano c1c10a3f27 Merge branch 'maint'
* maint:
  Force listingblocks to be monospaced in manpages
  Do not expect unlink(2) to fail on a directory.
2007-07-18 17:00:36 -07:00
Julian Phillips 281a53bb79 Force listingblocks to be monospaced in manpages
For the html output we can use a stylesheet to make sure that the
listingblocks are presented in a monospaced font.  For the manpages do
it manually by inserting a ".ft C" before and ".ft" after the block in
question.

In order for these roff commands to get through to the manpage they
have to be element encoded to prevent quoting.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 16:56:20 -07:00
Junio C Hamano 5bd148bfe8 Merge branch 'maint' to sync with GIT 1.5.2.2 2007-06-16 01:22:10 -07:00
Junio C Hamano 4c7100a9f4 Documentation: adjust to AsciiDoc 8
It turns out that the attribute definition we have had for a
long time to hide "^" character from AsciiDoc 7 was not honored
by AsciiDoc 8 even under "-a asciidoc7compatible" mode.  There is
a similar breakage with the "compatible" mode with + characters.

The double colon at the end of definition list term needs
to be attached to the term, without a whitespace.  After this
minimum fixups, AsciiDoc 8 (I used 8.2.1 on Debian) with
compatibility mode seems to produce reasonably good results.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 01:11:16 -07:00
Junio C Hamano a6080a0a44 War on whitespace
This uses "git-apply --whitespace=strip" to fix whitespace errors that have
crept in to our source files over time.  There are a few files that need
to have trailing whitespaces (most notably, test vectors).  The results
still passes the test, and build result in Documentation/ area is unchanged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-07 00:04:01 -07:00
Jeff King 4159c57813 Documentation: robustify asciidoc GIT_VERSION replacement
Instead of using sed on the resulting file, we now have a
git_version asciidoc attribute. This means that we don't
pipe the output of asciidoc, which means we can detect build
failures.

Problem reported by Scott Lamb, solution suggested by Jonas Fonseca.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-06-02 11:28:13 -07:00
Junio C Hamano d3d4fa8631 Documentation: unbreak user-manual.
The previous one broke generated xml files for anything but manpages,
as it took the header for manpage unconditionally.  This fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-28 16:48:50 -07:00
Frank Lichtenheld 7ef195ba3e Documentation: Add version information to man pages
Override the [header] macro of asciidoc's docbook
backend to add version information to the generated
man pages.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-28 16:48:50 -07:00
Junio C Hamano 54bd25580e escape tilde in Documentation/git-rev-parse.txt
Fixes a failure to build the git-rev-parse manpage, seen with
asciidoc 8.0.0

We would love to use nicer quoting $$~$$ but alas asciidoc 7
does not know about it.  So use asciidoc.conf and define {tilde}
to be &#126;.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-10-03 01:04:19 -07:00
Jonas Fonseca a3e65d74ee Documentation/urls.txt: Use substitution to escape square brackets
This changes "[user@]" to use {startsb} and {endsb} to insert [ and ],
similar to how {caret} is used in git-rev-parse.txt.

[jc: Removed a well-intentioned comment that broke the final
 formatting from the original patch.  While we are at it,
 updated the paragraph that claims to be equivalent to the
 section that was updated earlier without making matching
 changes.]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14 16:36:00 -07:00
Francis Daly e920b56557 Tweak asciidoc output to work with broken docbook-xsl
docbook-xsl v1.68 incorrectly converts "<screen>" from docbook to
manpage by not rendering it verbatim. v1.69 handles it correctly, but
not many current popular distributions ship with it.

asciidoc by default converts "listingblock" to "<screen>". This change
causes asciidoc in git to convert "listingblock" to "<literallayout>", which
both old and new docbook-xsl handle correctly.

The difference can be seen in any manpage which includes a multi-line
example, such as git-branch.

[jc: the original patch was an disaster for html backends, so I made
 it apply only to docbook backends. ]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-05 22:38:12 -08:00
Jonas Fonseca babfaba23d Fix usage of carets in git-rev-parse(1)
... but using a {caret} attribute.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-05 16:56:31 -07:00
Sergey Vlasov d1c2e113c5 [PATCH] Documentation: Add asciidoc.conf file and gitlink: macro
Introduce an asciidoc.conf file with the purpose of adding a gitlink:
macro which will improve the manpage output.

Original cogito patch by Jonas Fonseca <fonseca@diku.dk>;
asciidoc.conf from that patch was further enhanced to use the proper
DocBook tag <citerefentry> for references to man pages.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-20 15:07:51 -07:00