Alignment options

Some alignment options have already been mentioned, but those were options specific to certain rules. In addition to them, Redmine supports common alignment options, which are the following:

  • <: Align to the left
  • =: Align centrally
  • <>: Justify
  • >: Align to the right

Here are some examples of using these options:

p<>. This paragraph will be justified.
bq>. This quote will be aligned to the right.

Some elements, such as table cells, also support options for vertical alignment:

  • ^: Align to the top
  • -: Align to middle
  • ~: Align to the bottom

Here is an example of using ^:

|/3^. Cell value aligned to the top|

Padding options

Block elements, such as paragraphs and cells, can be padded using the ( and ) options. These options control how many ems (typography units) of padding should be added to the left side [(] and the right side [)] of the block. The quantity is specified using a suitable number of parentheses. An example of using these options:

p(((). This paragraph will use padding.

For this paragraph, the left padding will be set to 3 ems and the right padding will be set to 1 em.

Custom styles and language

We can do even more with Textile. Thus, we can specify the name of the CSS class for an element, as follows (the class name is in parentheses):

p(info). This paragraphs will use <p class="info">.
"(redmine-link)Redmine":http://www.redmine.org

Of course, such CSS classes should have previously been defined in CSS files (for example, in the theme; see Chapter 11, Customizing Redmine).

However, if the style that you need is not specified in CSS, you can write some CSS rules directly in Textile, as follows (use curly brackets):

"{color:red}Redmine":http://www.redmine.org
*{font-family:Tahoma} Tahoma font

Unfortunately, not all CSS rules can be specified in this way. Thus, CSS properties that are supported by Textile include color, width, height, border, background, padding, margin, font, text, and those that start with border-, background-, padding-, margin-, font-, and text-.

Additionally, you can specify the (human) language of the element, as follows:

*[en] English
bq[en]. English quote.

The Textile span

If you are familiar with HTML and CSS, you should be aware of the magic <span> tag. I call this tag magic because it is intended to be used to style a part of the text if no other HTML tag fits better. This element is supported in Textile as well. Thus, it can be created using the % marker, as follows:

Let's make %{color:red}this text red% and %{color:yellow}this one yellow%.

The span element supports most of the advanced options that were described earlier.

Disabling an element

What if you don't want the #1 text to be rendered as an issue link? Almost every marker or rule in Textile can be disabled using the special ! marker.

Check out the following examples:

!#1
!r128
![[Wiki]]
!{{macro_list}}

All of these rules will be rendered as is (but without the exclamation mark).

Advanced table syntax

The table syntax is the most complex syntax in Textile, so it may become a headache to style all cells of a table properly using advanced options. For such cases, Textile supports batch styling.

So, to style an entire table, you can use the special table. rule (including the dot), which should be specified on its own line right before the table markers. Thus, to add a red border to a table, you can do the following:

table{border:2px solid red}.
|_.Heading 1|_.Heading 2|
|     ?     |     ?     |

A similar batch mode is also supported for table rows. Thus, to change the background color of the heading row to gray, you can write this:

{background-color:gray}. |_.Heading 1|_.Heading 2|
                         |     ?     |     ?     |
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset