<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/2030/1/7/_/styles/combined.css?spaceKey=AST&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/AST/Confluence+Tips">Confluence Tips</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~russell">Russell Bryant</a>
</h4>
<br/>
<h4>Changes (1)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >h2. Code Examples <br> <br></td></tr>
<tr><td class="diff-changed-lines" >The {{\{code\}}} macro supports a bunch of different programming languages. See the [notation guide|https://wiki.asterisk.org/wiki/renderer/notationhelp.action] for details. Tell the macro which programming language you're using ({{\{code:xml|title=example.xml\}}}) and it will do syntax highlighting for you. <span class="diff-added-words"style="background-color: #dfd;"> For a list of programming languages supported by this macro, see this page on the [newcode macro|https://studio.plugins.atlassian.com/wiki/display/NCODE/Confluence+New+Code+Macro].</span> <br></td></tr>
<tr><td class="diff-unchanged" > <br>{code:xml|title=example.xml} <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<div>
<ul>
<li><a href='#ConfluenceTips-PageSetupTips'>1. Page Setup Tips</a></li>
<ul>
<li><a href='#ConfluenceTips-NumberedHeadings'>1.1. Numbered Headings</a></li>
<li><a href='#ConfluenceTips-TableofContents'>1.2. Table of Contents</a></li>
</ul>
<li><a href='#ConfluenceTips-FormattingTips'>2. Formatting Tips</a></li>
<ul>
<li><a href='#ConfluenceTips-ConfigurationExamples'>2.1. Configuration Examples</a></li>
<li><a href='#ConfluenceTips-CodeExamples'>2.2. Code Examples</a></li>
</ul>
</ul></div>
<h1><a name="ConfluenceTips-PageSetupTips"></a>1. Page Setup Tips</h1>
<h2><a name="ConfluenceTips-NumberedHeadings"></a>1.1. Numbered Headings</h2>
<p>To have the section headings automatically numbered, wrap the entire page in the {<tt>numberedheadings</tt>} macro.</p>
<p>For more information, see the home page for the <a href="https://studio.plugins.atlassian.com/wiki/display/NUMHEAD/Numbered+Headings" class="external-link" rel="nofollow">Numbered Headings</a> plugin.</p>
<p>The numbered headings plugins expects that the headings are used in order (h1, h2, h3, etc.). If you skip levels, it will not number the headings.</p>
<h2><a name="ConfluenceTips-TableofContents"></a>1.2. Table of Contents</h2>
<p>Adding a table of contents to your page is easy. To do so, add the {<tt>toc</tt>} macro where you would like the table of contents to be inserted. This is useful in combination with numbered headings. Both are used on this page.</p>
<h1><a name="ConfluenceTips-FormattingTips"></a>2. Formatting Tips</h1>
<h2><a name="ConfluenceTips-ConfigurationExamples"></a>2.1. Configuration Examples</h2>
<p>The {<tt>code</tt>} macro does a nice job with formatting a block for an Asterisk configuration example. Be sure to add a title, too by doing {<tt>code:title=asterisk.conf</tt>}. For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>asterisk.conf</b></div><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: java; gutter: false"><![CDATA[
[section]
var=value
foo=bar
]]></script>
</div></div>
<h2><a name="ConfluenceTips-CodeExamples"></a>2.2. Code Examples</h2>
<p>The {<tt>code</tt>} macro supports a bunch of different programming languages. See the <a href="https://wiki.asterisk.org/wiki/renderer/notationhelp.action" class="external-link" rel="nofollow">notation guide</a> for details. Tell the macro which programming language you're using ({<tt>code:xml|title=example.xml</tt>}) and it will do syntax highlighting for you. For a list of programming languages supported by this macro, see this page on the <a href="https://studio.plugins.atlassian.com/wiki/display/NCODE/Confluence+New+Code+Macro" class="external-link" rel="nofollow">newcode macro</a>.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>example.xml</b></div><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: xml; gutter: false"><![CDATA[
<?xml version="1.0"?>
<menu name="Asterisk Module and Build Option Selection">
<category name="MENUSELECT_ADDONS" displayname="Add-ons (See README-addons.txt)" remove_on_change="addons/modules.link">
<member name="app_mysql" displayname="Simple Mysql Interface" remove_on_change="addons/app_mysql.o addons/app_mysql.so">
<depend>mysqlclient</depend>
<defaultenabled>no</defaultenabled>
</member>
</category>
</menu>
]]></script>
</div></div>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>example.java</b></div><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: java; gutter: false"><![CDATA[
class Example {
public static void main(String args[])
{
System.out.println("Hello World");
}
}
]]></script>
</div></div>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>example.cpp</b></div><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: cpp; gutter: false"><![CDATA[
class Example {
public:
Example();
~Example();
void setFoo(int f);
int getFoo(void) const;
private:
int foo;
};
]]></script>
</div></div>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;">
<a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/Confluence+Tips">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=9076863&revisedVersion=5&originalVersion=4">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Confluence+Tips?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>