/** * Textile Language Definition * See default.js for documentation * */ (function($) { // No need to set all the replacements, only those different from the default language (Markdown). var Textile = { 'function-hr' : undefined, 'function-code' : { replace: "bc. $1$2", whole_line: true }, 'function-ol' : { 'line': function ( index, line) { return '# ' + line + "\n"; } }, 'function-blockquote' : { replace: "bq. $1$2", }, 'function-h1' : { replace: "h1. $1$2" }, 'function-h2' : { replace: "h2. $1$2" }, 'function-h3' : { replace: "h3. $1$2" }, 'function-link' : { replace: function( res ) { var rep = ''; if ( res['text'] && res['href'] ) { rep = '"' + res['text'] + '":' + res['href']; } return rep; } }, 'function-image' : { replace: function( res ) { var rep = ''; if ( res['url'] ) { var rep = '!' + res['url']; if ( res['alt'] != '' ) { rep += '(' + res['alt'] + ')'; } rep += '!'; return rep; } } } }; $.GollumEditor.defineLanguage('textile', $.constructLanguageDefinition(Textile)); var TextileHelp = [ { menuName: 'Phrase Modifiers', content: [ { menuName: 'Emphasis / Strength', data: '

To place emphasis or strength on inline text, simply place _ (underscores) around the text for emphasis or * (asterisks) around the text for strength. In most browsers, _mytext_ will appear as italics and *mytext* will appear as bold.

To force italics or bold, simply double the characters: __mytext__ will appear italic and **mytext** will appear as bold text.

' }, { menuName: 'Citations / Editing', data: '

To display citations, wrap your text in ?? (two question marks).

To display edit marks such as deleted text (strikethrough) or inserted text (underlined text), wrap your text in - (minuses) or + (pluses). For example -mytext- will be rendered as mytext and +mytext+ will be rendered as mytext

' }, { menuName: 'Superscript / Subscript', data: '

To display superscript, wrap your text in ^ (carets). To display subscript, wrap your text in ~ (tildes).

' }, { menuName: 'Code', data: '

To display monospace code, wrap your text in @ (at symbol). For example, @mytext@ will appear as mytext.

' }, { menuName: 'Acronyms', data: '

To create an acronym, suffix the acronym with the definition in parentheses. For example, JS(JavaScript) will be displayed as JS.

' } ] }, { menuName: 'Block Modifiers', content: [ { menuName: 'Headings', data: '

To display a heading in Textile, prefix your line of text with hn., where n equals the heading size you want (1 is largest, 6 is smallest).

' }, { menuName: 'Paragraphs / Quotes', data: '

To create a new paragraph, prefix your first line of a block of text with p..

To create a blockquote, make sure at least one blank line exists between your text and any surrounding text, and then prefix that block with bq. If you need to extend a blockquote to more than one text block, write bq.. (note the two periods) and prefix your next normal paragraph with p.

' }, { menuName: 'Code Blocks', data: '

Code blocks in textile are simply prefixed like any other block. To create a code block, place the beginning of the block on a separate line and prefix it with bc.

To display a preformatted block, prefix the block with pre.

' }, { menuName: 'Lists', data: '

To create ordered lists, prefix each line with #. To create unordered lists, prefix each line with *.

' } ] }, { menuName: 'Links / Images', content: [ { menuName: 'Links', data: '

To display a link, put the text you want to display in quotes, then a colon (:), then the URL after the colon. For example "GitHub":http://github.com/ will appear as GitHub.

' }, { menuName: 'Images', data: '

To display an image, simply wrap the image’s URL in ! (exclamation points). If you want to link the image to a URL, you can blend the image and link syntax: place your image URL in the exclamation points and suffix that with a colon and your URL. For example, an image at http://myurl/image.png that should link to http://myurl/ should be written as !http://myurl/image.png!:http://myurl/.

' } ] } ]; $.GollumEditor.defineHelp('textile', TextileHelp); })(jQuery);