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

use kramdown renderer instead of redcarpet #568

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ltankey
Copy link
Contributor

@ltankey ltankey commented Nov 3, 2016

This PR uses Kramdown instead of RedCarpet as the markdown renderer.

This gives authors the ability to use definition lists.

Due to the way that Kramdown compiles its documents, table-of-contents are refactored out as a separate explicit template specification, and are instead compiled as part of the content itself. An inline specification is used to inject the TOC at the head of the document's contents.

Note: various content-tests have been refactored to suit the kramdown markdown syntax for headings, which requires that a heading is preceded by a blank line.

# @toc_depth indicates the range of the TOC which defaults to rendering
# nothing.
# http://kramdown.gettalong.org/converter/html.html#toc
toc_header = "* TOC\n{:toc}\n\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

A small thing but maybe worth setting this as a constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

@@ -1,8 +1,11 @@
-# DEPRECATED - TOC is generated as part of content
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove entirely now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - will be in our commit history if we ever want something similar to this.

Copy link
Contributor

@coderdan coderdan left a comment

Choose a reason for hiding this comment

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

Is it worth adding/updating specs for the node decorator and the markdown renderer?

@@ -0,0 +1,89 @@
module Kramdown
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this all boilerplate or so I need to review?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The nav_wrapped method is the only thing that isn't boilerplate.

@ltankey
Copy link
Contributor Author

ltankey commented Nov 3, 2016

Fair question - the specs have been updated to work with these changes, but the output hasn't changed.

I could add some additional tests for the node_decorator however there is no specs for the markdown renderer service, which might be worth adding.

@coderdan
Copy link
Contributor

coderdan commented Nov 3, 2016

Yeah up to you but I think the specs for the markdown renderer would be a good improvement.

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.

None yet

2 participants