From 1766afc88bc841cbe2a864cd0df689970dce2aa3 Mon Sep 17 00:00:00 2001 From: Sean Madsen <sean@seanmadsen.com> Date: Wed, 25 Jan 2017 17:54:45 -0700 Subject: [PATCH] markdownrules - cleaning up list syntax --- docs/markdownrules.md | 96 +++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/docs/markdownrules.md b/docs/markdownrules.md index 8fec285e..9d1a0a7e 100644 --- a/docs/markdownrules.md +++ b/docs/markdownrules.md @@ -3,12 +3,12 @@ Learning [Markdown](https://en.wikipedia.org/wiki/Markdown) language is useful for: -- Writing CiviCRM [extensions](extend) -- In order for your extension to be +* Writing CiviCRM [extensions](extend) -- In order for your extension to be compliant, you must provide extension documentation, written in markdown. -- Writing other *.md* files that display on [GitHub] -- Contributing to CiviCRM [documentation](documentation) -- Chatting on [Mattermost](http://chat.civicrm.org) -- Q&A on [Stack Exchange](http://civicrm.stackexchange.com) +* Writing other *.md* files that display on [GitHub] +* Contributing to CiviCRM [documentation](documentation) +* Chatting on [Mattermost](http://chat.civicrm.org) +* Q&A on [Stack Exchange](http://civicrm.stackexchange.com) [GitHub]: https://github.com @@ -30,11 +30,11 @@ To maintain some consistency and peace of mind for documentation content editors ## Basics -- `*italics*` -- `**bold**` -- `***bold and italic***` -- `~~strikethrough~~` *(GitHub/Mattermost/StackExchange)* -- `<del>strikethrough</del>` *(mkdocs)* +* `*italics*` +* `**bold**` +* `***bold and italic***` +* `~~strikethrough~~` *(GitHub/Mattermost/StackExchange)* +* `<del>strikethrough</del>` *(mkdocs)* Alternate syntax: Underscores for `_italics_` and `__bold__` also work on most platforms. @@ -42,18 +42,18 @@ platforms. ## Hyperlinks -- A basic hyperlink (in a sentence) +* A basic hyperlink (in a sentence) Try [CiviCRM](https://civicrm.org) for your database. -- An internal hyperlink on mkdocs. The `.md` is optional. +* An internal hyperlink on mkdocs. The `.md` is optional. *Make sure to use an absolute path and precede the path with a slash, as shown below.* [extensions](/extensions/basics) [extensions](/extensions/basics.md) -- With long URLs, the following syntax is better. +* With long URLs, the following syntax is better. See [this issue][CRM-19799] for more details. @@ -152,16 +152,16 @@ markdown_extensions: ### Unordered lists ```md -- My first item is here. -- My second item is here and a +* My first item is here. +* My second item is here and a bit longer than the first. -- Then, a third. +* Then, a third. ``` Alternate syntax: -- Unordered lists also recognize `*` and `+` as item delimiters. -- Markdown is somewhat flexible with the quantity and position of spaces when +* Unordered lists also recognize `-` and `+` as item delimiters. +* Markdown is somewhat flexible with the quantity and position of spaces when making lists, but using 3 spaces after the dash means that sub-lists look nicer in code. @@ -176,7 +176,7 @@ Alternate syntax: Alternate syntax: -- Ordered lists items are automatically re-numbered sequentially upon display +* Ordered lists items are automatically re-numbered sequentially upon display which means all items can begin with `1`, or they can be ordered sequentially in code. @@ -188,12 +188,12 @@ List items must be indented 4 spaces: ```md 1. Item 1. Item - 2. Item -2. Item + 1. Item +1. Item * Item * Item * Item -3. Item +1. Item ``` @@ -243,17 +243,17 @@ A block of **"indented code"** with four spaces at the start of each line: ### Syntax highlighting for code -- For code blocks, most platforms (e.g. mkdocs, GitHub) will guess guess the +* For code blocks, most platforms (e.g. mkdocs, GitHub) will guess guess the language of the code and automatically apply syntax highlighting to the display. -- To force a particular type of syntax highlighting, use fenced code with a +* To force a particular type of syntax highlighting, use fenced code with a keyword (like `javascript` in this case) as follows: ```javascript var cj = CRM.$ = jQuery; ``` -- Available language keywords for forced syntax highlighting differ slightly +* Available language keywords for forced syntax highlighting differ slightly by markdown platform, but here are some common ones: `as`, `atom`, `bas`, `bash`, `boot`, `c`, `c++`, `cake`, `cc`, `cjsx`, `cl2`, `clj`, `cljc`, `cljs`, `cljsc`, `cljs.hl`, `cljx`, `clojure`, @@ -272,9 +272,9 @@ A block of **"indented code"** with four spaces at the start of each line: `scheme`, `scm`, `scpt`, `scss`, `sh`, `sld`, `smalltalk`, `sql`, `st`, `swift`, `tex`, `thor`, `v`, `vb`, `vbnet`, `vbs`, `vbscript`, `veo`, `xhtml`, `xml`, `xsl`, `yaml`, `zsh` -- Syntax highlighting cannot be forced for indented code. -- Syntax highlighting is not available for inline code. -- [Stack Exchange syntax highlighting][stack exchange syntax highlighting] is +* Syntax highlighting cannot be forced for indented code. +* Syntax highlighting is not available for inline code. +* [Stack Exchange syntax highlighting][stack exchange syntax highlighting] is done differently. [stack exchange syntax highlighting]: http://stackoverflow.com/editing-help#syntax-highlighting @@ -285,38 +285,38 @@ You can use **indented code within lists** by keeping a blank line above/below and indenting *4 spaces more than your list content*, like this: ```md -- First item -- Look at this code: +* First item +* Look at this code: CODE BLOCK WITHIN TOP LEVEL LIST ITEM -- More list items -- A nested list is here: +* More list items +* A nested list is here: 1. Alpha - 2. Beta, with some code + 1. Beta, with some code CODE BLOCK WITHIN SUB-LIST ITEM - 3. Gamma + 1. Gamma -- Fun, right? +* Fun, right? ``` **Fenced code within lists** is shown below. It works on GitHub but **not mkdocs**: ````md -- First item -- Look at this code: +* First item +* Look at this code: ```md code block ``` -- More list items +* More list items ```` ## Admonitions @@ -337,9 +337,9 @@ mkdocs**: Other types -- "hint", "important" (visually identical to "tip") -- "attention", "caution" (visually identical to "warning") -- "error" (visually identical to "danger") +* "hint", "important" (visually identical to "tip") +* "attention", "caution" (visually identical to "warning") +* "error" (visually identical to "danger") ### Syntax @@ -387,9 +387,9 @@ or ## Other markdown syntax -- [Tables] (to be avoided when possible) -- [Emojis] (great for Mattermost) -- Blockquotes +* [Tables] (to be avoided when possible) +* [Emojis] (great for Mattermost) +* Blockquotes > This text is a blockquote, typically used > to represent prose written by a person. It @@ -400,10 +400,10 @@ or ## External references -- [Mattermost markdown](https://docs.mattermost.com/help/messaging/formatting-text.html) -- [Stack Exchange markdown](http://stackoverflow.com/editing-help) -- [GitHub markdown](https://help.github.com/categories/writing-on-github/) -- [Official markdown reference](https://daringfireball.net/projects/markdown/syntax) +* [Mattermost markdown](https://docs.mattermost.com/help/messaging/formatting-text.html) +* [Stack Exchange markdown](http://stackoverflow.com/editing-help) +* [GitHub markdown](https://help.github.com/categories/writing-on-github/) +* [Official markdown reference](https://daringfireball.net/projects/markdown/syntax) (though somewhat difficult to read) -- GitLab