| <!DOCTYPE html> |
| <html> |
| <!-- Created by Texinfo 6.8dev+dev, http://www.gnu.org/software/texinfo/ --> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <!-- This manual is for GNU Texinfo (version 6.8dev, 23 February 2022), |
| a documentation system that can produce both online information and a |
| printed manual from a single source using semantic markup. |
| |
| Copyright (C) 1988, 1990-1993, 1995-1999, 2001-2022 Free Software Foundation, Inc. |
| |
| Permission is granted to copy, distribute and/or modify this document |
| under the terms of the GNU Free Documentation License, Version 1.3 or |
| any later version published by the Free Software Foundation; with no |
| Invariant Sections, with no Front-Cover Texts, and with no Back-Cover |
| Texts. A copy of the license is included in the section entitled |
| "GNU Free Documentation License". --> |
| <title>HTML Xref Link Basics (GNU Texinfo 6.8dev)</title> |
| |
| <meta name="description" content="HTML Xref Link Basics (GNU Texinfo 6.8dev)"> |
| <meta name="keywords" content="HTML Xref Link Basics (GNU Texinfo 6.8dev)"> |
| <meta name="resource-type" content="document"> |
| <meta name="distribution" content="global"> |
| <meta name="Generator" content="texi2any"> |
| <meta name="viewport" content="width=device-width,initial-scale=1"> |
| |
| <link href="index.html" rel="start" title="Top"> |
| <link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index"> |
| <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| <link href="HTML-Xref.html" rel="up" title="HTML Xref"> |
| <link href="HTML-Xref-Node-Name-Expansion.html" rel="next" title="HTML Xref Node Name Expansion"> |
| <style type="text/css"> |
| <!-- |
| div.example {margin-left: 3.2em} |
| ul.mark-bullet {list-style-type: disc} |
| --> |
| </style> |
| |
| |
| </head> |
| |
| <body lang="en"> |
| <div class="subsection-level-extent" id="HTML-Xref-Link-Basics"> |
| <div class="nav-panel"> |
| <p> |
| Next: <a href="HTML-Xref-Node-Name-Expansion.html" accesskey="n" rel="next">HTML Cross-reference Node Name Expansion</a>, Up: <a href="HTML-Xref.html" accesskey="u" rel="up">HTML Cross-references</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| </div> |
| <hr> |
| <h4 class="subsection" id="HTML-Cross_002dreference-Link-Basics">21.4.1 HTML Cross-reference Link Basics</h4> |
| <a class="index-entry-id" id="index-HTML-cross_002dreferences-1"></a> |
| |
| <p>For our purposes, an HTML link consists of four components: a host |
| name, a directory part, a file part, and a target part. We |
| always assume the <code class="code">http</code> protocol. For example: |
| </p> |
| <div class="example"> |
| <pre class="example-preformatted">http://<var class="var">host</var>/<var class="var">dir</var>/<var class="var">file</var>.html#<var class="var">target</var> |
| </pre></div> |
| |
| <p>The information to construct a link comes from the node name and |
| manual name in the cross-reference command in the Texinfo source |
| (see <a class="pxref" href="Cross-References.html">Cross-references</a>), and from <em class="dfn">external information</em> |
| (see <a class="pxref" href="HTML-Xref-Configuration.html">HTML Cross-reference Configuration: <samp class="file">htmlxref.cnf</samp></a>). |
| </p> |
| <p>We now consider each part in turn. |
| </p> |
| <p>The <var class="var">host</var> is hardwired to be the local host. This could either |
| be the literal string ‘<samp class="samp">localhost</samp>’, or, according to the rules for |
| HTML links, the ‘<samp class="samp">http://localhost/</samp>’ could be omitted entirely. |
| </p> |
| <p>The <var class="var">dir</var> and <var class="var">file</var> parts are more complicated, and depend on |
| the relative split/mono nature of both the manual being processed and |
| the manual that the cross-reference refers to. The underlying idea is |
| that there is one directory for Texinfo manuals in HTML, and a given |
| <var class="var">manual</var> is either available as a monolithic file |
| <samp class="file"><var class="var">manual</var>.html</samp>, or a split subdirectory |
| <samp class="file"><var class="var">manual</var>_html/*.html</samp>. Here are the cases: |
| </p> |
| <ul class="itemize mark-bullet"> |
| <li>If the present manual is split, and the referent manual is also split, |
| the directory is ‘<samp class="samp">../<var class="var">referent</var>_html/</samp>’ and the file is the |
| expanded node name (described later). |
| |
| </li><li>If the present manual is split, and the referent manual is mono, the |
| directory is ‘<samp class="samp">../</samp>’ and the file is <samp class="file"><var class="var">referent</var>.html</samp>. |
| |
| </li><li>If the present manual is mono, and the referent manual is split, the |
| directory is <samp class="file"><var class="var">referent</var>_html/</samp> and the file is the expanded node |
| name. |
| |
| </li><li>If the present manual is mono, and the referent manual is also mono, |
| the directory is <samp class="file">./</samp> (or just the empty string), and the file is |
| <samp class="file"><var class="var">referent</var>.html</samp>. |
| |
| </li></ul> |
| |
| <a class="index-entry-id" id="index-BASEFILENAME_005fLENGTH-1"></a> |
| <p>Another rule, that only holds for file names, is that base file names |
| are truncated to 245 characters, to allow for an extension to be |
| appended and still comply with the 255-character limit which is common |
| to many filesystems. Although technically this can be changed with |
| the <code class="code">BASEFILENAME_LENGTH</code> customization variable (see <a class="pxref" href="Other-Customization-Variables.html">Other Customization Variables</a>), doing so would make cross-manual references |
| to such nodes invalid. |
| </p> |
| <p>Any directory part in the file name argument of the source cross |
| reference command is ignored. Thus, <code class="code">@xref{,,,../foo}</code> and |
| <code class="code">@xref{,,,foo}</code> both use ‘<samp class="samp">foo</samp>’ as the manual name. This |
| is because any such attempted hardwiring of the directory is very |
| unlikely to be useful for both Info and HTML output. |
| </p> |
| <p>Finally, the <var class="var">target</var> part is always the expanded node name. |
| </p> |
| <p>Whether the present manual is split or mono is determined by user |
| option; <code class="command">makeinfo</code> defaults to split, with the |
| <samp class="option">--no-split</samp> option overriding this. |
| </p> |
| <p>Whether the referent manual is split or mono, however, is another bit |
| of the external information (see <a class="pxref" href="HTML-Xref-Configuration.html">HTML Cross-reference Configuration: <samp class="file">htmlxref.cnf</samp></a>). By |
| default, <code class="command">makeinfo</code> uses the same form of the referent manual |
| as the present manual. |
| </p> |
| <p>Thus, there can be a mismatch between the format of the referent |
| manual that the generating software assumes, and the format it’s |
| actually present in. See <a class="xref" href="HTML-Xref-Mismatch.html">HTML Cross-reference Mismatch</a>. |
| </p> |
| |
| </div> |
| <hr> |
| <div class="nav-panel"> |
| <p> |
| Next: <a href="HTML-Xref-Node-Name-Expansion.html">HTML Cross-reference Node Name Expansion</a>, Up: <a href="HTML-Xref.html">HTML Cross-references</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| </div> |
| |
| |
| |
| </body> |
| </html> |