From affbd3055303e171e1b90ffb113adcf462ad2bb1 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sat, 22 Jun 2024 21:38:03 -0700 Subject: [PATCH] fix 1992/westley/README.md, warn about TAB intending in markdown.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One must **NOT** use ASCII TAB characters to intent text. Down the TAB-ed road is nothing but trouble! There are _quasi-solutions_, however those have side effects that lead to a different set of problems. The `markdown.md` was updated to ask that text not be intended with ASCII tabs. See [Please do NOT use ASCII tabs to indent text](https://ioccc-src.github.io/temp-test-ioccc/markdown.html#markdown.html#please-do-not-specify-a-language-for-a-code-block). We discovered this awhile ago and fixed it in markdown files. Sorry (tm Canada 🇨🇦), we forgot to mention this this in `markdown.md`. BTW: It took some **deep magic** to be able to show an HTML comment after a starting fenced markdown code block! See the **NO_COMMENT=** line in `bin/md2html.cfg`. :-) TODO: Stamp out indenting TABs in markdown files, especially in code blocks. TODO: Consider a rule to detect problematic ASCII TAB intendation within makrkdown files. --- 1992/westley/README.md | 10 ++++----- 1992/westley/index.html | 10 ++++----- bin/md2html.cfg | 2 ++ markdown.html | 30 ++++++++++++++++++++++++- markdown.md | 50 ++++++++++++++++++++++++++++++++++++++++- 5 files changed, 90 insertions(+), 12 deletions(-) diff --git a/1992/westley/README.md b/1992/westley/README.md index d604c4bda..377103677 100644 --- a/1992/westley/README.md +++ b/1992/westley/README.md @@ -80,19 +80,19 @@ To find the approximate place where this entry was judged, type: ``` ./whereami.sh 37 -122 # NOTE: - means west of meridian - # or if you don't have at least 80 columns and want to see what it - # looks like anyway: + # or if you don't have at least 80 columns and want to see what it + # looks like anyway: ./whereami 37 -122 # NOTE: - means west of meridian ``` If you wish to see this on the US map: ``` - make alt + make alt ./whereami.alt.sh 37 -122 # NOTE: - means west of meridian - # or if you don't have at least 80 columns and want to see what it - # looks like anyway: + # or if you don't have at least 80 columns and want to see what it + # looks like anyway: ./whereami.alt.sh 37 -122 # NOTE: - means west of meridian ``` diff --git a/1992/westley/index.html b/1992/westley/index.html index 46e4214e1..accff0e13 100644 --- a/1992/westley/index.html +++ b/1992/westley/index.html @@ -434,15 +434,15 @@ entry and the alternate code so one can try the same script for both:

To find the approximate place where this entry was judged, type:

    ./whereami.sh 37 -122       # NOTE: - means west of meridian
 
-        # or if you don't have at least 80 columns and want to see what it
-        # looks like anyway:
+    # or if you don't have at least 80 columns and want to see what it
+    # looks like anyway:
     ./whereami 37 -122  # NOTE: - means west of meridian

If you wish to see this on the US map:

-
        make alt
+
    make alt
     ./whereami.alt.sh 37 -122   # NOTE: - means west of meridian
 
-        # or if you don't have at least 80 columns and want to see what it
-        # looks like anyway:
+    # or if you don't have at least 80 columns and want to see what it
+    # looks like anyway:
     ./whereami.alt.sh 37 -122   # NOTE: - means west of meridian

Author’s remarks:

Run the program with your latitude & longitude as integer diff --git a/bin/md2html.cfg b/bin/md2html.cfg index ceb7aba71..cc734b4b2 100644 --- a/bin/md2html.cfg +++ b/bin/md2html.cfg @@ -288,6 +288,8 @@ markdown.md KEYWORDS=IOCCC, markdown -s HEADER_2=IOCCC markdown guidelines + -s + NO_COMMENT= -D ./ diff --git a/markdown.html b/markdown.html index f70ba3458..4c4174db0 100644 --- a/markdown.html +++ b/markdown.html @@ -438,7 +438,7 @@ for the given page URL.

```
 This code block is NOT indented                                 <=== no thank you
 ```
-

We request that you indent the code block by 4 spaces:

+

We request that you indent the code block by 4 ASCII spaces

```
     This code block
     is indented 4 spaces
@@ -454,6 +454,34 @@ those used in next/rules.md and in next/guidelines.md.
 |       please_do_not_submit_this();
     }
 ```
+

Please do NOT use ASCII tabs to indent text

+

When indenting a code block in markdown, indent 4 ASCII spaces per level. +If you need to indent 2 or more levels, use multiples of 4 ASCII spaces. +Please do NOT intend with ASCII tabs!

+

For example:

+
```
+        Please do **NOT** indent with ASCII tabs.               <=== no thank you
+
+    The top level starts with a 4 ASCII space indent.
+
+    Only indend with multiples of 4 ASCII spaces.
+        2nd level indent needs 8 ASCII spaces (no tabs).
+            3rd level indent needs 12 ASCII spaces (no tabs).
+                etc.
+```
+

Please do NOT specify a language for a code block

+

We request that (fenced) markdown code blocks NOT specify a language.

+

For example:

+
```c                                                            <=== no thank you
+    int main(void) {return 0;}
+```
+

Instead, put the language inside an HTML comment, separated from the +markdown code block starting fence by a space:

+
``` <!---c-->
+    int main(void) {return 0;}
+```
+

IMPORTANT: The initial   ` ` `   must be followed by an ASCII space, +then by an opening <!---, then by the language, then by a closing -->.

Please do NOT add trailing slash to HTML elements

Please do NOT use a trailing slash on void HTML elements.

diff --git a/markdown.md b/markdown.md index f52a6e759..d174d9a35 100644 --- a/markdown.md +++ b/markdown.md @@ -124,7 +124,7 @@ This code block is NOT indented <=== no thank you ```` -We request that you indent the code block by 4 spaces: +We request that you indent the code block by 4 ASCII spaces ```` ``` @@ -151,6 +151,54 @@ For example, `next/guidelines.md` uses this markdown code block: ```` +## Please do NOT use ASCII tabs to indent text + +When indenting a code block in markdown, indent 4 ASCII spaces per level. +If you need to indent 2 or more levels, use multiples of 4 ASCII spaces. +Please do **NOT** intend with ASCII tabs! + +For example: + +```` +``` + Please do **NOT** indent with ASCII tabs. <=== no thank you + + The top level starts with a 4 ASCII space indent. + + Only indend with multiples of 4 ASCII spaces. + 2nd level indent needs 8 ASCII spaces (no tabs). + 3rd level indent needs 12 ASCII spaces (no tabs). + etc. +``` +```` + + +## Please do NOT specify a language for a code block + +We request that (fenced) markdown code blocks **NOT** specify a language. + +For example: + +```` +```c <=== no thank you + int main(void) {return 0;} +``` +```` + +Instead, put the language inside an HTML comment, separated from the +markdown code block starting fence by a space: + +```` +``` <%%NO_COMMENT%%!---c--> + int main(void) {return 0;} +``` +```` + +**IMPORTANT**: The **initial**   **\` \` \`**   must be followed by an **`ASCII space`**, +then by an **opening** **``**. + + + ## Please do NOT add trailing slash to HTML elements Please do **NOT** use a trailing slash on [void HTML