summaryrefslogtreecommitdiff
path: root/chunked/ch31.html
blob: 845b9ee38f1deaf97c15d1955495ed762bb22034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 31. Intrinsic Attributes</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="home" href="index.html" title="AsciiDoc User Guide" /><link rel="up" href="index.html" title="AsciiDoc User Guide" /><link rel="prev" href="ch30.html" title="Chapter 30. Attribute References" /><link rel="next" href="ch32.html" title="Chapter 32. Block Element Definitions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="ch30.html"><img src="images/icons/prev.png" alt="Prev" /></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch32.html"><img src="images/icons/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="X60"></a>Chapter 31. Intrinsic Attributes</h1></div></div></div><p>Intrinsic attributes are simple attributes that are created
automatically from: AsciiDoc document header parameters; asciidoc(1)
command-line arguments; attributes defined in the default
configuration files; the execution context.  Here’s the list of
predefined intrinsic attributes:</p><pre class="literallayout">{amp}                 ampersand (&amp;) character entity
{asciidoc-args}       used to pass inherited arguments to asciidoc filters
{asciidoc-confdir}    the asciidoc(1) global configuration directory
{asciidoc-dir}        the asciidoc(1) application directory
{asciidoc-file}       the full path name of the asciidoc(1) script
{asciidoc-version}    the version of asciidoc(1)
{author}              author's full name
{authored}            empty string '' if {author} or {email} defined,
{authorinitials}      author initials (from document header)
{backend-&lt;backend&gt;}   empty string ''
{&lt;backend&gt;-&lt;doctype&gt;} empty string ''
{backend}             document backend specified by `-b` option
{backend-confdir}     the directory containing the &lt;backend&gt;.conf file
{backslash}           backslash character
{basebackend-&lt;base&gt;}  empty string ''
{basebackend}         html or docbook
{blockname}           current block name (note 8).
{brvbar}              broken vertical bar (|) character
{docdate}             document last modified date (note 9)
{docdir}              document input directory name  (note 5)
{docfile}             document file name  (note 5)
{docname}             document file name without extension (note 6)
{doctime}             document last modified time (note 9)
{doctitle}            document title (from document header)
{doctype-&lt;doctype&gt;}   empty string ''
{doctype}             document type specified by `-d` option
{email}               author's email address (from document header)
{empty}               empty string ''
{encoding}            specifies input and output encoding
{filetype-&lt;fileext&gt;}  empty string ''
{filetype}            output file name file extension
{firstname}           author first name (from document header)
{gt}                  greater than (&gt;) character entity
{id}                  running block id generated by BlockId elements
{indir}               input file directory name (note 2,5)
{infile}              input file name (note 2,5)
{lastname}            author last name (from document header)
{ldquo}               Left double quote character (note 7)
{level}               title level 1..4 (in section titles)
{listindex}           the list index (1..) of the most recent list item
{localdate}           the current date (note 9)
{localtime}           the current time (note 9)
{lsquo}               Left single quote character (note 7)
{lt}                  less than (&lt;) character entity
{manname}             manpage name (defined in NAME section)
{manpurpose}          manpage (defined in NAME section)
{mantitle}            document title minus the manpage volume number
{manvolnum}           manpage volume number (1..8) (from document header)
{middlename}          author middle name (from document header)
{nbsp}                non-breaking space character entity
{notitle}             do not display the document title
{outdir}              document output directory name (note 2)
{outfile}             output file name (note 2)
{plus}                plus character
{python}              the full path name of the Python interpreter executable
{rdquo}               right double quote character (note 7)
{reftext}             running block xreflabel generated by BlockId elements
{revdate}             document revision date (from document header)
{revnumber}           document revision number (from document header)
{rsquo}               right single quote character (note 7)
{sectnum}             formatted section number (in section titles)
{sp}                  space character
{showcomments}        send comment lines to the output
{title}               section title (in titled elements)
{two-colons}          two colon characters
{two-semicolons}      two semicolon characters
{user-dir}            the ~/.asciidoc directory (if it exists)
{verbose}             defined as '' if --verbose command option specified
{wj}                  word-joiner
{zwsp}                zero-width space character entity</pre><div class="note" style="margin-left: 0; margin-right: 10%;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/icons/note.png" /></td><th align="left"></th></tr><tr><td align="left" valign="top"><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
Intrinsic attributes are global so avoid defining custom attributes
   with the same names.
