git.iko.soy/typeable/pandoc
on master help sign in
Improved README on lists.
0d19adeJohn MacFarlane
README+123−10
@@ -806,18 +806,93 @@ Lists
806
806
807### Bullet lists ###
807### Bullet lists ###
808
808
809−TODO
809+A bullet list is a list of bulleted list items. A bulleted list
810+item begins with a bullet (`*`, `+`, or `-`). Here is a simple
811+example:
812+
813+ * one
814+ * two
815+ * three
816+
817+This will produce a "compact" list. If you want a "loose" list, in which
818+each item is formatted as a paragraph, put spaces between the items:
819+
820+ * one
821+
822+ * two
823+
824+ * three
825+
826+The bullets need not be flush with the left margin; they may be
827+indented one, two, or three spaces. The bullet must be followed
828+by whitespace.
829+
830+A list item may contain multiple paragraphs and other block-level
831+content. Subsequent paragraphs must be preceded by a blank line
832+and indented four spaces or a tab. The list will look better if
833+the first paragraph is aligned with the rest:
834+
835+ * First paragraph.
836+
837+ Continued.
838+
839+ * Second paragraph. With a code block, which must be indented
840+ eight spaces:
841+
842+ { code }
843+
844+List items may include other lists. In this case the preceding blank
845+line is optional. The nested list must be indented four spaces or
846+one tab:
847+
848+ * fruits
849+ + apples
850+ - macintosh
851+ - red delicious
852+ + pears
853+ + peaches
854+ * vegetables
855+ + brocolli
856+ + chard
857+
858+Markdown allows you to write list items "lazily," instead of
859+indenting continuation lines. However, if there are multiple paragraphs
860+or other blocks in a list item, the first line of each must be indented.
861+
862+ + A lazy, lazy, list
863+ item.
864+
865+ + Another one; this looks
866+ bad but is legal.
867+
868+ Second paragraph of second
869+ list item.
810
870
811−TODO - rules for tight and loose
812
871
813### Ordered lists ###
872### Ordered lists ###
814
873
815−TODO - basic description
874+Ordered lists work just like bulleted lists, except that the items
875+begin with enumerators rather than bullets.
876+
877+In standard markdown, enumerators are decimal numbers followed
878+by a period and a space. The numbers themselves are ignored, so
879+there is no difference between this list:
880+
881+ 1. one
882+ 2. two
883+ 3. three
884+
885+and this one:
886+
887+ 5. one
888+ 7. two
889+ 1. three
890+
891+*Pandoc extension*.
816
892
817Unlike standard markdown, Pandoc allows ordered list items to be marked
893Unlike standard markdown, Pandoc allows ordered list items to be marked
818with uppercase and lowercase letters and roman numerals, in addition to
894with uppercase and lowercase letters and roman numerals, in addition to
819−arabic numerals. (This behavior can be turned off using the `--strict`
820−option.) List markers may be enclosed in parentheses or followed by a
895+arabic numerals. List markers may be enclosed in parentheses or followed by a
821single right-parentheses or period. They must be separated from the
896single right-parentheses or period. They must be separated from the
822text that follows by at least one space, and, if the list marker is a
897text that follows by at least one space, and, if the list marker is a
823capital letter with a period, by at least two spaces.[^2]
898capital letter with a period, by at least two spaces.[^2]
@@ -937,18 +1012,18 @@ The label can be any string of alphanumeric characters, underscores,
937or hyphens.
1012or hyphens.
938
1013
939
1014
940−### Nested lists ###
1015+### Compact and loose lists ###
941
1016
942−Pandoc behaves differently from standard markdown on some "edge
1017+Pandoc behaves differently from `Markdown.pl` on some "edge
943cases" involving lists. Consider this source:
1018cases" involving lists. Consider this source:
944
1019
945− 1. First
1020+ + First
946− 2. Second:
1021+ + Second:
947 - Fee
1022 - Fee
948 - Fie
1023 - Fie
949 - Foe
1024 - Foe
950
1025
951− 3. Third
1026+ + Third
952
1027
953Pandoc transforms this into a "compact list" (with no `<p>` tags around
1028Pandoc transforms this into a "compact list" (with no `<p>` tags around
954"First", "Second", or "Third"), while markdown puts `<p>` tags around
1029"First", "Second", or "Third"), while markdown puts `<p>` tags around
@@ -962,6 +1037,44 @@ behavior is consistent with the official markdown syntax description,
962even though it is different from that of `Markdown.pl`.)
1037even though it is different from that of `Markdown.pl`.)
963
1038
964
1039
1040+### Ending a list ###
1041+
1042+What if you want to put an indented code block after a list?
1043+
1044+ - item one
1045+ - item two
1046+
1047+ { my code block }
1048+
1049+Trouble! Here pandoc (like other markdown implementations) will treat
1050+`{ my code block }` as the second paragraph of item two, and not as
1051+a code block.
1052+
1053+To "cut off" the list after item two, you can insert some non-indented
1054+content, like an HTML comment, which won't produce visible output in
1055+any format:
1056+
1057+ - item one
1058+ - item two
1059+
1060+ <!-- end of list -->
1061+
1062+ { my code block }
1063+
1064+You can use the same trick if you want two consecutive lists instead
1065+of one big list:
1066+
1067+ 1. one
1068+ 2. two
1069+ 3. three
1070+
1071+ <!-- -->
1072+
1073+ a. uno
1074+ b. dos
1075+ c. très
1076+
1077+
965Horizontal rules
1078Horizontal rules
966----------------
1079----------------
967
1080