Skip to content
This repository has been archived by the owner on Jan 3, 2018. It is now read-only.

Switching to kramdown #183

Merged
merged 6 commits into from
Dec 3, 2013
Merged

Switching to kramdown #183

merged 6 commits into from
Dec 3, 2013

Conversation

gvwilson
Copy link
Contributor

Jekyll uses Redcarpet by default for translating Markdown to HTML, but Redcarpet doesn't handle Markdown in HTML blocks (like div's). This PR switches to Kramdown, which does handle md-in-html. However, Kramdown translates single and double quotes into curly quotes by default, which confuses downstream tools, so we have to turn that off. While we're there, we also tell it to output character entities as character entities. It also inserts the attribute:

markdown="1"

in certain

blocks in Markdown files to turn on md-in-html processing, and regularizes the section headings in those blocks.

Redcarpet doesn't handle Markdown in HTML blocks (like div's).  This
PR switches to Kramdown, which *does* handle md-in-html.  However,
Kramdown translates single and double quotes into curly quotes by
default, which confuses downstream tools, so we have to turn that off.
While we're there, we also tell it to output character entities as
character entities.
@wking
Copy link
Contributor

wking commented Nov 30, 2013

On Sat, Nov 30, 2013 at 07:13:57AM -0800, Greg Wilson wrote:

Jekyll uses Redcarpet by default for translating Markdown to HTML, but Redcarpet doesn't handle Markdown in HTML blocks (like div's). This PR switches to Kramdown, which does handle md-in-html. However, Kramdown translates single and double quotes into curly quotes by default, which confuses downstream tools, so we have to turn that off. While we're there, we also tell it to output character entities as character entities. It also inserts the attribute:

Commit messages should be a a one-line summary followed by a blank
line followed by the detailed explanation. This makes --online
logging work, avoiding stuff like:

$ git log --oneline origin/pr/183
9a51480 (origin/pr/183) Jekyll uses Redcarpet by default for translating Markdown to HTML, but Redcarpet doesn't handle Markdown in HTML blocks (like div's). This PR switches to Kramdown, which does handle md-in-html. However, Kramdown translates single and double quotes into curly quotes by default, which confuses downstream tools, so we have to turn that off. While we're there, we also tell it to output character entities as character entities.
8716657 Adding section headers inside div blocks in Markdown files
485706c Merge branch 'master' into switching-to-kramdown
c2d2683 (HEAD, origin/master) Adding another rule
5fac724 Starting the bibliography

It also looky like you're pulling in more than just the cramdown
change here:

M _config.yml (5)
M bash/novice/00-intro.md (8)
M bash/novice/01-filedir.md (12)
M bash/novice/02-create.md (12)
M bash/novice/03-pipefilter.md (14)
M bash/novice/04-loop.md (12)
M bash/novice/05-script.md (12)
M bash/novice/06-find.md (12)

Here's the graphical log:

$ git log --graph --topo-order --oneline --decorate origin/pr/183

  • 9a51480 (origin/pr/183) Jekyll uses Redcarpet by default for translating Markdown to HTML, but Redcarpet doesn't handle Markdown in HTML blocks (like div's). This PR switches to Kramdown, which does handle md-in-html. However, Kramdown translates single and double quotes into curly quotes by default, which confuses downstream tools, so we have to turn that off. While we're there, we also tell it to output character entities as character entities.
  • 8716657 Adding section headers inside div blocks in Markdown files
  • 485706c Merge branch 'master' into switching-to-kramdown
    |\
    | * c2d2683 (HEAD, origin/master) Adding another rule
    … …

Was 485706c intentional? Perhaps this PR should just be 9051480 on
top of the current master?

@wking
Copy link
Contributor

wking commented Nov 30, 2013

On Sat, Nov 30, 2013 at 09:18:54AM -0800, W. Trevor King wrote:

On Sat, Nov 30, 2013 at 07:13:57AM -0800, Greg Wilson wrote:

