Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.cmm.msu.ru/trac/tanchiki/wiki/WikiProcessors?action=diff&version=1
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Mon Apr 11 21:18:36 2016
Êîäèðîâêà: IBM-866
WikiProcessors (diff) òÀÓ Tanchiki

Changes between Initial Version and Version 1 of WikiProcessors


Ignore:
Timestamp:
11/20/10 16:22:18 (5 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiProcessors

    v1 v1 ˆà
    ˆà1= Wiki Processors =ˆà
    ˆà2ˆà
    ˆà3Processors are WikiMacros designed to provide alternative markup formats for the [TracWiki Wiki engine]. Processors can be thought of as ''macro functions to process user-edited text''. ˆà
    ˆà4ˆà
    ˆà5The Wiki engine uses processors to allow using [wiki:WikiRestructuredText Restructured Text], [wiki:WikiHtml raw HTML] and [http://www.textism.com/tools/textile/ textile] in any Wiki text throughout Trac.ˆà
    ˆà6ˆà
    ˆà7ˆà
    ˆà8== Using Processors ==ˆà
    ˆà9ˆà
    ˆà10To use a processor on a block of text, use a Wiki code block, selecting a processor by name using ''shebang notation'' (#!), familiar to most UNIX users from scripts.ˆà
    ˆà11ˆà
    ˆà12'''Example 1''' (''inserting raw HTML in a wiki text''):ˆà
    ˆà13ˆà
    ˆà14{{{ˆà
    ˆà15#!htmlˆà
    ˆà16<pre class="wiki">{{{ˆà
    ˆà17#!htmlˆà
    ˆà18&lt;h1 style="color: orange"&gt;This is raw HTML&lt;/h1&gt;ˆà
    ˆà19}}}</pre>ˆà
    ˆà20}}}ˆà
    ˆà21ˆà
    ˆà22'''Results in:'''ˆà
    ˆà23{{{ˆà
    ˆà24#!htmlˆà
    ˆà25<h1 style="color: orange">This is raw HTML</h1>ˆà
    ˆà26}}}ˆà
    ˆà27ˆà
    ˆà28Note that since 0.11, such blocks of HTML have to be self-contained, i.e. you can't start an HTML element in one block and close it later in a second block. Use div or span processors for achieving similar effect (see WikiHtml).ˆà
    ˆà29ˆà
    ˆà30----ˆà
    ˆà31ˆà
    ˆà32'''Example 2''' (''inserting Restructured Text in wiki text''):ˆà
    ˆà33ˆà
    ˆà34{{{ˆà
    ˆà35#!htmlˆà
    ˆà36<pre class="wiki">{{{ˆà
    ˆà37#!rstˆà
    ˆà38A headerˆà
    ˆà39--------ˆà
    ˆà40This is some **text** with a footnote [*]_.ˆà
    ˆà41ˆà
    ˆà42.. [*] This is the footnote.ˆà
    ˆà43}}}</pre>ˆà
    ˆà44}}}ˆà
    ˆà45ˆà
    ˆà46'''Results in:'''ˆà
    ˆà47{{{ˆà
    ˆà48#!rstˆà
    ˆà49A headerˆà
    ˆà50--------ˆà
    ˆà51This is some **text** with a footnote [*]_.ˆà
    ˆà52ˆà
    ˆà53.. [*] This is the footnote.ˆà
    ˆà54}}}ˆà
    ˆà55----ˆà
    ˆà56'''Example 3''' (''inserting a block of C source code in wiki text''):ˆà
    ˆà57ˆà
    ˆà58{{{ˆà
    ˆà59#!htmlˆà
    ˆà60<pre class="wiki">{{{ˆà
    ˆà61#!cˆà
    ˆà62int main(int argc, char *argv[])ˆà
    ˆà63{ˆà
    ˆà64  printf("Hello World\n");ˆà
    ˆà65  return 0;ˆà
    ˆà66}ˆà
    ˆà67}}}</pre>ˆà
    ˆà68}}}ˆà
    ˆà69ˆà
    ˆà70'''Results in:'''ˆà
    ˆà71{{{ˆà
    ˆà72#!cˆà
    ˆà73int main(int argc, char *argv[])ˆà
    ˆà74{ˆà
    ˆà75  printf("Hello World\n");ˆà
    ˆà76  return 0;ˆà
    ˆà77}ˆà
    ˆà78}}}ˆà
    ˆà79ˆà
    ˆà80----ˆà
    ˆà81ˆà
    ˆà82== Available Processors ==ˆà
    ˆà83The following processors are included in the Trac distribution:ˆà
    ˆà84 * '''html''' -- Insert custom HTML in a wiki page. See WikiHtml.ˆà
    ˆà85 * '''div''' -- Wrap an arbitrary Wiki content in a <div> element (''since 0.11''). See WikiHtml.ˆà
    ˆà86 * '''span''' -- Wrap an arbitrary Wiki content in a <span> element (''since 0.11''). See also WikiHtml.ˆà
    ˆà87 * '''rst''' -- Trac support for Restructured Text. See WikiRestructuredText.ˆà
    ˆà88 * '''textile''' -- Supported if [http://cheeseshop.python.org/pypi/textile Textile] is installed. See [http://www.textism.com/tools/textile/ a Textile reference].ˆà
    ˆà89 * '''comment''' -- Do not process the text in this section (i.e. contents exist only in the plain text - not in the rendered page).ˆà
    ˆà90 * '''diff''' -- Pretty print patches and diffs.ˆà
    ˆà91ˆà
    ˆà92=== Code Highlighting Support ===ˆà
    ˆà93Trac includes processors to provide inline [wiki:TracSyntaxColoring syntax highlighting] for the following languages:ˆà
    ˆà94 * '''c''' -- Cˆà
    ˆà95 * '''cpp''' -- C++ˆà
    ˆà96 * '''csharp''' --- C# (''use #!text/x-csharp'')ˆà
    ˆà97 * '''python''' -- Pythonˆà
    ˆà98 * '''perl''' -- Perlˆà
    ˆà99 * '''ruby''' -- Rubyˆà
    ˆà100 * '''php''' -- PHPˆà
    ˆà101 * '''asp''' -- ASPˆà
    ˆà102 * '''java''' -- Javaˆà
    ˆà103 * '''js''' -- Javascriptˆà
    ˆà104 * '''sql''' -- SQLˆà
    ˆà105 * '''xml''' -- XMLˆà
    ˆà106 * '''sh''' -- Bourne/Bash shellˆà
    ˆà107ˆà
    ˆà108'''Note:''' ''Trac relies on external software packages for syntax coloring. See TracSyntaxColoring for more info.''ˆà
    ˆà109ˆà
    ˆà110By using the MIME type as processor, it is possible to syntax-highlight the same languages that are supported when browsing source code. For example, you can write:ˆà
    ˆà111{{{ˆà
    ˆà112{{{ˆà
    ˆà113#!text/htmlˆà
    ˆà114<h1>text</h1>ˆà
    ˆà115}}}ˆà
    ˆà116}}}ˆà
    ˆà117ˆà
    ˆà118The result will be syntax highlighted HTML code:ˆà
    ˆà119{{{ˆà
    ˆà120#!text/htmlˆà
    ˆà121<h1>text</h1>ˆà
    ˆà122}}}ˆà
    ˆà123ˆà
    ˆà124The same is valid for all other mime types supported.ˆà
    ˆà125ˆà
    ˆà126ˆà
    ˆà127For more processor macros developed and/or contributed by users, visit: ˆà
    ˆà128 * [trac:ProcessorBazaar]ˆà
    ˆà129 * [trac:MacroBazaar]ˆà
    ˆà130 * [th:WikiStart Trac Hacks] community siteˆà
    ˆà131ˆà
    ˆà132ˆà
    ˆà133== Advanced Topics: Developing Processor Macros ==ˆà
    ˆà134Developing processors is no different from Wiki macros. In fact they work the same way, only the usage syntax differs. See WikiMacros for more information.ˆà
    ˆà135ˆà
    ˆà136ˆà
    ˆà137----ˆà
    ˆà138See also: WikiMacros, WikiHtml, WikiRestructuredText, TracSyntaxColoring, WikiFormatting, TracGuideˆà