You are here: Home › › Compose tips
Compose tips
- Web page addresses and e-mail addresses turn into links automatically. (Better URL filter.)
- Every instance of "<!--tableofcontents-->" in the input text will be replaced with a collapsible mediawiki-style table of contents. Accepts options for title, list style, minimum heading level, and maximum heading level as follows: <!--tableofcontents list: ol; title: Table of Contents; minlevel: 1; maxlevel: 3;-->. All arguments are optional and defaults are shown.
- Every instance heading tags will be modified to include an id attribute for anchor linking.
- You can insert footnotes directly into texts with
[fn]This text becomes a footnote.[/fn]. This will be replaced with a running number (the footnote reference) and the text within the [fn] tags will be moved to the bottom of the page (the footnote). Allowed HTML tags: <a> <b> <address> <blockquote> <br> <caption> <code> <dd> <del> <dl> <dt> <em> <h2> <h3> <h4> <hr> <i> <li> <ol> <p> <pre> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <u> <ul>
Syntax highlighting of source code can be enabled with the following tags:
- Generic syntax highlighting tags: "
<pre>". - Language specific syntax highlighting tags: "
<code-bash>" for Bash source code, "<code-c>" for C source code, "<code-caddcl>" for CAD DCL source code, "<code-cpp>" for C++ source code, "<code-css>" for CSS source code, "<code-diff>" for Diff source code, "<code-drupal5>" for Drupal 5 source code, "<code-drupal6>" for Drupal 6 source code, "<code-fortran>" for Fortran source code, "<code-groovy>" for Groovy source code, "<code-html4strict>" for HTML source code, "<code-java>" for Java source code, "<code-javascript>" for Javascript source code, "<code-latex>" for LaTeX source code, "<code-matlab>" for Matlab M source code, "<code-mysql>" for MySQL source code, "<code-perl>" for Perl source code, "<code-php>" for PHP source code, "<code-python>" for Python source code, "<code-tcl>" for TCL source code, "<code-vb>" for Visual Basic source code, "<code-vbnet>" for vb.net source code, "<code-xml>" for XML source code.
Options and tips:
- The language for the generic syntax highlighting tags can be specified with one of the attribute(s): class. The possible values are: "
bash" (for Bash), "c" (for C), "caddcl" (for CAD DCL), "code-bash" (for Bash), "code-c" (for C), "code-caddcl" (for CAD DCL), "code-cpp" (for C++), "code-css" (for CSS), "code-diff" (for Diff), "code-drupal5" (for Drupal 5), "code-drupal6" (for Drupal 6), "code-fortran" (for Fortran), "code-groovy" (for Groovy), "code-html4strict" (for HTML), "code-java" (for Java), "code-javascript" (for Javascript), "code-latex" (for LaTeX), "code-matlab" (for Matlab M), "code-mysql" (for MySQL), "code-perl" (for Perl), "code-php" (for PHP), "code-python" (for Python), "code-tcl" (for TCL), "code-vb" (for Visual Basic), "code-vbnet" (for vb.net), "code-xml" (for XML), "cpp" (for C++), "css" (for CSS), "diff" (for Diff), "drupal5" (for Drupal 5), "drupal6" (for Drupal 6), "fortran" (for Fortran), "groovy" (for Groovy), "html4strict" (for HTML), "java" (for Java), "javascript" (for Javascript), "latex" (for LaTeX), "matlab" (for Matlab M), "mysql" (for MySQL), "perl" (for Perl), "php" (for PHP), "python" (for Python), "tcl" (for TCL), "vb" (for Visual Basic), "vbnet" (for vb.net), "xml" (for XML). - 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.
Defaults:
- Default highlighting mode for generic syntax highlighting tags: when no language attribute is specified the code block won't be processed by the GeSHi filter.
- Default line numbering: no line numbers.
Examples:
You type You get <pre>foo = "bar";</pre>Inline code with the default syntax highlighting mode. <pre>
foo = "bar";
baz = "foz";
</pre>Code block with the default syntax highlighting mode. <pre class="javascript" linenumbers="normal">
foo = "bar";
baz = "foz";
</pre>Code block with syntax highlighting for Javascript source code
and normal line numbers.<pre class="javascript" start="23" fancy="7">
foo = "bar";
baz = "foz";
</pre>Code block with syntax highlighting for Javascript source code,
line numbers starting from 23
and highlighted line numbers every 7th line.<code-bash>
foo = "bar";
baz = "foz";
</code-bash>Code block with syntax highlighting for Bash source code. <code-bash start="23" fancy="7">
foo = "bar";
baz = "foz";
<code-bash>Code block with syntax highlighting for Bash source code,
line numbers starting from 23
and highlighted line numbers every 7th line.- Generic syntax highlighting tags: "
- Typogrify.module brings the typographic refinements of Typogrify to Drupal.
- Wraps ampersands (the $ldquo;&” character) with <span class=\"amp\">&</span>.
- Prevents single words from wrapping onto their own line using Shaun Inman's Widont technique.
- Converts straight quotation marks to typographer's quotation marks, using SmartyPants.
- Converts multiple hyphens to en dashes and em dashes (according to your preferences), using SmartyPants.
- Wraps multiple capital letters with <span class=\"caps\">CAPS</span>.
- Wraps initial quotation marks with <span class=\"quo\"></span> or <span class=\"dquo\"></span>.
- Adds a css style sheet that uses the <span> tags to substitute a showy ampersand in headlines, switch caps to small caps, and hang initial quotation marks.
- HTML tags will be transformed to conform to HTML standards.
- The Glossary module will automatically mark terms that have been defined in the glossary vocabulary with links to their descriptions. These marks depend on the settings and may be a superscript character or an icon, or the term may be turned into an acronym, cite, or abbreviation. If there are certain phrases or sections of text that should be excluded from glossary marking and linking, use the special markup, [no-glossary] ... [/no-glossary]. Additionally, these HTML elements will not be scanned: a, abbr, acronym, code, pre.
- Inline assets are allowed. Use the Insert Assets link or the WYSIWYG editor button to insert the proper format.
