Sage
Welcome to Sage
Volume (38%) Hide Volume
Topics
Lists

Basic Lists

The [list] tag begins a list; until the matching [end] tag, any line that begins with either ## or #* defines a new item in the list. Use ## for ordered lists, and #* for unordered lists. For example…

Some of my favorite fruits include[...] [list] #* Apples #* Bananas #* Cherries #* Dates [end]

The above produces this…


Some of my favorite fruits include…
  • Apples
  • Bananas
  • Cherries
  • Dates


An example of an ordered list…

The four main sections of a Delphi unit are[...] [list] ## Interface ## Implementation ## Initialization ## Finalization [end]

The above produces this…


The four main sections of a Delphi unit are…
  1. Interface
  2. Implementation
  3. Initialization
  4. Finalization


Nested Lists

Lists can nest, to any desired depth…

Some random items[...] [list] #* Item 1 #* Item 2 [list] ## Sub-item ## Another sub-item ## Final sub-item [list] #* Details #* Details #* Details [end] [end] #* Item 3 #* Item 4 #* Item 5 [end]

The above produces this…


Some random items…
  • Item 1
  • Item 2
    1. Sub-item
    2. Another sub-item
    3. Final sub-item
      • Details
      • Details
      • Details
  • Item 3
  • Item 4
  • Item 5


Defining Items

Items in a list may be as long as you like, and can span multiple lines. If you need a line to begin with ## or #*, but you don't want to start a new list item, use the [#] tag, which expands to a single # character. For example…

Some random stuff[...] [list] #* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. #* A bunch of double-pound signs: ## ## ## ## ## ## ## ## ## [#]# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## [#]# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #* Try this query[...] [.sql] select * from acct where acct_nbr < 100 [end] #* That's all for now. [end]

The above produces this…


Some random stuff…
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • A bunch of double-pound signs: ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
  • Try this query… select * from acct where acct_nbr < 100
  • That's all for now.


An alternative to the [#] tag is the [plain] tag.

Important

You cannot have content (other than whitespace) after the [list] tag, but before the first item.


Tip

Blank lines before and/or after the list, and/or between items, can make some lists easier to read. For example, compare the following two lists.
List one, with no blank lines…
  1. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
  2. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
  3. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
End of list one.
List two, with blank lines…

  1. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.

  2. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.

  3. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.

End of list two.


Custom List Indenting

By default, list items are indented, for example…

[box alert=Tips] [title]Tips for Driving in Snow[end] [list] #* Stay home. Only go out if necessary. #* Drive slowly. #* Accelerate and decelerate slowly. #* Increase your following distance to five to six seconds. #* Know your brakes. #* Don't stop if you can avoid it. #* Don't power up hills. #* Don't stop going up a hill. [end] [end]

The above example produces this…

Tips for Driving in Snow

  • Stay home. Only go out if necessary.
  • Drive slowly.
  • Accelerate and decelerate slowly.
  • Increase your following distance to five to six seconds.
  • Know your brakes.
  • Don't stop if you can avoid it.
  • Don't power up hills.
  • Don't stop going up a hill.


Notice that the bullet items are indented on the left side. On the [list] tag, the indent attribute controls how much the items are indented. For example, let's change the above list tag to: [list indent=1.25em]. We now get this…

Tips for Driving in Snow

  • Stay home. Only go out if necessary.
  • Drive slowly.
  • Accelerate and decelerate slowly.
  • Increase your following distance to five to six seconds.
  • Know your brakes.
  • Don't stop if you can avoid it.
  • Don't power up hills.
  • Don't stop going up a hill.


For more information on specifying the indent attribute: https://developer.mozilla.org/en-US/docs/Web/CSS/length.

List Numbering

By default, ordered lists are numbered with decimal numbers…


  1. First item
  2. Second item
  3. Third item
  4. Fourth item
  5. Fifth item


Using the type attribute on the [list] tag, you can specify a different numbering scheme. For example, [list type=UpperRoman] produces this…


  1. First item
  2. Second item
  3. Third item
  4. Fourth item
  5. Fifth item


The following table lists all supported choices for the type attribute…

Type Attribute Alias Numbers
Decimal 1 1, 2, 3, 4, 5, 6, …
UpperAlpha A A, B, C, D, E, F, …
UpperRoman I I, II, III, IV, V, VI, …
LowerAlpha a a, b, c, d, e, f, …
LowerRoman i i, ii, iii, iv, v, vi, …
Auto (see below)
None (no numbers)

The Auto option automatically selects one of the first five choices above, based on the nesting of ordered lists.

For example…

[list] ## Fruit [list type=auto] ## Orange ## Apple [list type=auto] ## Granny Smith ## Gala ## Red Delicious [end] ## Banana [end] ## Vegetable [list type=auto] ## Carrot ## Spinach ## Broccoli [end] ## Bread [list type=auto] ## Rye ## Sourdough ## French [end] [end]

The above produces this…


  1. Fruit
    1. Orange
    2. Apple
      1. Granny Smith
      2. Gala
      3. Red Delicious
    3. Banana
  2. Vegetable
    1. Carrot
    2. Spinach
    3. Broccoli
  3. Bread
    1. Rye
    2. Sourdough
    3. French


As this example demonstrates, the Auto option cycles through the first five choices (with wrap-around).

Last Modified: 5/17 1:33:50 pm
In this article (top)  View article's Sage markup
5/17 1:33:50 pm