1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project.
|
---|
3 | See the accompanying license.txt file for applicable licenses.-->
|
---|
4 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
|
---|
5 | "reference.dtd">
|
---|
6 | <reference id="extended-functionality">
|
---|
7 | <title>Extended functionality</title>
|
---|
8 | <reference id="code-reference">
|
---|
9 | <title>Code reference processing</title>
|
---|
10 | <refbody>
|
---|
11 | <section>
|
---|
12 | <title>Charset definition</title>
|
---|
13 | <p>DITA-OT supports defining the code reference target file encoding using the
|
---|
14 | <codeph>format</codeph> attribute. The supported format is:</p>
|
---|
15 | <codeblock>format (";" space* "charset=" charset)?</codeblock>
|
---|
16 | <p>If charset is not defined system default charset will be used. If charset is not
|
---|
17 | recognized or supported, <keyword>DOTJ052E</keyword> error is thrown and system default
|
---|
18 | charset is used as a fall-back.</p>
|
---|
19 | </section>
|
---|
20 | <example>
|
---|
21 | <codeblock><coderef href="unicode.txt" format="txt; charset=UTF-8"/></codeblock>
|
---|
22 | </example>
|
---|
23 | <section>
|
---|
24 | <title>Line range extraction</title>
|
---|
25 | <p>Code reference can extract only a given line ranges with <codeph>line-range</codeph>
|
---|
26 | pointer in the URI fragment. The format is:</p>
|
---|
27 | <codeblock>uri ("#line-range(" start ("," end)? ")" )?</codeblock>
|
---|
28 | <p>Start and end line numbers start from 1 and are inclusive. If end range
|
---|
29 | is omitted, range ends in last line of the file.</p>
|
---|
30 | </section>
|
---|
31 | <example>
|
---|
32 | <codeblock><coderef href="Parser.scala#line-range(5, 10)" format="scala"/></codeblock>
|
---|
33 | <p>Only lines from 5 to 10 will be included in the output.</p>
|
---|
34 | </example>
|
---|
35 | </refbody>
|
---|
36 | </reference>
|
---|
37 | </reference>
|
---|