Compose tips

  • Syntax highlighting of source code can be enabled with the following tags:

    • Generic syntax highlighting tags: "<code>", "<blockcode>".
    • Language specific syntax highlighting tags: .

    Options and tips:

    • The language for the generic syntax highlighting tags can be specified with one of the attribute(s): type, lang, language, class. The possible values are: "c" (for C), "cpp" (for C++), "drupal5" (for Drupal 5), "drupal6" (for Drupal 6), "java" (for Java), "javascript" (for Javascript), "php" (for PHP), "python" (for Python), "ruby" (for Ruby).
    • The supported tag styles are: <foo>, [foo].
    • Line numbering can be enabled/disabled with the attribute "linenumbers". Possible values are: "off" for no line numbers, "normal" for normal line numbers and "fancy" for fancy line numbers (every nth line number highlighted). The start line number can be specified with the attribute "start", which implicitly enables normal line numbering. For fancy line numbering the interval for the highlighted line numbers can be specified with the attribute "fancy", which implicitly enables fancy line numbering.
    • If the source code between the tags contains a newline (e.g. immediatly after the opening tag), the highlighted source code will be displayed as a code block. Otherwise it will be displayed inline.
    • A title can be added to a code block with the attribute "title".

    Defaults:

    • Default highlighting mode for generic syntax highlighting tags: when no language attribute is specified, no syntax highlighting will be done.
    • Default line numbering: no line numbers.

    Examples:

    You typeYou get
    <code>foo = "bar";</code>Inline code with the default syntax highlighting mode.
    <code>
    foo = "bar";
    baz = "foz";
    </code>
    Code block with the default syntax highlighting mode.
    <code lang="cpp" linenumbers="normal">
    foo = "bar";
    baz = "foz";
    </code>
    Code block with syntax highlighting for C++ source code
    and normal line numbers.
    <code language="cpp" start="23" fancy="7">
    foo = "bar";
    baz = "foz";
    </code>
    Code block with syntax highlighting for C++ source code,
    line numbers starting from 23
    and highlighted line numbers every 7th line.
  • Textile Help

    Block modifier syntax:

    CSS attributes can be applied to blocks (paragraphs, headers, etc.). CSS classes are specifed with (class); CSS IDs are specified with (#id); both can be specified with (class#id). An arbtirary CSS style can be applied by using {style}. Finally, language attributes are applied using [language].

    Additionally, alignment and indentation shorthands are provided. To left-align, right-align, center, and justify text, use <, >, =, and <>, respectively. ( left-indents a block 1em for each occurrence, and ) right-indents similarly.

    Tables have additional options. ^, -, and ~ specify top, middle, and bottom vertical alignment. The _ attribute on a cell indicates that it is a table header.

    The examples below illustrate these attributes.

    textile input output

    Headings

    hx. (where x is 1 - 6)
    h1. Heading

    Heading

    h2(class). Heading with class

    Heading with class

    Paragraphs

    p=. Centered text

    Centered text

    p())(#id). Indented text with ID

    Indented text with ID

    Block quotes

    bq(class#id). Quote with class and ID
    Quote with class and ID
    bq[en]. English quote
    English quote

    Ordered lists

    {color: blue}# Attributes specified
    # before the first item
    # affect the whole list
    1. Attributes specified
    2. before the first item
    3. affect the whole list

    Unordered lists

    * Lists can have
    ## subitems or
    ## sublists
    * too
    • Lists can have
      1. subitems or
      2. sublists
    • too

    Footnotes

    fnx. (where x is 1 - 100)
    fn17. Footnote

    17 Footnote

    Tables

    |_. A|_. B|_. C|
    (dark). |very|simple|table|
    |<. left|=. center|>. right|
    |^{height:3em}. top|-. middle|~. bottom|
    A B C
    very simple table
    left center right
    top middle bottom

    Phrase modifier syntax:

    The class, ID, style, and language attributes described above also apply to the span phrase modifier as shown below.

    textile input output
    _emphasis_ emphasis
    __italic__ italic
    *strong* strong
    **bold** bold
    ??citation?? citation
    -delete text- deleted text
    +inserted text+ inserted text
    ^superscript^ superscript
    ~subscript~ subscript
    @code@ code
    %(class)span% span
    %{color:red;}span% span
    ==no textile== no textile
    "link text":http://drupal.org link text
    "link text(title)":http://drupal.org link text
    !/misc/druplicon.png!
    !/misc/druplicon.png(alt text)! alt text
    !/misc/druplicon.png!:http://drupal.org
    ABC(Always Be Closing) ABC
    Footnote reference[10] Footnote reference10
  • To add a lightbox to your images, add rel="lightbox" attribute to any link tag to activate the lightbox. For example:

    <a href="image-1.jpg" rel="lightbox">image #1</a>

    <a href="image-1.jpg" rel="lightbox[][my caption]">image #1</a>

    To show a caption either use the title attribute or put in the second set of square brackets of the rel attribute.

    If you have a set of related images that you would like to group, then you will need to include a group name between square brackets in the rel attribute. For example:

    <a href="image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
    <a href="image-2.jpg" rel="lightbox[roadtrip][caption 2]">image #2</a>
    <a href="image-3.jpg" rel="lightbox[roadtrip][caption 3]">image #3</a>

    There are no limits to the number of image sets per page or how many images are allowed in each set.

    If you wish to turn the caption into a link, format your caption in the following way:

    <a href="image-1.jpg" rel='lightbox[][<a href="http://www.yourlink.com">View Image Details</a>]' >image #1</a>

  • To add a lightbox slideshow to your images, add rel="lightshow[slideshowname][slide caption]" attribute to any link tag to activate the slideshow. For example:

    <a href="image-1.jpg" rel="lightshow[show1]">image #1</a>
    <a href="image-2.jpg" rel="lightshow[show1]">image #2</a>
    <a href="image-3.jpg" rel="lightshow[show1]">image #3</a>

    The title attribute in the link tag is optional. The addition of this attribute enables the display of a caption with the image displayed in the lightbox.

    There are no limits to the number of slideshow image sets per page or how many images are allowed in each slideshow.

    If you wish to turn the caption into a link, format your caption in the following way:

    <a href="image-1.jpg" rel='lightshow[show1][<a href="http://www.yourlink.com">View Image Details</a>]'>image #1</a>

Syndicate content