</li><li class="listitem">
<code class="literal">{outfile}</code>, <code class="literal">{outdir}</code>, <code class="literal">{infile}</code>, <code class="literal">{indir}</code> attributes are
   effectively read-only (you can set them but it won’t affect the
   input or output file paths).
</li><li class="listitem">
See also the <a class="link" href="aph.html" title="Appendix H. Backend Attributes">Backend Attributes</a> section for attributes
    that relate to AsciiDoc XHTML file generation.
</li><li class="listitem">
The entries that translate to blank strings are designed to be used
   for conditional text inclusion. You can also use the <code class="literal">ifdef</code>,
   <code class="literal">ifndef</code> and <code class="literal">endif</code> System macros for conditional inclusion.
   <a href="#ftn.idm4432" class="footnote" id="idm4432"><sup class="footnote">[4]</sup></a>
</li><li class="listitem">
<code class="literal">{docfile}</code> and <code class="literal">{docdir}</code> refer to root document specified on the
   asciidoc(1) command-line; <code class="literal">{infile}</code> and <code class="literal">{indir}</code> refer to the
   current input file which may be the root document or an included
   file. When the input is being read from the standard input
   (<code class="literal">stdin</code>) these attributes are undefined.
</li><li class="listitem">
If the input file is the standard input and the output file is not
   the standard output then <code class="literal">{docname}</code> is the output file name sans
   file extension.
</li><li class="listitem">
See
   <a class="ulink" href="http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks" target="_top">non-English
   usage of quotation marks</a>.
</li><li class="listitem"><p class="simpara">
The <code class="literal">{blockname}</code> attribute identifies the style of the current
   block. It applies to delimited blocks, lists and tables. Here is a
   list of <code class="literal">{blockname}</code> values (does not include filters or custom
   block and style names):
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
delimited blocks
</span></dt><dd>
comment, sidebar, open, pass, literal, verse,
   listing, quote, example, note, tip, important, caution, warning,
   abstract, partintro
</dd><dt><span class="term">
lists
</span></dt><dd>
arabic, loweralpha, upperalpha, lowerroman, upperroman,
   labeled, labeled3, labeled4, qanda, horizontal, bibliography,
   glossary
</dd><dt><span class="term">
tables
</span></dt><dd>
table
</dd></dl></div></li><li class="listitem">
If the <code class="literal">SOURCE_DATE_EPOCH</code> environment variable is set to a UNIX
   timestamp, then the <code class="literal">{docdate}</code>, <code class="literal">{doctime}</code>, <code class="literal">{localdate}</code>, and
   <code class="literal">{localtime}</code> attributes are computed in the UTC time zone, with any
   timestamps newer than <code class="literal">SOURCE_DATE_EPOCH</code> replaced by
   <code class="literal">SOURCE_DATE_EPOCH</code>. (This helps software using AsciiDoc to build
   reproducibly.)
</li></ol></div></td></tr></table></div><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div id="ftn.idm4432" class="footnote"><p><a href="#idm4432" class="simpara"><sup class="simpara">[4] </sup></a>Conditional inclusion using <code class="literal">ifdef</code> and <code class="literal">ifndef</code> macros
   differs from attribute conditional inclusion in that the former
   occurs when the file is read while the latter occurs when the
   contents are written.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch30.html"><img src="images/icons/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch32.html"><img src="images/icons/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/icons/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>