Kramdown



Kramdown has two main classes of elements: block and span-level elements. Block-level elements are used to create paragraphs, headers, lists and so on whereas span-level elements are used to markup text phrases as emphasized, as a link and so on. From Pandoc to Kramdown and Github-Flavored Markdown (GFM), extra syntaxes abound. There’s very little standardization, except for some consensus towards CommonMark and the gravitational pull of very popular libraries and processors.

Description

kramdown is primarily used for parsing a superset of Markdown and converting it to different output formats. It supports standard Markdown (with some minor modifications) and various extensions like tables and definition lists. Due to its modular architecture it also allows other input formats than Markdown, for example, HTML or Github Flavored Markdown.

If FILE is not specified, kramdown reads from the standard input. The result is written to the standard output.

  • I added gem 'kramdown-parser-gfm' to the Gemfile and then ran bundle install. Now the serve command completes successfully. Follow edited Oct 28 '20 at 16:10. 36.8k 18 18 gold badges 203 203 silver badges 217 217 bronze badges. Answered Aug 11 '20 at 20:32.
  • Available input formats: kramdown (this is the default) or html.o,-output ARG Specify one or more output formats separated by commas: html (default), kramdown, latex or removehtmltags.v,-version Show the version of kramdown.h,-help Show the help. KRAMDOWN OPTIONS.

There are two sets of options that kramdown accepts: The first one includes the options that are used directly by the kramdown binary. The second set of options controls how kramdown parses and converts its input.

Default values for this second set can be set using YAML via the configuration file kramdownrc. Note that configuration option names use underscores, not dashes (dashes are just used in the CLI options names), and boolean options do not have a no variant but a value of true or false. This file has to be in XDG_CONFIG_HOME on Linux/Unix, ~/Library/Preferences on macOS and ~/AppData/Local on Windows.

A few things have changed in Jekyll 4.

Before we dive in, you need to have at least Ruby 2.4.0installed.

Run the following in your terminal to check

If you’re using a supported Ruby version >= 2.4.0, go aheadand fetch the latest version of Jekyll:

post_url Tag and Baseurl

The post_url tag now incorporates the relative_url filter within itself and therefore automatically prepends your site's baseurl to the post's url value.

Please ensure that you change all instances of the post_url usage as following:

Template rendering

We’ve slightly altered the way Jekyll parses and renders your various templatesto improve the overall build times. Jekyll now parses a template once, caches itinternally and then renders the parsed template multiple times as required byyour pages and documents.

The downside to this is that some of the community-authored plugins may not workas they previously used to.

Static files in unrendered collections

Collections other than posts can contain static assets along with Markdown files.But if the collection has not been configured with metadata output: true, thenneither its documents nor its static assets will be output to the destinationdirectory.

For plugin authors

  • If your plugin depends on the following code: site.liquid_renderer.file(path).parse(content),note that the return value (template, an instance of Liquid::Template), from that line willalways be the same object for a given path.
    The template instance is then rendered as previously, with respect to the payload passed to it.You’ll therefore have to ensure that payload is not memoized or cached in your plugin instance.

  • If its a requirement that template you get from the above step be different at all times,you can invoke Liquid::Template directly:

Kramdown mathjax

Exclusion changes

We’ve enhanced our default exclusion array.It now looks like the following:

What’s new is that this array does not get overridden by the exclude arrayin the user’s config file anymore. The user’s exclude entries simply getadded to the above default array (if the entry isn’t already excluded).

To forcibly “process” directories or files that have been excluded, list themin the include array instead:

The above configuration directs Jekyll to handle onlynode_modules/uglifier/index.js while ignoring every other file in thenode_modules directory since that directory is “excluded” by default.

Note that the default include array still gets overridden by the includearray in your config file. So, be sure to add .htaccess to the list if youneed that file to be present in the generated site.

Kramdown Table

Kramdown v2

Jekyll has dropped support for kramdown-1.x entirely.

From v2.0 onwardskramdown requires specific extensions to be additionally installed to usecertain features are desired outside of kramdown’s core functionality.

Out of all the extensions listed in the report linked above, gemkramdown-parser-gfm is automatically installed along with Jekyll 4.0. Theremaining extensions will have to be manually installed by the user depending ondesired functionality, by listing the extension’s gem-name in their Gemfile.

Notes:

  • kramdown-converter-pdf will be ignored by Jekyll Core. To have Jekyll convert Markdown to PDFyou’ll have to depend on a plugin that subclasses Jekyll::Converter with therequired methods.

    For example:

  • Vendors that provide a versioned Jekyll Environment Image (e.g. Docker Image, GitHub Pages, etc)will have to manually whitelist kramdown’s extension gems in their distributions for Jekyll 4.0.

Deprecated Configuration Options

Kramdown Latex

Jekyll 4.0 has dropped support for all legacy configuration options that were deprecated over multiplereleases in the previous series.

Kramdown Syntax

To that end, we shall no longer output a deprecation warning when we encounter a legacy config key norshall we gracefully assign their values to the newer counterparts. Depending on the key, it shall eitherbe ignored or raise an InvalidConfigurationError error if the key is still valid but the associatedvalue is not of the valid type.