CINXE.COM

TracLinks – The Trac Project

<!DOCTYPE html> <html lang="en-US"> <head> <!-- # block head (placeholder in theme.html) --> <!-- # block head (content inherited from layout.html) --> <title> TracLinks – The Trac Project </title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!--[if IE]><script> if (/^#__msie303:/.test(window.location.hash)) window.location.replace(window.location.hash.replace(/^#__msie303:/, '#')); </script><![endif]--> <link rel="search" href="/search" /> <link rel="help" href="/wiki/TracGuide" /> <link rel="alternate" href="/wiki/TracLinks?format=txt" title="Plain Text" type="text/x-trac-wiki" /> <link rel="start" href="/wiki" /> <link rel="stylesheet" href="/chrome/common/css/trac.css" type="text/css" /> <link rel="stylesheet" href="/chrome/common/css/wiki.css" type="text/css" /> <link rel="stylesheet" href="/chrome/wikiextras/css/phrases.css" type="text/css" /> <link rel="stylesheet" href="/chrome/wikiextras/css/boxes.css" type="text/css" /> <link rel="stylesheet" href="/wikiextras/dynamicboxes.css" type="text/css" /> <link rel="stylesheet" href="/chrome/vote/css/tracvote.css" type="text/css" /> <link rel="icon" href="/favicon.ico" type="image/x-icon" /> <noscript> <style> .trac-noscript { display: none !important } </style> </noscript> <link type="application/opensearchdescription+xml" rel="search" href="/search/opensearch" title="Search The Trac Project"/> <script src="/chrome/common/js/jquery.js"></script> <script src="/chrome/common/js/babel.js"></script> <script src="/chrome/common/js/trac.js"></script> <script src="/chrome/common/js/search.js"></script> <script src="/chrome/common/js/folding.js"></script> <script src="/chrome/common/js/wiki.js"></script> <script> jQuery(function($) { $(".trac-autofocus").focus(); $(".trac-target-new").attr("target", "_blank"); if ($.ui) { /* is jquery-ui added? */ $(".trac-datepicker:not([readonly])") .prop("autocomplete", "off").datepicker(); // Input current date when today is pressed. var _goToToday = $.datepicker._gotoToday; $.datepicker._gotoToday = function(id) { _goToToday.call(this, id); this._selectDate(id) }; $(".trac-datetimepicker:not([readonly])") .prop("autocomplete", "off").datetimepicker(); $("#main").addClass("trac-nodatetimehint"); } $(".trac-disable").disableSubmit(".trac-disable-determinant"); setTimeout(function() { $(".trac-scroll").scrollToTop() }, 1); $(".trac-disable-on-submit").disableOnSubmit(); }); </script> <!-- # include 'site_head.html' (layout.html) --> <link rel="stylesheet" type="text/css" href="//www.edgewall.org/css/projects013.css" /> <script type="text/javascript"><!-- window.cookieconsent_options = {"message":"This website uses cookies to ensure you get the best experience on our website","dismiss":"Got it!","learnMore":"More info","link":null,"theme":"dark-bottom", "domain": "edgewall.org"}; //--></script> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.9/cookieconsent.min.js"></script> <script type="text/javascript"> jQuery(function($) { var $ntg = $("#newticketguide"); if ($ntg.length) $("#propertyform").prepend($ntg.detach()); }); </script> <!-- end of site_head.html --> <!-- # endblock head (content inherited from layout.html) --> <link rel="alternate" type="application/x-wiki" href="/wiki/TracLinks?action=edit&amp;version=" title="Edit this page"/> <script> jQuery(function($) { wikiColumn($("#wikipage")); }); </script> <!-- # endblock head (placeholder in theme.html) --> </head> <body> <!-- # block body (content inherited from theme.html) --> <!-- # include 'site_header.html' (theme.html) --> <!-- site_header_trac.html --> <div id="wrapper"> <div id="topbar"> <a id="home-link" href="//www.edgewall.org/">Edgewall Software</a> </div> <div id="ew-header"> <div id="topnav"><ul> <li><a href="//www.edgewall.org/">Home</a></li> <li class="active"> <a class="trac" href="//trac.edgewall.org/">Trac</a> </li> <li> <a href="//trac-hacks.org/">Trac Hacks</a> </li> <li class=""> <a class="genshi" href="//genshi.edgewall.org/">Genshi</a> </li> <li class=""> <a class="babel" href="//babel.edgewall.org/">Babel</a> </li> <li class=""> <a class="bitten" href="//bitten.edgewall.org/">Bitten</a> </li></ul> </div> </div> <div id="ew-main"> <div id="ew-content"> <div> <script src="//www.google-analytics.com/urchin.js" type="text/javascript"></script> <script type="text/javascript">_uacct = "UA-598265-1";urchinTracker();</script> <div id="left"> <div class="block"> <ul> <li><a href="/">Home</a></li> <li><a href="/wiki/TracDownload">Download</a></li> <li><a href="/wiki/TracGuide">Documentation</a></li> <li><a href="/wiki/MailingList">Mailing Lists</a></li> <li><a href="/wiki/TracLicense">License</a></li> <li><a href="/wiki/TracFaq">FAQ</a></li> </ul> </div> </div> </div><!-- /site_header_trac.html --> <!-- end of site_header.html --> <div id="banner"> <div id="header"> <a id="logo" href="//trac.edgewall.org/"> <img alt="Trac" height="73" src="//www.edgewall.org/gfx/trac_logo.png" width="236" /></a> </div> <form id="search" action="/search" method="get"> <div> <label for="proj-search">Search:</label> <input type="text" id="proj-search" name="q" size="18" value="" /> <input type="submit" value="Search" /> </div> </form> <div id="metanav" class="nav"> <ul><li class="first"><a href="/login">Login</a></li><li ><a href="/prefs">Preferences</a></li><li ><a href="/wiki/TracGuide">Help/Guide</a></li><li class="last"><a href="/about">About Trac</a></li></ul> </div> </div> <div id="mainnav" class="nav"> <ul><li class="active first"><a href="/wiki">Wiki</a></li><li ><a href="/timeline">Timeline</a></li><li ><a href="/roadmap">Roadmap</a></li><li ><a href="/browser">Browse Source</a></li><li ><a href="/report">View Tickets</a></li><li ><a href="/wiki/NewTicket">New Ticket</a></li><li class="last"><a href="/search">Search</a></li></ul> </div> <div id="main" > <div id="pagepath" class="noprint"> <a class="pathentry first" title="View WikiStart" href="/wiki">wiki:</a><a href="/wiki/TracLinks" title="View TracLinks" class="pathentry">TracLinks</a></div> <div id="ctxtnav" class="nav"> <h2>Context Navigation</h2> <ul> <li class="first"><span id="vote" title="Vote count (-1)"><img alt="Up-vote" src="/chrome/vote/aupgray.png" /><span id="votes">-1</span><img alt="Down-vote" src="/chrome/vote/adownmod.png" /></span></li> <li ><a href="/wiki/WikiStart">Start Page</a></li> <li ><a href="/wiki/TitleIndex">Index</a></li> <li class="last"><a href="/wiki/TracLinks?action=history">History</a></li> </ul> <hr /> </div> <!-- # block content (placeholder in theme.html) --> <div id="content" class="wiki narrow"> <div class="wikipage searchable"> <div id="wikipage" class="trac-content borderless"><div class="wikiextras box shadow icon information yellow"><p> This page documents the 1.4 (latest stable) release. Documentation for other releases can be found <a class="wiki" href="/wiki/TitleIndex#TracGuide:BackupandTranslations">here</a>. </p> </div><h1 class="section" id="TracLinks">Trac Links</h1> <p> </p><div class="wiki-toc"><h4>Table of Contents</h4><ul><li class="False"><a class="False" href="/wiki/TracGuide">Index</a></li><li class="False"><a class="False" href="/wiki/TracInstall">Installation</a></li><li class="False"><a class="False" href="/wiki/TracInterfaceCustomization">Customization</a></li><li class="False"><a class="False" href="/wiki/TracPlugins">Plugins</a></li><li class="False"><a class="False" href="/wiki/TracUpgrade">Upgrading</a></li><li class="False"><a class="False" href="/wiki/TracIni">Configuration</a></li><li class="False"><a class="False" href="/wiki/TracAdmin">Administration</a></li><li class="False"><a class="False" href="/wiki/TracBackup">Backup</a></li><li class="False"><a class="False" href="/wiki/TracLogging">Logging</a></li><li class="False"><a class="False" href="/wiki/TracPermissions">Permissions</a></li><li class="False"><a class="False" href="/wiki/TracWiki">The Wiki</a></li><li class="False"><a class="False" href="/wiki/WikiFormatting">Wiki Formatting</a></li><li class="False"><a class="False" href="/wiki/TracTimeline">Timeline</a></li><li class="False"><a class="False" href="/wiki/TracBrowser">Repository Browser</a></li><li class="False"><a class="False" href="/wiki/TracRevisionLog">Revision Log</a></li><li class="False"><a class="False" href="/wiki/TracChangeset">Changesets</a></li><li class="False"><a class="False" href="/wiki/TracTickets">Tickets</a></li><li class="False"><a class="False" href="/wiki/TracWorkflow">Workflow</a></li><li class="False"><a class="False" href="/wiki/TracRoadmap">Roadmap</a></li><li class="False"><a class="False" href="/wiki/TracQuery">Ticket Queries</a></li><li class="False"><a class="False" href="/wiki/TracBatchModify">Batch Modify</a></li><li class="False"><a class="False" href="/wiki/TracReports">Reports</a></li><li class="False"><a class="False" href="/wiki/TracRss">RSS Support</a></li><li class="False"><a class="False" href="/wiki/TracNotification">Notification</a></li></ul></div><p> </p><div class="wiki-toc"><h4 class="section">Contents</h4> <ol> <li> <a href="#WheretouseTracLinks">Where to use TracLinks</a> </li> <li> <a href="#Overview">Overview</a> </li> <li> <a href="#AdvanceduseofTracLinks">Advanced use of TracLinks</a> <ol> <li> <a href="#Relativelinks">Relative links</a> </li> <li> <a href="#Linkanchors">Link anchors</a> </li> <li> <a href="#InterWikilinks">InterWiki links</a> </li> <li> <a href="#InterTraclinks">InterTrac links</a> </li> <li> <a href="#Server-relativelinks">Server-relative links</a> </li> <li> <a href="#QuotingspaceinTracLinks">Quoting space in TracLinks</a> </li> <li> <a href="#EscapingLinks">Escaping Links</a> </li> <li> <a href="#ParameterizedTraclinks">Parameterized Trac links</a> </li> </ol> </li> <li> <a href="#TracLinksReference">TracLinks Reference</a> <ol> <li> <a href="#attachment:links">attachment: links</a> </li> <li> <a href="#comment:links">comment: links</a> </li> <li> <a href="#htdocs:links">htdocs: links</a> </li> <li> <a href="#query:links">query: links</a> </li> <li> <a href="#search:links">search: links</a> </li> <li> <a href="#ticket:links">ticket: links</a> </li> <li> <a href="#timeline:links">timeline: links</a> </li> <li> <a href="#wiki:links">wiki: links</a> </li> <li> <a href="#VersionControlsystemlinks">Version Control system links</a> <ol> <li> <a href="#source:links">source: links</a> </li> <li> <a href="#export:links">export: links</a> </li> <li> <a href="#log:links">log: links</a> </li> <li> <a href="#Multi-repositorylinks">Multi-repository links</a> </li> </ol> </li> </ol> </li> </ol> </div><p> </p> <div class="wiki-toc trac-nav" style="clear:both"> <h4>Languages:</h4> <ul><li><strong>English</strong> </li><li><a class="wiki" href="/wiki/TranslationRu/TracLinks">Русский</a> </li></ul> </div><p> </p> <p> <a class="wiki" href="/wiki/TracLinks">TracLinks</a> are a fundamental feature of Trac, allowing easy hyperlinking between the various entities in the system — such as tickets, reports, changesets, Wiki pages, milestones, and source files — from anywhere <a class="wiki" href="/wiki/WikiFormatting">WikiFormatting</a> is used. </p> <p> <a class="wiki" href="/wiki/TracLinks">TracLinks</a> are generally of the form <strong>type:id</strong> (where <em>id</em> represents the number, name or path of the item) though some frequently used kinds of items also have short-hand notations. </p> <h2 class="section" id="WheretouseTracLinks">Where to use <a class="wiki" href="/wiki/TracLinks">TracLinks</a></h2> <p> You can use <a class="wiki" href="/wiki/TracLinks">TracLinks</a> in: </p> <ul><li>Source code (Subversion) commit messages </li><li>Wiki pages </li><li>Full descriptions for tickets, reports and milestones </li></ul><p> and any other text fields explicitly marked as supporting <a class="wiki" href="/wiki/WikiFormatting">WikiFormatting</a>. </p> <h2 class="section" id="Overview">Overview</h2> <table class="wiki"> <tr><th> Wiki Markup </th><th> Display </th></tr><tr><td><dl class="wiki"><dt>Wiki pages</dt><dd><code>CamelCase</code> or <code>wiki:CamelCase</code> </dd><dt>Parent page</dt><dd><code>[..]</code> </dd><dt>Tickets</dt><dd><code>#1</code> or <code>ticket:1</code> </dd><dt>Ticket comments</dt><dd><code>comment:1:ticket:2</code> </dd><dt>Reports</dt><dd><code>{1}</code> or <code>report:1</code> </dd><dt>Milestones</dt><dd><code>milestone:1.0</code> </dd><dt>Attachment</dt><dd><code>attachment:example.tgz</code> (for current page attachment), <code>attachment:attachment.1073.diff:ticket:944</code> (absolute path) </dd><dt>Changesets</dt><dd><code>r1</code>, <code>[1]</code>, <code>changeset:1</code> or (restricted) <code>[1/trunk]</code>, <code>changeset:1/trunk</code>, <code>[1/repository]</code> </dd><dt>Revision log</dt><dd><code>r1:3</code>, <code>[1:3]</code> or <code>log:@1:3</code>, <code>log:trunk@1:3</code>, <code>[2:5/trunk]</code> </dd><dt>Diffs</dt><dd><code>diff:@1:3</code>, <code>diff:plugins/0.12/mercurial-plugin@9128:9953</code>, <code>diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default</code> or <code>diff:trunk/trac@3538//sandbox/vc-refactoring@3539</code> </dd><dt>Files</dt><dd><code>source:trunk/COPYING</code>, <code>source:/trunk/COPYING@200</code> (at version 200), <code>source:/trunk/COPYING@200#L25</code> (at version 200, line 25), <code>source:/trunk/COPYING@200:27-30#L25</code> (at version 200, line 25, highlighting lines 27-30) </dd></dl> </td><td><dl class="wiki"><dt>Wiki pages</dt><dd><a class="wiki" href="/wiki/CamelCase">CamelCase</a> or <a class="wiki" href="/wiki/CamelCase">wiki:CamelCase</a> </dd><dt>Parent page</dt><dd><a href="/wiki">..</a> </dd><dt>Tickets</dt><dd><a class="new ticket" href="/ticket/1" title="#1: enhancement: Add a new project summary module. (new)">#1</a> or <a class="new ticket" href="/ticket/1" title="#1: enhancement: Add a new project summary module. (new)">ticket:1</a> </dd><dt>Ticket comments</dt><dd><a class="missing ticket" title="ticket comment does not exist">comment:1:ticket:2</a> </dd><dt>Reports</dt><dd><a class="report" href="/report/1">{1}</a> or <a class="report" href="/report/1">report:1</a> </dd><dt>Milestones</dt><dd><a class="closed milestone" href="/milestone/1.0" title="Completed 13 years ago (Sep 7, 2012, 11:55:50 PM)">milestone:1.0</a> </dd><dt>Attachment</dt><dd><a class="missing attachment">attachment:example.tgz</a> (for current page attachment), <a class="attachment" href="/attachment/ticket/944/attachment.1073.diff" title="Attachment 'attachment.1073.diff' in Ticket #944">attachment:attachment.1073.diff:ticket:944</a><a class="trac-rawlink" href="/raw-attachment/ticket/944/attachment.1073.diff" title="Download">​</a> (absolute path) </dd><dt>Changesets</dt><dd><a class="changeset" href="/changeset/1" title="Initial import">r1</a>, <a class="changeset" href="/changeset/1" title="Initial import">[1]</a>, <a class="changeset" href="/changeset/1" title="Initial import">changeset:1</a> or (restricted) <a class="changeset" href="/changeset/1/trunk" title="Initial import">[1/trunk]</a>, <a class="changeset" href="/changeset/1/trunk" title="Initial import">changeset:1/trunk</a>, <a class="changeset" href="/changeset/1/repository" title="Initial import">[1/repository]</a> </dd><dt>Revision log</dt><dd><a class="source" href="/log/?revs=1-3">r1:3</a>, <a class="source" href="/log/?revs=1-3">[1:3]</a> or <a class="source" href="/log/?revs=1-3">log:@1:3</a>, <a class="source" href="/log/trunk?revs=1-3">log:trunk@1:3</a>, <a class="source" href="/log/trunk?revs=2-5">[2:5/trunk]</a> </dd><dt>Diffs</dt><dd><a class="changeset" href="/changeset?new=3&amp;old=1" title="Diff [1:3] for /">diff:@1:3</a>, <a class="changeset" href="/changeset?new=9953&amp;new_path=plugins%2F0.12%2Fmercurial-plugin&amp;old=9128&amp;old_path=plugins%2F0.12%2Fmercurial-plugin" title="Diff [9128:9953] for plugins/0.12/mercurial-plugin">diff:plugins/0.12/mercurial-plugin@9128:9953</a>, <a class="changeset" href="/changeset?new_path=tags%2Ftrac-0.9.3%2Fwiki-default&amp;old_path=tags%2Ftrac-0.9.2%2Fwiki-default" title="Diff from tags/trac-0.9.2/wiki-default@latest to tags/trac-0.9.3/wiki-default@latest">diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default</a> or <a class="changeset" href="/changeset?new=3539&amp;new_path=sandbox%2Fvc-refactoring&amp;old=3538&amp;old_path=trunk%2Ftrac" title="Diff from trunk/trac@3538 to sandbox/vc-refactoring@3539">diff:trunk/trac@3538//sandbox/vc-refactoring@3539</a> </dd><dt>Files</dt><dd><a class="source" href="/browser/trunk/COPYING">source:trunk/COPYING</a><a class="trac-rawlink" href="/export/HEAD/trunk/COPYING" title="Download">​</a>, <a class="source" href="/browser/trunk/COPYING?rev=200">source:/trunk/COPYING@200</a><a class="trac-rawlink" href="/export/200/trunk/COPYING" title="Download">​</a> (at version 200), <a class="source" href="/browser/trunk/COPYING?rev=200#L25">source:/trunk/COPYING@200#L25</a><a class="trac-rawlink" href="/export/200/trunk/COPYING#L25" title="Download">​</a> (at version 200, line 25) <a class="source" href="/browser/trunk/COPYING?rev=200&amp;marks=28-31#L25">source:/trunk/COPYING@200:28-31#L25</a><a class="trac-rawlink" href="/export/200/trunk/COPYING#L25" title="Download">​</a> (at version 200, line 25, highlighting lines 28-31) </dd></dl> </td></tr></table> <p> <strong>Note:</strong> The <a class="wiki" href="/wiki/CamelCase">wiki:CamelCase</a> form is rarely used, but it can be convenient to refer to pages whose names do not follow <a class="wiki" href="/wiki/WikiPageNames">WikiPageNames</a> rules, ie single words, non-alphabetic characters, etc. See <a class="wiki" href="/wiki/WikiPageNames">WikiPageNames</a> for more about features specific to links to Wiki page names. </p> <table><tr><td colspan="2"> Trac links using the full (non-shorthand) notation can also be given a custom link title like this: </td></tr><tr><td><pre class="wiki">[ticket:1 This is a link to ticket number one] or [[ticket:1|This is another link to ticket number one]]. </pre></td><td><p> <a class="new ticket" href="/ticket/1" title="#1: enhancement: Add a new project summary module. (new)">This is a link to ticket number one</a> or <a class="new ticket" href="/ticket/1" title="#1: enhancement: Add a new project summary module. (new)">This is another link to ticket number one</a>. </p> </td></tr><tr> <td colspan="2"> If the title is omitted, only the id (the part after the colon) is displayed: </td></tr><tr><td><pre class="wiki">[ticket:1] or [[ticket:2]] </pre></td><td><p> <a class="new ticket" href="/ticket/1" title="#1: enhancement: Add a new project summary module. (new)">1</a> or <a class="closed ticket" href="/ticket/2" title="#2: defect: No wiki component in bug tracker (closed: fixed)">2</a> </p> </td></tr><tr> <td colspan="2"> <code>wiki</code> is the default if the namespace part of a full link is omitted: </td></tr><tr><td><pre class="wiki">[SandBox the sandbox] or [[SandBox|the sandbox]] </pre></td><td><p> <a class="wiki" href="/wiki/SandBox">the sandbox</a> or <a class="wiki" href="/wiki/SandBox">the sandbox</a> </p> </td></tr><tr> <td colspan="2"> The short form <em>realm:target</em> can also be wrapped within a &lt;&hellip;&gt; pair, <br /> which allow for arbitrary characters (i.e. anything but &gt;) </td></tr><tr><td><pre class="wiki">&lt;wiki:Strange(page@!)&gt; </pre></td><td><p> &lt;<a class="missing wiki" href="/wiki/Strange(page?version=!)" rel="nofollow">wiki:Strange(page@!)</a>&gt; </p> </td></tr><tr> <td colspan="2"> Quoting can be used with the full notation to allow brackets in the label. </td></tr><tr><td><pre class="wiki">[TracIni#logging-log_type-option "[logging] log_type"] </pre></td><td><p> <a class="wiki" href="/wiki/TracIni#logging-log_type-option">[logging] log_type</a> </p> </td></tr></table><p> <a class="wiki" href="/wiki/TracLinks">TracLinks</a> are a very simple idea, but actually allow quite a complex network of information. In practice, it's very intuitive and simple to use, and we've found the "link trail" extremely helpful to better understand what's happening in a project or why a particular change was made. </p> <h2 class="section" id="AdvanceduseofTracLinks">Advanced use of <a class="wiki" href="/wiki/TracLinks">TracLinks</a></h2> <h3 class="section" id="Relativelinks">Relative links</h3> <p> To create a link to a <a href="https://trac.edgewall.org/intertrac/SubWiki" title="SubWiki in The Trac Project">SubWiki</a>-page just use a '/': </p> <pre class="wiki"> WikiPage/SubWikiPage or ./SubWikiPage </pre><p> To link from a <a href="https://trac.edgewall.org/intertrac/SubWiki" title="SubWiki in The Trac Project">SubWiki</a> page to a parent, simply use a '..': </p> <pre class="wiki"> [..] or [[..]] </pre><blockquote> <p> <a href="/wiki">..</a> or <a href="/wiki">..</a> </p> </blockquote> <p> To link from a <a href="https://trac.edgewall.org/intertrac/SubWiki" title="SubWiki in The Trac Project">SubWiki</a> page to a <span class="wikianchor" id="sibling">sibling</span> page, use a '../': </p> <pre class="wiki"> [../Sibling see next sibling] or [[../Sibling|see next sibling]] </pre><blockquote> <p> <a class="missing wiki" href="/wiki/Sibling" rel="nofollow">see next sibling</a> or <a class="missing wiki" href="/wiki/Sibling" rel="nofollow">see next sibling</a> </p> </blockquote> <p> But in practice you often won't need to add the <code>../</code> prefix to link to a sibling page. For resolving the location of a wiki link, it's the target page closest in the hierarchy to the page where the link is written which will be selected. So for example, within a sub-hierarchy, a sibling page will be targeted in preference to a top-level page. This makes it easy to copy or move pages to a sub-hierarchy by <a class="wiki" href="/wiki/WikiNewPage#renaming">renaming</a> without having to adapt the links. </p> <p> To link explicitly to a <span class="wikianchor" id="toplevel">toplevel</span> Wiki page, use the <code>wiki:/</code> prefix. Be careful <strong>not</strong> to use the <code>/</code> prefix alone, as this corresponds to the <a class="wiki" href="/wiki/TracLinks#Server-relativelinks">#Server-relativelinks</a> syntax and with such a link you will lack the <code>/wiki/</code> part in the resulting URL. A link such as <code>[../newticket]</code> will stay in the wiki namespace and therefore link to a sibling page. </p> <h3 class="section" id="Linkanchors">Link anchors</h3> <p> To create a link to a specific anchor in a page, use <code>#</code>: </p> <pre class="wiki"> [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]] </pre><blockquote> <p> <a class="wiki" href="/wiki/TracLinks#Linkanchors">Link anchors</a> or <a class="wiki" href="/wiki/TracLinks#Linkanchors">Link anchors</a> </p> </blockquote> <p> To create an anchor in a page, use <code>[=#...]</code>: </p> <pre class="wiki"> [=#myanchor my anchor] or empty form [=#myanchor] </pre><blockquote> <p> <span class="wikianchor" id="myanchor">my anchor</span> or empty form <span class="wikianchor" id="myanchor"></span> </p> </blockquote> <p> Hint: when you hover your mouse over the title of a section, a '¶' character will be displayed. This is a link to that specific section and you can use this to copy the <code>#...</code> part inside a relative link to an anchor. </p> <p> To create a link to the first or last occurrence of a term on a page, use a <em>pseudo anchor</em> starting with <code>#/</code> or <code>#?</code>: </p> <pre class="wiki"> [#/Milestone first occurrence of Milestone] or [#?Milestone last occurrence of Milestone] </pre><blockquote> <p> <a class="wiki" href="/wiki/TracLinks#/Milestone">first occurrence of Milestone</a> or <a class="wiki" href="/wiki/TracLinks#?Milestone">last occurrence of Milestone</a> </p> </blockquote> <p> This will also highlight all other matches on the linked page. By default only case sensitive matches are considered. To include case insensitive matches append <code>/i</code>: </p> <pre class="wiki"> [#/Milestone/i first occurrence of Milestone or milestone] or [#?Milestone/i last occurrence of Milestone or milestone] </pre><blockquote> <p> <a class="wiki" href="/wiki/TracLinks#/Milestone/i">first occurrence of Milestone or milestone</a> or <a class="wiki" href="/wiki/TracLinks#?Milestone/i">last occurrence of Milestone or milestone</a> </p> </blockquote> <p> <em>(since Trac 1.0)</em> </p> <p> Such anchors can be very useful for linking to specific lines in a file in the source browser: </p> <pre class="wiki"> [trac:source:tags/trac-0.12/trac/wiki/api.py#L127 Line 127] or [trac:source:tags/trac-0.12/trac/ticket/roadmap.py#L47 Line 47] </pre><blockquote> <p> <a href="https://trac.edgewall.org/intertrac/source%3Atags/trac-0.12/trac/wiki/api.py%23L127" title="source:tags/trac-0.12/trac/wiki/api.py#L127 in The Trac Project">Line 127</a> or <a href="https://trac.edgewall.org/intertrac/source%3Atags/trac-0.12/trac/ticket/roadmap.py%23L47" title="source:tags/trac-0.12/trac/ticket/roadmap.py#L47 in The Trac Project">Line 47</a> </p> </blockquote> <p> (Hint: The line numbers displayed in the source browser are links to anchors on the respective lines.) </p> <p> Since such links become outdated when the file changes, it can be useful to link using a <code>#/</code> pseudo anchor instead: </p> <pre class="wiki"> [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or [trac:source:trunk/trac/env.py#/ISystemInfoProvider ISystemInfoProvider] </pre><blockquote> <p> <a href="https://trac.edgewall.org/intertrac/source%3Atrunk/trac/wiki/api.py%23/IWikiSyntaxProvider" title="source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider in The Trac Project">IWikiSyntaxProvider</a> or <a href="https://trac.edgewall.org/intertrac/source%3Atrunk/trac/env.py%23/ISystemInfoProvider" title="source:trunk/trac/env.py#/ISystemInfoProvider in The Trac Project">ISystemInfoProvider</a> </p> </blockquote> <h3 class="section" id="InterWikilinks"><a class="wiki" href="/wiki/InterWiki">InterWiki</a> links</h3> <p> Other prefixes can be defined freely and made to point to resources in other Web applications. The definition of those prefixes as well as the URLs of the corresponding Web applications is defined in a special Wiki page, the <a class="wiki" href="/wiki/InterMapTxt">InterMapTxt</a> page. Note that while this could be used to create links to other Trac environments, there is a more specialized way to register other Trac environments which offers greater flexibility. </p> <h3 class="section" id="InterTraclinks"><a class="wiki" href="/wiki/InterTrac">InterTrac</a> links</h3> <p> This can be seen as a kind of <a class="wiki" href="/wiki/InterWiki">InterWiki</a> link specialized for targeting other Trac projects. </p> <p> Any type of Trac link can be written in one Trac environment and actually refer to resources in another Trac environment. All that is required is to prefix the Trac link with the name of the other Trac environment followed by a colon. The other Trac environment must be registered on the <a class="wiki" href="/wiki/InterTrac">InterTrac</a> page. </p> <p> A distinct advantage of <a class="wiki" href="/wiki/InterTrac">InterTrac</a> links over <a class="wiki" href="/wiki/InterWiki">InterWiki</a> links is that the shorthand form of Trac links can also be used, such as <code>{}</code>, <code>r</code>, <code>#</code>. For example, if T was set as an alias for Trac, then links to Trac tickets can be written as <a href="https://trac.edgewall.org/intertrac/ticket%3A234" title="ticket:234 in The Trac Project">#T234</a>, and links to Trac changesets can be written as <a href="https://trac.edgewall.org/intertrac/changeset%3A1508" title="changeset:1508 in The Trac Project">[trac 1508]</a>. See <a class="wiki" href="/wiki/InterTrac">InterTrac</a> for the complete details. </p> <h3 class="section" id="Server-relativelinks">Server-relative links</h3> <p> It is often useful to be able to link to objects in your project that have no built-in Trac linking mechanism, such as static resources, <code>newticket</code>, a shared <code>/register</code> page on the server, etc. </p> <p> To link to resources inside the project, use either an absolute path from the project root, or a relative link from the URL of the current page (<em>Changed in 0.11</em>): </p> <pre class="wiki">[/newticket Create a new ticket] or [[//newticket|Create a new ticket]] [/ home] or [[/|home]] </pre><p> Display: <a href="/newticket">Create a new ticket</a> or <a href="/newticket">Create a new ticket</a> <a href="/">home</a> or <a href="/">home</a> </p> <p> To link to another location on the server (possibly outside the project but on the same host), use the <code>//</code> prefix (<em>Changed in 0.11</em>): </p> <pre class="wiki">[//register Register Here] or [[//register|Register Here]] </pre><p> Display: <a href="/register">Register Here</a> or <a href="/register">Register Here</a> </p> <h3 class="section" id="QuotingspaceinTracLinks">Quoting space in <a class="wiki" href="/wiki/TracLinks">TracLinks</a></h3> <p> Immediately after a <a class="wiki" href="/wiki/TracLinks">TracLinks</a> prefix, targets containing space characters should be enclosed in a pair of quotes or double quotes. Examples: </p> <ul><li>wiki:&#34;The whitespace convention&#34; </li><li>attachment:'the file.txt' or </li><li>attachment:&#34;the file.txt&#34; </li><li>attachment:&#34;the file.txt:ticket:123&#34; </li></ul><p> Note that by using <a href="https://trac.edgewall.org/intertrac/WikiCreole" title="WikiCreole in The Trac Project">WikiCreole</a> style links, it's quite natural to write links containing spaces: </p> <ul><li>[[The whitespace convention]] </li><li>[[attachment:the file.txt]] </li></ul><h3 class="section" id="EscapingLinks">Escaping Links</h3> <p> To prevent parsing of a TracLink, you can escape it by preceding it with a '!' (exclamation mark). </p> <pre class="wiki"> !NoLinkHere. ![42] is not a link either. </pre><p> Display: </p> <blockquote> <p> NoLinkHere. [42] is not a link either. </p> </blockquote> <h3 class="section" id="ParameterizedTraclinks">Parameterized Trac links</h3> <p> Many Trac resources have more than one way to be rendered, depending on some extra parameters. For example, a Wiki page can accept a <code>version</code> or a <code>format</code> parameter, a report can make use of dynamic variables, etc. </p> <p> Trac links can support an arbitrary set of parameters, written in the same way as they would be for the corresponding URL. Some examples: </p> <ul><li><code>wiki:WikiStart?format=txt</code> </li><li><code>ticket:1?version=1</code> </li><li><code>[/newticket?component=module1 create a ticket for module1]</code> </li><li><code>[/newticket?summary=Add+short+description+here create a ticket with URL with spaces]</code> </li></ul><h2 class="section" id="TracLinksReference"><a class="wiki" href="/wiki/TracLinks">TracLinks</a> Reference</h2> <p> The following sections describe the individual link types in detail, as well as notes on advanced usage of links. </p> <h3 class="section" id="attachment:links">attachment: links</h3> <p> The link syntax for attachments is as follows: </p> <ul><li>attachment:the_file.txt creates a link to the attachment the_file.txt of the current page </li><li>attachment:the_file.txt:wiki:MyPage creates a link to the attachment the_file.txt of the MyPage wiki page </li><li>attachment:the_file.txt:ticket:753 creates a link to the attachment the_file.txt of the ticket 753 </li></ul><p> Note that the older way, putting the filename at the end, is still supported: attachment:ticket:753:the_file.txt, but is not recommended. </p> <p> If you'd like to create a direct link to the content of the attached file instead of a link to the attachment page, simply use <code>raw-attachment:</code> instead of <code>attachment:</code>. </p> <p> This can be useful for pointing directly to an HTML document, for example. Note that for this use case, you'd have to allow the web browser to render the content by setting <a class="wiki" href="/wiki/TracIni#attachment-render_unsafe_content-option">[attachment] render_unsafe_content</a> = <code>enabled</code>. Caveat: only do that in environments for which you're 100% confident you can trust the people who are able to attach files, as this opens up your site to <a class="ext-link" href="https://en.wikipedia.org/wiki/Cross-site_scripting"><span class="icon">​</span>cross-site scripting</a> attacks. </p> <p> See also <a class="wiki" href="/wiki/TracLinks#export:links">#export:links</a>. </p> <h3 class="section" id="comment:links">comment: links</h3> <p> When you're inside a given ticket, you can simply write e.g. comment:3 to link to the third change comment. It is possible to link to a comment of a specific ticket from anywhere using one of the following syntax: </p> <ul><li><code>comment:3:ticket:123</code> </li><li><code>ticket:123#comment:3</code> (note that you can't write <code>#123#!comment:3</code>!) </li></ul><p> It is also possible to link to the ticket's description using one of the following syntax: </p> <ul><li><code>comment:description</code> (within the ticket) </li><li><code>comment:description:ticket:123</code> </li><li><code>ticket:123#comment:description</code> </li></ul><h3 class="section" id="htdocs:links">htdocs: links</h3> <p> Use <code>htdocs:path/to/file</code> to reference files in the <code>htdocs</code> directory of the Trac environment, the <a class="wiki" href="/wiki/TracEnvironment#DirectoryStructure">web resource directory</a>. </p> <h3 class="section" id="query:links">query: links</h3> <p> See <a class="wiki" href="/wiki/TracQuery#UsingTracLinks">TracQuery#UsingTracLinks</a> and <a class="wiki" href="/wiki/TracLinks#ticket:links">#ticket:links</a>. </p> <h3 class="section" id="search:links">search: links</h3> <p> See <a class="wiki" href="/wiki/TracSearch#SearchTracLinks">TracSearch#SearchTracLinks</a> </p> <h3 class="section" id="ticket:links">ticket: links</h3> <blockquote> <p> <em>aliases:</em> <code>bug:</code>, <code>issue:</code> </p> </blockquote> <p> Besides the obvious <code>ticket:id</code> form, it is also possible to specify a list of tickets or even a range of tickets instead of the <code>id</code>. This generates a link to a custom query view containing this fixed set of tickets. </p> <p> Example: </p> <ul><li><code>ticket:5000-6000</code> </li><li><code>ticket:1,150</code> </li></ul><h3 class="section" id="timeline:links">timeline: links</h3> <p> Links to the timeline can be created by specifying a date in the <a class="ext-link" href="https://en.wikipedia.org/wiki/ISO_8601" title="ISO Standard 8601 in Wikipedia"><span class="icon">​</span>ISO:8601</a> format. The date can be optionally followed by a time specification. The time is interpreted as being UTC time, but if you don't want to compute the UTC time, you can specify a local time followed by your timezone offset relative to UTC. </p> <p> Examples: </p> <ul><li><code>timeline:2008-01-29</code> </li><li><code>timeline:2008-01-29T15:48</code> </li><li><code>timeline:2008-01-29T15:48Z</code> </li><li><code>timeline:2008-01-29T16:48+01</code> </li><li><code>timeline:2008-01-29T16:48+0100</code> </li><li><code>timeline:2008-01-29T16:48+01:00</code> </li></ul><h3 class="section" id="wiki:links">wiki: links</h3> <p> See <a class="wiki" href="/wiki/WikiPageNames">WikiPageNames</a> and <a class="wiki" href="/wiki/TracLinks#QuotingspaceinTracLinks">quoting space in TracLinks</a> above. It is possible to create a link to a specific page revision using the syntax <a class="wiki" href="/wiki/WikiStart?version=1">WikiStart@1</a>. </p> <h3 class="section" id="VersionControlsystemlinks">Version Control system links</h3> <p> It should be noted that multiple repository support works by creating a kind of virtual namespace for versioned files in which the toplevel folders correspond to the repository names. Therefore, in presence of multiple repositories, a <em>/path</em> specification in the syntax of links detailed below should start with the name of the repository. If omitted, the default repository is used. In case a toplevel folder of the default repository has the same name as a repository, the link directs to the latter. One can always access such folder by fully qualifying it. The default repository can be an alias of a named repository, or conversely, there may be one or more aliases for the default repository, ask your Trac administrator. </p> <p> For example, <code>source:/trunk/COPYING</code> targets the path <code>/trunk/COPYING</code> in the default repository, whereas <code>source:/projectA/trunk/COPYING</code> targets the path <code>/trunk/COPYING</code> in the repository named <code>projectA</code>. This can be the same file if <code>'projectA'</code> is an alias to the default repository or if <code>''</code> (the default repository) is an alias to <code>'projectA'</code>. </p> <h4 class="section" id="source:links">source: links</h4> <blockquote> <p> <em>aliases:</em> <code>browser:</code>, <code>repos:</code> </p> </blockquote> <p> The default behavior for a <code>source:/some/path link</code> is to open the browser in that directory directory if the path points to a directory or to show the latest content of the file. </p> <p> It's also possible to link directly to a specific revision of a file like this: </p> <ul><li><code>source:/some/file@123</code> - link to the file's revision 123 </li><li><code>source:/some/file@head</code> - link explicitly to the latest revision of the file </li><li><code>source:/some/file@named-branch</code> - link to latest revision of the specified file in <code>named-branch</code> (DVCS such as Git or Mercurial) </li></ul><p> If the revision is specified, one can even link to a specific line number: </p> <ul><li><code>source:/some/file@123#L10</code> </li><li><code>source:/tag/0.10@head#L10</code> </li><li><code>source:/some/file@named-branch#L10</code> </li></ul><p> Finally, one can also highlight an arbitrary set of lines: </p> <ul><li><code>source:/some/file@123:10-20,100,103#L99</code> - highlight lines 10 to 20, and lines 100 and 103, and target line 99 </li><li>or without version number (the <code>@</code> is still needed): <code>source:/some/file@:10-20,100,103#L99</code>. Version can be omitted when the path is pointing to a source file that will no longer change (like <code>source:/tags/...</code>), otherwise it's better to specify which lines of <em>which version</em> of the file you're talking about. </li></ul><p> Note that in presence of multiple repositories, the name of the repository is simply integrated in the path you specify for <code>source:</code> (e.g. <code>source:reponame/trunk/README</code>). <em>(since 0.12)</em> </p> <h4 class="section" id="export:links">export: links</h4> <p> To force the download of a file in the repository, as opposed to displaying it in the browser, use the <code>export</code> link. Several forms are available: </p> <ul><li><code>export:/some/file</code> - get the HEAD revision of the specified file </li><li><code>export:123:/some/file</code> - get revision 123 of the specified file </li><li><code>export:/some/file@123</code> - get revision 123 of the specified file </li><li><code>export:/some/file@named-branch</code> - get latest revision of the specified file in <code>named-branch</code> (DVCS such as Git or Mercurial). </li></ul><p> This can be very useful for displaying XML or HTML documentation with correct stylesheets and images, in case that has been checked in into the repository. Note that for this use case, you'd have to allow the web browser to render the content by setting <a class="wiki" href="/wiki/TracIni#browser-render_unsafe_content-option">[browser] render_unsafe_content</a> = <code>enabled</code>, otherwise Trac will force the files to be downloaded as attachments for security concerns. </p> <p> If the path is to a directory in the repository instead of a specific file, the source browser will be used to display the directory (identical to the result of <code>source:/some/dir</code>). </p> <h4 class="section" id="log:links">log: links</h4> <p> The <code>log:</code> links are used to display revision ranges. In its simplest form, it can link to the latest revisions of the specified path, but it can also support displaying an arbitrary set of revisions. </p> <ul><li><code>log:/</code> - the latest revisions starting at the root of the repository </li><li><code>log:/trunk/tools</code> - the latest revisions in <code>trunk/tools</code> </li><li><code>log:/trunk/tools@10000</code> - the revisions in <code>trunk/tools</code> starting from revision 10000 </li><li><code>log:@20788,20791:20795</code> - list revision 20788 and the revisions from 20791 to 20795 </li><li><code>log:/trunk/tools@20788,20791:20795</code> - list revision 20788 and the revisions from 20791 to 20795 which affect the given path </li><li><code>log:/tools@named-branch</code> - the revisions in <code>tools</code> starting from the latest revision in <code>named-branch</code> (DVCS such as Git or Mercurial) </li></ul><p> There are short forms for revision ranges as well: </p> <ul><li><code>[20788,20791:20795]</code> </li><li><code>[20788,20791:20795/trunk/tools]</code> </li><li><code>r20791:20795</code> (but not <code>r20788,20791:20795</code> nor <code>r20791:20795/trunk</code>) </li></ul><p> Finally, note that in all of the above, a revision range can be written either as <code>x:y</code> or <code>x-y</code>. </p> <h4 class="section" id="Multi-repositorylinks">Multi-repository links</h4> <p> In the presence of multiple repositories, the name of the repository should be specified as the first part of the path: </p> <ul><li><code>log:repos/branch</code> </li><li><code>[20-40/repos]</code> </li><li><code>r20/repos</code> </li></ul><hr /> <p> See also: <a class="wiki" href="/wiki/WikiFormatting">WikiFormatting</a>, <a class="wiki" href="/wiki/TracWiki">TracWiki</a>, <a class="wiki" href="/wiki/WikiPageNames">WikiPageNames</a>, <a class="wiki" href="/wiki/InterTrac">InterTrac</a>, <a class="wiki" href="/wiki/InterWiki">InterWiki</a> </p> </div> <div class="trac-modifiedby"> <span> <a href="/wiki/TracLinks?action=diff&amp;version=107" title="Version 107 by Ryan J Ollos: Remove InterWiki that may not be present in all installations.">Last modified</a> <a class="timeline" href="/timeline?from=2022-04-11T01%3A01%3A42%2B02%3A00&amp;precision=second" title="See timeline at Apr 11, 2022, 1:01:42 AM">3 years ago</a> </span> <span class="trac-print"> Last modified on Apr 11, 2022, 1:01:42 AM </span> </div> </div> <div id="attachments"> </div> <div class="buttons"> <form method="get" action="/wiki/TracLinks" id="modifypage"> <div> <input type="hidden" name="action" value="edit" /> <input type="submit" value="Edit this page" /> </div> </form> <form method="get" action="/attachment/wiki/TracLinks/" id="attachfile"> <div> <input type="hidden" name="action" value="new" /> <input type="submit" id="attachfilebutton" value="Attach file"/> </div> </form> </div> <div class="trac-help"> <strong>Note:</strong> See <a href="/wiki/TracWiki">TracWiki</a> for help on using the wiki. </div> </div> <!-- # block content (content inherited from layout.html) --> <div id="altlinks"> <h3>Download in other formats:</h3> <ul> <li class="last first"> <a rel="nofollow" href="/wiki/TracLinks?format=txt" class=""> Plain Text</a> </li> </ul> </div> <!-- # endblock content (content inherited from layout.html) --> <!-- # endblock content (placeholder in theme.html) --> </div> <div id="footer"><hr/> <a id="tracpowered" href="https://trac.edgewall.org/" ><img src="/chrome/common/trac_logo_mini.png" height="30" width="107" alt="Trac Powered"/></a> <p class="left"> Powered by <a href="/about"><strong>Trac 1.4.3</strong></a> <br /> By <a href="http://www.edgewall.org/">Edgewall Software</a> . </p> <p class="right">Visit the Trac open source project at<br /><a href="//trac.edgewall.org/">https://trac.edgewall.org/</a></p> </div> <!-- # include 'site_footer.html' (theme.html) --> <!-- site_footer_trac.html --> </div><!-- #ew-content --> </div> </div> <div id="ew-footer"> <p><a href="mailto:info@edgewall.com">info@edgewall.com</a></p> <p>Copyright &copy; 2003-2024 Edgewall Software. All rights reserved.</p> </div> <div id="right"> <div id="ohloh-badge"> <a href="//www.openhub.net/p/trac"> <img src="//www.openhub.net/p/trac/widgets/project_thin_badge.gif" /> </a> </div> <script type="text/javascript"><!-- google_ad_client = "pub-3746245347013177"; google_ad_width = 120; google_ad_height = 600; google_ad_format = "120x600_as"; google_ad_channel ="9044578517"; google_ad_type = "text_image"; google_color_border = "8b8d8d"; /*google_color_border = "6b6d6d";*/ google_color_bg = "6b6d6d"; /*google_color_bg = "4b4d4d";*/ google_color_link = "336699"; google_color_url = "E2B200"; google_color_text = "8c8c8c"; /*google_color_text = "cccccc";*/ //--></script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <!-- /site_footer_trac.html --> <!-- end of site_footer.html --> <!-- # endblock body (content inherited from theme.html) --> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10