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.

drh 2019-08-09 16:37 trunk
Commit 18a84ed81edbfb0b4b9a91ff29c8b5a94cf5f204ac8d689f762584c55d8c863e
2 files changed +3 -13 +16 -2
+3 -13
--- src/markdown.md
+++ src/markdown.md
@@ -76,35 +76,25 @@
7676
> >
7777
> This paragraph is indented
7878
> >
7979
> > Double-indented paragraph
8080
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 ##
8582
8683
> For inline text, you can either use \``backticks`\` or the HTML
8784
> `<code>` tag.
8885
>
89
-> For blocks of text, there are several methods:
86
+> For blocks of text or code:
9087
>
9188
> 1. Indent the text using a tab character or at least four spaces.
9289
> 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
9491
> left margin or indented no more than three spaces.
9592
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
-
10093
> With the standard skins, verbatim text is rendered in a fixed-width font,
10194
> but that is purely a presentation matter, controlled by the skin’s CSS.
10295
103
-[gfm]: https://github.github.com/gfm/
104
-[gfmf]: https://github.github.com/gfm/#fenced-code-blocks
105
-
10696
## Tables ##
10797
10898
>
10999
| Header 1 | Header 2 | Header 3 |
110100
----------------------------------------------
111101
--- 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 @@
245245
blob_materialize(&x);
246246
wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki");
247247
blob_reset(&x);
248248
style_footer();
249249
}
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
+}
250264
251265
/*
252266
** Returns non-zero if moderation is required for wiki changes and wiki
253267
** attachments.
254268
*/
@@ -730,11 +744,11 @@
730744
zPlaceholder = mprintf("Enter notes about tag %s", zPageName+4);
731745
break;
732746
}
733747
}
734748
form_begin(0, "%R/wikiedit");
735
- @ <div>Markup style:
749
+ @ <div>%z(href("%R/markup_help"))Markup style</a>:
736750
mimetype_option_menu(zMimetype);
737751
@ <br /><textarea name="w" class="wikiedit" cols="80" \
738752
@ rows="%d(n)" wrap="virtual" placeholder="%h(zPlaceholder)">\
739753
@ %h(zBody)</textarea>
740754
@ <br />
@@ -812,11 +826,11 @@
812826
@ <p>Rules for wiki page names:</p>
813827
well_formed_wiki_name_rules();
814828
form_begin(0, "%R/wikinew");
815829
@ <p>Name of new wiki page:
816830
@ <input style="width: 35;" type="text" name="name" value="%h(zName)" /><br />
817
- @ Markup style:
831
+ @ %z(href("%R/markup_help"))Markup style</a>:
818832
mimetype_option_menu("text/x-fossil-wiki");
819833
@ <br /><input type="submit" value="Create" />
820834
@ </p></form>
821835
if( zName[0] ){
822836
@ <p><span class="wikiError">
823837
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button