Jekyll uses Redcarpet by default for translating Markdown to HTML,
but Redcarpet doesn't handle Markdown in HTML blocks (like
div's). This PR switches to Kramdown, which does handle
md-in-html. However, Kramdown translates single and double quotes
into curly quotes by default, which confuses downstream tools, so
we have to turn that off. While we're there, we also tell it
to output character entities as character entities. It also
inserts the attribute:

Commit messages should be a a one-line summary followed by a blank
line followed by the detailed explanation.

While it's the top commit in your PR branch, it should be easy to fix
the commit message by checking out the PR branch and running:

$ git commit --amend

After you fix the commit message, you can force-push the fixed commit
from your local PR branch to your public PR branch.

@ahmadia
Copy link
Contributor

ahmadia commented Nov 30, 2013

@gvwilson - The consequences of this change will be that we can no longer rely on gh-pages as a way to automatically build pages from a branch we are tracking (we can still call Jekyll ourselves, translate the MD to HTML, then force-push to gh-pages).

I think everybody knows that I was never a strong proponent of managing our development from gh-pages, but I want to make sure everybody has a moment to consider the consequences of this before we merge in this PR.

The project seems active, I think it's good for us to not rely too heavily on GitHub, and I'd like to continue to separate our document authoring/page generation from our version control repository.

Strong +1 from me.

@gvwilson
Copy link
Contributor Author

Seethe gh-pages branch of https://github.com/gvwilson/trying-kramdown
and the rendered form at
http://gvwilson.github.io/trying-kramdown/page.html --- it looks like
GitHub does run Kramdown for us.

@ahmadia
Copy link
Contributor

ahmadia commented Nov 30, 2013

😮

Awesome, that's new. It looks like this is solving your problem, it's a
major change, and it's early in the development process. I'm +1

On Sat, Nov 30, 2013 at 3:52 PM, Greg Wilson notifications@github.comwrote:

Seethe gh-pages branch of https://github.com/gvwilson/trying-kramdown
and the rendered form at
http://gvwilson.github.io/trying-kramdown/page.html --- it looks like
GitHub does run Kramdown for us.


Reply to this email directly or view it on GitHubhttps://github.com//pull/183#issuecomment-29560787
.

@ahmadia
Copy link
Contributor

ahmadia commented Dec 1, 2013

Anybody else have an opinion on this, or would perhaps like more time to review this before it's merged in?

@gvwilson
Copy link
Contributor Author

gvwilson commented Dec 3, 2013

Can someone with a generic Jekyll install please try this branch on their machine and confirm that using kramdown works out of the box (as well as on GitHub)? cc @drio @r-gaia-cs

@rgaiacs
Copy link

rgaiacs commented Dec 3, 2013

@gvwilson It work out of the box for me.

$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
$ gem -v
2.0.14
$ kramdown -v
1.2.0

Before merge can you update the README.md?

$ grep -n redcarpet README.md 
208:    gem install redcarpet
219:gem install redcarpet

@drio
Copy link
Contributor

drio commented Dec 3, 2013

Works fine for me also:

drio@drds-air:~/dev/swc/bc *(gh-pages)*$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin11.4.2]
drio@drds-air:~/dev/swc/bc *(gh-pages)*$ gem -v
2.0.14
drio@drds-air:~/dev/swc/bc *(gh-pages)*$ kramdown -v
1.0.2

@gvwilson
Copy link
Contributor Author

gvwilson commented Dec 3, 2013

@drio were you able to build the site as well? (I'm worried that just having the tools might miss something...)

@drio
Copy link
Contributor

drio commented Dec 3, 2013

Yes: jekyll build && jekyll serve

gvwilson pushed a commit that referenced this pull request Dec 3, 2013
@gvwilson gvwilson merged commit c1619f0 into swcarpentry:master Dec 3, 2013
@gvwilson gvwilson deleted the switching-to-kramdown branch December 3, 2013 14:46
@dmj111 dmj111 mentioned this pull request Dec 10, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants