<!-- saved from url=(0026)http://www.naturaldocs.org -->
<tablewidth=100%border=0cellspacing=0cellpadding=0><tr><tdcolspan=3class=Header><tablewidth=100%border=0cellspacing=0cellpadding=0><tr><td><imgsrc="images/header/leftside.png"width=30height=75><ahref="index.html"><imgsrc="images/header/logo.png"width=524height=75alt="Natural Docs"></a></td><tdalign=right><imgsrc="images/header/rightside.png"width=30height=75></td></tr></table></td></tr><tr><td><imgsrc="images/header/overleftmargin.png"width=10height=6></td><tdclass=SideMenuTop><imgsrc="images/header/overmenu.png"width=14height=6></td><tdclass=BodyTop><imgsrc="images/header/overbody.png"width=24height=6></td></tr><tr><td></td><tdclass=SideMenunowrap><divclass=SideMenuSection><divclass=SideMenuTitle><imgsrc="images/menu/about.png"width=52height=13alt="About"></div><divclass=SideMenuBody><ahref="languages.html"class=SideMenuEntry>Language Support</a><ahref="output.html"class=SideMenuEntry>Output Formats</a></div></div><divclass=SideMenuSection><divclass=SideMenuTitle><imgsrc="images/menu/using.png"width=45height=13alt="Using"></div><divclass=SideMenuBody><ahref="documenting.html"class=SideMenuEntry>Documenting<br>Your Code</a><ahref="keywords.html"class=SideMenuEntry>Keywords</a><ahref="running.html"class=SideMenuEntry>Running</a><ahref="troubleshooting.html"class=SideMenuEntry>Troubleshooting</a></div></div><divclass=SideMenuSection><divclass=SideMenuTitle><imgsrc="images/menu/customizing.png"width=96height=13alt="Customizing"></div><divclass=SideMenuBody><ahref="menu.html"class=SideMenuEntry>Organizing the Menu</a><ahref="styles.html"class=SideMenuEntry>CSS Styles</a><spanclass=SideMenuEntryid=SelectedSideMenuEntry>Topics and Keywords</span><ahref="customizinglanguages.html"class=SideMenuEntry>Languages, Indexes,<br>and Prototypes</a></div></div><divclass=SideMenuSection><divclass=SideMenuTitle><imgsrc="images/menu/community.png"width=86height=13alt="Community"></div><divclass=SideMenuBody><ahref="http://www.naturaldocs.org/"class=SideMenuEntry>Web Site</a><ahref="http://www.naturaldocs.org/mailinglist.html"class=SideMenuEntry>Mailing Lists</a><ahref="http://www.naturaldocs.org/messageboards.html"class=SideMenuEntry>Message Boards</a><ahref="http://www.naturaldocs.org/bugs.html"class=SideMenuEntry>Bugs and<br>Feature Requests</a></div></div></td><tdclass=Bodywidth=100%><divclass=PageTitle>Customizing Topics</div><divclass=TOC><ahref="#Topicstxt">Topics.txt</a>·<ahref="#TopicTypesVsKeywords">Topic Types vs. Keywords</a>·<ahref="#AddingTopicTypes">Adding Topic Types</a><br><ahref="#ChangingKeywords">Changing Keywords</a>·<ahref="#AlteringBehavior">Altering Behavior</a>·<ahref="#SyntaxReference">Syntax Reference</a></div><divclass=Topic><aname="Topicstxt"></a><divclass=TopicTitle>Topics.txt</div><p>Natural Docs has two files called <code>Topics.txt</code>: one in its Config directory, and one in <ahref="running.html#CommandLine">your project directory.</a> These control the topic behavior and keywords Natural Docs uses.</p><p>You should edit the one in your project directory whenever possible. It keeps your changes separate and easier to manage, plus you don’t have to reapply them whenever you upgrade. Editing the one in Natural Docs’ Config directory would be better only if you’re using Natural Docs with a lot of projects and would like the changes to apply everywhere.</p></div><divclass=Topic><aname="TopicTypesVsKeywords"></a><divclass=TopicTitle>Topic Types vs. Keywords</div><p>It’s important to understand the difference between topic types and keywords. Topic types have their own indexes and behavior settings. You’ll reference them by name when dealing with indexes in the <ahref="menu.html">menu file</a> or prototype detection in the <ahref="customizinglanguages.html">language file</a>, but not when documenting your code unless you make their names keywords as well.</p><p>You use keywords when documenting your code.&n
Plural: Sound Effects
Keywords:
sound
sound effect
</pre><p>Sound effects can now be documented with the <code>sound</code> or <code>sound effect</code> keywords, and they’ll get their own index. The <code>Plural</code> line just specifies the plural name of the topic type. It isn’t required, but Natural Docs will use it in some places where the plural would sound more natural, like when grouping topics or naming indexes on the menu.</p><p>Here are a couple of other things you may want to add:</p><preclass=Example>Topic Type: Sound Effect
Plural: Sound Effects
Scope: Always Global
Keywords:
sound, sounds
sound effect, sound effects
</pre><p>You can set the <ahref="documenting/reference.html#KeywordsTopicsAndScope">scope behavior</a> of the topic type. Your options are:</p><tableborder=0cellspacing=0cellpadding=0class=ScopeTable><tr><tdclass=ScopeOption>Normal</td><td>Topics stay within the current scope.</td></tr><tr><tdclass=ScopeOption>Start</td><td>Topics start a new scope for all the topics beneath it, like class topics.</td></tr><tr><tdclass=ScopeOption>End</td><td>Topics reset the scope back to global for all the topics beneath it.</td></tr><tr><tdclass=ScopeOption>Always Global</td><td>Topics are defined as global, but do not change the scope for any other topics.</td></tr></table><p>Here we set it to <code>Always Global</code> so that if we document one as part of a class, it will still be global yet will not break the class’ scope. In other words, we can always link to it with just its name instead of needing something like <code><Class.Sound></code>.</p><p>The other thing we did was add plural keywords, which you do by using a comma after an existing keyword. These keywords are used for <ahref="documenting/reference.html#ListTopics">list topics</a> so we don’t have to document each one individually with the full syntax.</p><p>There are more options, these are just the most important ones. See the <ahref="#SyntaxReference">full syntax reference</a> for the rest.</p><aname="Prototypes"></a><divclass="SubTopic">Prototypes</div><p>If you’d like to collect prototypes for your new topic type, you have to do that by <ahref="customizinglanguages.html#Prototypes">editing <code>Languages.txt</code></a>.</p></div><divclass=Topic><aname="ChangingKeywords"></a><divclass=TopicTitle>Changing Keywords</div><aname="AddingAndChanging"></a><divclass="SubTopic First">Adding and Changing</div><p>If you’re <ahref="#AddingTopicTypes">defining your own topic type</a> or editing the main topics file, you simply add to the keywords list:</p><preclass=Example>Topic Type: Sound Effect
Keywords:
sound, sounds
sound effect, sound effects
</pre><p>It doesn’t matter if the keyword was previously defined for a different topic type. Just define it again and the definition will change.</p><p>If you want to add keywords to one of the main topic types from the project file, use <code>Alter Topic Type</code> instead:</p><preclass=Example>Alter Topic Type: General
Keywords:
note
notes
</pre><p>Natural Docs will keep a list of the main file’s topic types in your project file so that you can do this easily.</p><aname="Ignoring"></a><divclass="SubTopic">Ignoring</div><p>Sometimes a keyword just gets in the way. It’s too common in your comments and Natural Docs keeps accidentally picking them up as topics when that isn’t what you wanted. You can get rid of keywords completely by either deleting them from the main file or putting this in your project file:</p><preclass=Example>Ignore Keywords:
about
title
</pre><p>If you only have a few, you can use this syntax as well:</p><preclass=Example>Ignore Keywords: note, notes, title
</pre></div><divclass=Topic><aname="AlteringBehavior"></a><divclass=TopicTitle>Altering Behavior</div><p>You can change the behavior of any topic type defined in the main file via your project file. Just use <code>Alter Topic Type</code> and redefine any property.</p><preclass=Example>Alter Topic Type: Constant
Scope: Always Global
</pre><p>Natural Docs will keep a list of the main file’s topic types in your project file so you can do this easily. See the <ahref="#SyntaxReference">syntax reference</a> below for a full list of your options.</p></div><divclass=Topic><aname="SyntaxReference"></a><divclass=TopicTitle>Syntax Reference</div><preclass=Example>Ignore Keywords: <i>[keyword]</i>, <i>[keyword]</i> ...
<i>[keyword]</i>
<i>[keyword]</i>, <i>[keyword]</i>
...
</pre><p>Ignores the keywords so that they’re not recognized as Natural Docs topics anymore. Can be specified as a list on the same line and/or following like a normal Keywords section.</p><preclass=Example>Topic Type: <i>[name]</i>
Alter Topic Type: <i>[name]</i>
</pre><p>Creates a new topic type or alters an existing one. The name can only contain letters, numbers, spaces, and these characters: <code>. - ‘ /</code>. It isn’t case sensitive, although the original case is remembered for presentation.</p><p>There are a number of default types that must be defined in the main file, but they will be listed there since it may change between versions. The default types can have their keywords or behaviors changed, though, either by editing the default file or by overriding them in the user file.</p><aname="Properties"></a><divclass="SubTopic">Properties</div><preclass=Example>Plural: <i>[name]</i>
</pre><p>Specifies the plural name of the topic type. Defaults to the singular name. Has the same restrictions as the topic type name.</p><preclass=Example>Index: <i>[yes|no]</i>
</pre><p>Whether the topic type gets an index. Defaults to yes.</p><preclass=Example>Scope: <i>[normal|start|end|always global]</i>
</pre><p>How the topic affects scope. Defaults to normal.</p><tableborder=0cellspacing=0cellpadding=0class=ScopeTable><tr><tdclass=ScopeOption>Normal</td><td>Topics stay within the current scope.</td></tr><tr><tdclass=ScopeOption>Start</td><td>Topics start a new scope for all the topics beneath it, like class topics.</td></tr><tr><tdclass=ScopeOption>End</td><td>Topics reset the scope back to global for all the topics beneath it.</td></tr><tr><tdclass=ScopeOption>Always Global</td><td>Topics are defined as global, but do not change the scope for any other topics.</td></tr></table><preclass=Example>Class Hierarchy: <i>[yes|no]</i>
</pre><p>Whether the topic is part of the class hierarchy. Defaults to no.</p><preclass=Example>Page Title if First: <i>[yes|no]</i>
</pre><p>Whether the title of this topic becomes the page title if it is the first topic in a file. Defaults to no.</p><preclass=Example>Break Lists: <i>[yes|no]</i>
</pre><p>Whether <ahref="documenting/reference.html#ListTopics">list topics</a> should be broken into individual topics in the output. Defaults to no.</p><preclass=Example>Can Group With: <i>[topic type]</i>, <i>[topic type]</i>, ...
</pre><p>Lists the topic types that can be grouped with this one in the output. If two or more topic types often appear together, like Functions and Properties, this will allow them to be grouped together under one heading if it would cause too many groups otherwise.</p><preclass=Example>Keywords: