Skip to content

Improve GitHub Flavored Markdown Docs#8684

Merged
jekyllbot merged 1 commit intojekyll:masterfrom
mkasberg:update-gfm-docs
Jul 22, 2021
Merged

Improve GitHub Flavored Markdown Docs#8684
jekyllbot merged 1 commit intojekyll:masterfrom
mkasberg:update-gfm-docs

Conversation

@mkasberg
Copy link
Copy Markdown
Contributor

This is a 🔦 documentation change.

Summary

I recently merged #8681 to improve the Jekyll docs for markdown options.
While researching that, I noted that the kramdown-parser-gfm gem is
required by default in Jekyll, but I didn't dig further as to why.

After #8681 merged, I was curious about why kramdown-parser-gfm is
required by default, and I followed up on digging into it. As it turns
out, this GFM parser is required by default because Jekyll uses GFM by
default. This is clear from the default config
docs
and the code:

"kramdown" => {
"auto_ids" => true,
"toc_levels" => (1..6).to_a,
"entity_output" => "as_char",
"smart_quotes" => "lsquo,rsquo,ldquo,rdquo",
"input" => "GFM",

Although this is outlined in the default configuration docs, other parts
of the docs don't do a good job making it clear that GFM is actually the
default behavior. My recent docs change in #8681 made this problem worse
since I used a bunch of config in my examples that's actually just
default config.

In this PR, I'm addressing that problem by modifying my update to the
Markdown Options docs to clearly note that GFM is the default parser.
I'm also updating a tutorial that implied GFM isn't the default. I've
searched this repo for "GFM" and I'm pretty confident I've found all the
problematic docs.

Context

This follows up on #8681, which was originally created in response to #8593.

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 19, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • availalbe
To accept these unrecognized words as correct, run the following commands

... in a clone of the git@github.com:mkasberg/jekyll.git repository
on the update-gfm-docs branch:

update_files() {
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/jekyll/jekyll/issues/comments/843667922" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  
update_files
rm $comment_body
git add -u
If you see a bunch of garbage

If it relates to a ...

well-formed pattern

See if there's a pattern that would match it.

If not, try writing one and adding it to the patterns.txt file.

Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

Note that patterns can't match multiline strings.

binary-ish string

Please add a file path to the excludes.txt file instead of just accepting the garbage.

File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 19, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • availabe
To accept these unrecognized words as correct, run the following commands

... in a clone of the git@github.com:mkasberg/jekyll.git repository
on the update-gfm-docs branch:

update_files() {
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/jekyll/jekyll/issues/comments/843668184" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  
update_files
rm $comment_body
git add -u
If you see a bunch of garbage

If it relates to a ...

well-formed pattern

See if there's a pattern that would match it.

If not, try writing one and adding it to the patterns.txt file.

Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

Note that patterns can't match multiline strings.

binary-ish string

Please add a file path to the excludes.txt file instead of just accepting the garbage.

File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

I recently merged jekyll#8681 to improve the Jekyll docs for markdown options.
While researching that, I noted that the `kramdown-parser-gfm` gem is
required by default in Jekyll, but I didn't dig further as to why.

After jekyll#8681 merged, I was curious about why `kramdown-parser-gfm` is
required by default, and I followed up on digging into it. As it turns
out, this GFM parser is required by default because Jekyll uses GFM by
default. This is clear from the [default config
docs](https://jekyllrb.com/docs/configuration/default/) and the code:

https://github.com/jekyll/jekyll/blob/76517175e700d80706c9139989053f1c53d9b956/lib/jekyll/configuration.rb#L67-L72

Although this is outlined in the default configuration docs, other parts
of the docs don't do a good job making it clear that GFM is actually the
default behavior. My recent docs change in jekyll#8681 made this problem worse
since I used a bunch of config in my examples that's actually just
default config.

In this PR, I'm addressing that problem by modifying my update to the
Markdown Options docs to clearly note that GFM is the default parser.
I'm also updating a tutorial that implied GFM isn't the default. I've
searched this repo for "GFM" and I'm pretty confident I've found all the
problematic docs.
Copy link
Copy Markdown
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mkasberg 🙏

@DirtyF
Copy link
Copy Markdown
Member

DirtyF commented Jul 22, 2021

@jekyll: merge +docs

@jekyllbot jekyllbot merged commit 0eb9239 into jekyll:master Jul 22, 2021
jekyllbot added a commit that referenced this pull request Jul 22, 2021
github-actions bot pushed a commit that referenced this pull request Jul 22, 2021
Mike Kasberg: Improve GitHub Flavored Markdown Docs (#8684)

Merge pull request 8684
@mkasberg mkasberg deleted the update-gfm-docs branch July 23, 2021 14:09
@jekyll jekyll locked and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants