Fossil SCM
Fix up the markdown rules to include recent enhancements to fenced code blocks. On "Markup Style:" entry boxes, provide a hyperlink for easy access to the rule sheets.
Commit
18a84ed81edbfb0b4b9a91ff29c8b5a94cf5f204ac8d689f762584c55d8c863e
Parent
c7600da4893b5ea…
2 files changed
+3
-13
+16
-2
+3
-13
| --- src/markdown.md | ||
| +++ src/markdown.md | ||
| @@ -76,35 +76,25 @@ | ||
| 76 | 76 | > > |
| 77 | 77 | > This paragraph is indented |
| 78 | 78 | > > |
| 79 | 79 | > > Double-indented paragraph |
| 80 | 80 | |
| 81 | -## Literal/Verbatim Text ## | |
| 82 | - | |
| 83 | -> There are several ways to write text in Markdown that should be | |
| 84 | -> rendered without any special interpretation. | |
| 81 | +## Literal/Verbatim Text - Code Blocks ## | |
| 85 | 82 | |
| 86 | 83 | > For inline text, you can either use \``backticks`\` or the HTML |
| 87 | 84 | > `<code>` tag. |
| 88 | 85 | > |
| 89 | -> For blocks of text, there are several methods: | |
| 86 | +> For blocks of text or code: | |
| 90 | 87 | > |
| 91 | 88 | > 1. Indent the text using a tab character or at least four spaces. |
| 92 | 89 | > 2. Precede the block with an HTML `<pre>` tag and follow it with `</pre>`. |
| 93 | -> 3. Surround the block in triple backticks (\`\`\`) either at the | |
| 90 | +> 3. Surround the block by \`\`\` (three or more) or \~\~\~ either at the | |
| 94 | 91 | > left margin or indented no more than three spaces. |
| 95 | 92 | |
| 96 | -> Note that unlike in [GitHub-Flavored Markdown][gfm], Fossil does not | |
| 97 | -> currently support any “info string” in [fenced code blocks][gfmf] | |
| 98 | -> after the opening sequence, including language tags | |
| 99 | - | |
| 100 | 93 | > With the standard skins, verbatim text is rendered in a fixed-width font, |
| 101 | 94 | > but that is purely a presentation matter, controlled by the skin’s CSS. |
| 102 | 95 | |
| 103 | -[gfm]: https://github.github.com/gfm/ | |
| 104 | -[gfmf]: https://github.github.com/gfm/#fenced-code-blocks | |
| 105 | - | |
| 106 | 96 | ## Tables ## |
| 107 | 97 | |
| 108 | 98 | > |
| 109 | 99 | | Header 1 | Header 2 | Header 3 | |
| 110 | 100 | ---------------------------------------------- |
| 111 | 101 |
| --- src/markdown.md | |
| +++ src/markdown.md | |
| @@ -76,35 +76,25 @@ | |
| 76 | > > |
| 77 | > This paragraph is indented |
| 78 | > > |
| 79 | > > Double-indented paragraph |
| 80 | |
| 81 | ## Literal/Verbatim Text ## |
| 82 | |
| 83 | > There are several ways to write text in Markdown that should be |
| 84 | > rendered without any special interpretation. |
| 85 | |
| 86 | > For inline text, you can either use \``backticks`\` or the HTML |
| 87 | > `<code>` tag. |
| 88 | > |
| 89 | > For blocks of text, there are several methods: |
| 90 | > |
| 91 | > 1. Indent the text using a tab character or at least four spaces. |
| 92 | > 2. Precede the block with an HTML `<pre>` tag and follow it with `</pre>`. |
| 93 | > 3. Surround the block in triple backticks (\`\`\`) either at the |
| 94 | > left margin or indented no more than three spaces. |
| 95 | |
| 96 | > Note that unlike in [GitHub-Flavored Markdown][gfm], Fossil does not |
| 97 | > currently support any “info string” in [fenced code blocks][gfmf] |
| 98 | > after the opening sequence, including language tags |
| 99 | |
| 100 | > With the standard skins, verbatim text is rendered in a fixed-width font, |
| 101 | > but that is purely a presentation matter, controlled by the skin’s CSS. |
| 102 | |
| 103 | [gfm]: https://github.github.com/gfm/ |
| 104 | [gfmf]: https://github.github.com/gfm/#fenced-code-blocks |
| 105 | |
| 106 | ## Tables ## |
| 107 | |
| 108 | > |
| 109 | | Header 1 | Header 2 | Header 3 | |
| 110 | ---------------------------------------------- |
| 111 |
| --- src/markdown.md | |
| +++ src/markdown.md | |
| @@ -76,35 +76,25 @@ | |
| 76 | > > |
| 77 | > This paragraph is indented |
| 78 | > > |
| 79 | > > Double-indented paragraph |
| 80 | |
| 81 | ## Literal/Verbatim Text - Code Blocks ## |
| 82 | |
| 83 | > For inline text, you can either use \``backticks`\` or the HTML |
| 84 | > `<code>` tag. |
| 85 | > |
| 86 | > For blocks of text or code: |
| 87 | > |
| 88 | > 1. Indent the text using a tab character or at least four spaces. |
| 89 | > 2. Precede the block with an HTML `<pre>` tag and follow it with `</pre>`. |
| 90 | > 3. Surround the block by \`\`\` (three or more) or \~\~\~ either at the |
| 91 | > left margin or indented no more than three spaces. |
| 92 | |
| 93 | > With the standard skins, verbatim text is rendered in a fixed-width font, |
| 94 | > but that is purely a presentation matter, controlled by the skin’s CSS. |
| 95 | |
| 96 | ## Tables ## |
| 97 | |
| 98 | > |
| 99 | | Header 1 | Header 2 | Header 3 | |
| 100 | ---------------------------------------------- |
| 101 |
+16
-2
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -245,10 +245,24 @@ | ||
| 245 | 245 | blob_materialize(&x); |
| 246 | 246 | wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki"); |
| 247 | 247 | blob_reset(&x); |
| 248 | 248 | style_footer(); |
| 249 | 249 | } |
| 250 | + | |
| 251 | +/* | |
| 252 | +** WEBPAGE: markup_help | |
| 253 | +** | |
| 254 | +** Show links to the md_rules and wiki_rules pages. | |
| 255 | +*/ | |
| 256 | +void markup_help_page(void){ | |
| 257 | + style_header("Fossil Markup Styles"); | |
| 258 | + @ <ul> | |
| 259 | + @ <li><p>%z(href("%R/wiki_rules"))Fossil Wiki Formatting Rules</a></p></li> | |
| 260 | + @ <li><p>%z(href("%R/md_rules"))Markdown Formatting Rules</a></p></li> | |
| 261 | + @ </ul> | |
| 262 | + style_footer(); | |
| 263 | +} | |
| 250 | 264 | |
| 251 | 265 | /* |
| 252 | 266 | ** Returns non-zero if moderation is required for wiki changes and wiki |
| 253 | 267 | ** attachments. |
| 254 | 268 | */ |
| @@ -730,11 +744,11 @@ | ||
| 730 | 744 | zPlaceholder = mprintf("Enter notes about tag %s", zPageName+4); |
| 731 | 745 | break; |
| 732 | 746 | } |
| 733 | 747 | } |
| 734 | 748 | form_begin(0, "%R/wikiedit"); |
| 735 | - @ <div>Markup style: | |
| 749 | + @ <div>%z(href("%R/markup_help"))Markup style</a>: | |
| 736 | 750 | mimetype_option_menu(zMimetype); |
| 737 | 751 | @ <br /><textarea name="w" class="wikiedit" cols="80" \ |
| 738 | 752 | @ rows="%d(n)" wrap="virtual" placeholder="%h(zPlaceholder)">\ |
| 739 | 753 | @ %h(zBody)</textarea> |
| 740 | 754 | @ <br /> |
| @@ -812,11 +826,11 @@ | ||
| 812 | 826 | @ <p>Rules for wiki page names:</p> |
| 813 | 827 | well_formed_wiki_name_rules(); |
| 814 | 828 | form_begin(0, "%R/wikinew"); |
| 815 | 829 | @ <p>Name of new wiki page: |
| 816 | 830 | @ <input style="width: 35;" type="text" name="name" value="%h(zName)" /><br /> |
| 817 | - @ Markup style: | |
| 831 | + @ %z(href("%R/markup_help"))Markup style</a>: | |
| 818 | 832 | mimetype_option_menu("text/x-fossil-wiki"); |
| 819 | 833 | @ <br /><input type="submit" value="Create" /> |
| 820 | 834 | @ </p></form> |
| 821 | 835 | if( zName[0] ){ |
| 822 | 836 | @ <p><span class="wikiError"> |
| 823 | 837 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -245,10 +245,24 @@ | |
| 245 | blob_materialize(&x); |
| 246 | wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki"); |
| 247 | blob_reset(&x); |
| 248 | style_footer(); |
| 249 | } |
| 250 | |
| 251 | /* |
| 252 | ** Returns non-zero if moderation is required for wiki changes and wiki |
| 253 | ** attachments. |
| 254 | */ |
| @@ -730,11 +744,11 @@ | |
| 730 | zPlaceholder = mprintf("Enter notes about tag %s", zPageName+4); |
| 731 | break; |
| 732 | } |
| 733 | } |
| 734 | form_begin(0, "%R/wikiedit"); |
| 735 | @ <div>Markup style: |
| 736 | mimetype_option_menu(zMimetype); |
| 737 | @ <br /><textarea name="w" class="wikiedit" cols="80" \ |
| 738 | @ rows="%d(n)" wrap="virtual" placeholder="%h(zPlaceholder)">\ |
| 739 | @ %h(zBody)</textarea> |
| 740 | @ <br /> |
| @@ -812,11 +826,11 @@ | |
| 812 | @ <p>Rules for wiki page names:</p> |
| 813 | well_formed_wiki_name_rules(); |
| 814 | form_begin(0, "%R/wikinew"); |
| 815 | @ <p>Name of new wiki page: |
| 816 | @ <input style="width: 35;" type="text" name="name" value="%h(zName)" /><br /> |
| 817 | @ Markup style: |
| 818 | mimetype_option_menu("text/x-fossil-wiki"); |
| 819 | @ <br /><input type="submit" value="Create" /> |
| 820 | @ </p></form> |
| 821 | if( zName[0] ){ |
| 822 | @ <p><span class="wikiError"> |
| 823 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -245,10 +245,24 @@ | |
| 245 | blob_materialize(&x); |
| 246 | wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki"); |
| 247 | blob_reset(&x); |
| 248 | style_footer(); |
| 249 | } |
| 250 | |
| 251 | /* |
| 252 | ** WEBPAGE: markup_help |
| 253 | ** |
| 254 | ** Show links to the md_rules and wiki_rules pages. |
| 255 | */ |
| 256 | void markup_help_page(void){ |
| 257 | style_header("Fossil Markup Styles"); |
| 258 | @ <ul> |
| 259 | @ <li><p>%z(href("%R/wiki_rules"))Fossil Wiki Formatting Rules</a></p></li> |
| 260 | @ <li><p>%z(href("%R/md_rules"))Markdown Formatting Rules</a></p></li> |
| 261 | @ </ul> |
| 262 | style_footer(); |
| 263 | } |
| 264 | |
| 265 | /* |
| 266 | ** Returns non-zero if moderation is required for wiki changes and wiki |
| 267 | ** attachments. |
| 268 | */ |
| @@ -730,11 +744,11 @@ | |
| 744 | zPlaceholder = mprintf("Enter notes about tag %s", zPageName+4); |
| 745 | break; |
| 746 | } |
| 747 | } |
| 748 | form_begin(0, "%R/wikiedit"); |
| 749 | @ <div>%z(href("%R/markup_help"))Markup style</a>: |
| 750 | mimetype_option_menu(zMimetype); |
| 751 | @ <br /><textarea name="w" class="wikiedit" cols="80" \ |
| 752 | @ rows="%d(n)" wrap="virtual" placeholder="%h(zPlaceholder)">\ |
| 753 | @ %h(zBody)</textarea> |
| 754 | @ <br /> |
| @@ -812,11 +826,11 @@ | |
| 826 | @ <p>Rules for wiki page names:</p> |
| 827 | well_formed_wiki_name_rules(); |
| 828 | form_begin(0, "%R/wikinew"); |
| 829 | @ <p>Name of new wiki page: |
| 830 | @ <input style="width: 35;" type="text" name="name" value="%h(zName)" /><br /> |
| 831 | @ %z(href("%R/markup_help"))Markup style</a>: |
| 832 | mimetype_option_menu("text/x-fossil-wiki"); |
| 833 | @ <br /><input type="submit" value="Create" /> |
| 834 | @ </p></form> |
| 835 | if( zName[0] ){ |
| 836 | @ <p><span class="wikiError"> |
| 837 |