Skip to content

The tool helps to convert the particular types of HTML entities in the markdown documents to Kramdown.

Notifications You must be signed in to change notification settings

dshevtsov/html-to-kramdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The tool helps to convert to Kramdown the particular types of HTML elements in .md files.

Usage

bin/html-to-kramdown PATH --option

If PATH is a directory, the tool reads all the .md files recursively.

Available options

  • --images
  • --headings
  • --links
  • --tables
  • --notes - converts notes like <div class="bs-callout bs-callout-xxx" ... >...</div> to Kramdown and adds the markdown="1" argument if it is not there. Same as --notes_html + --notes_wih_md.
  • --notes_html - converts HTML content in the notes of format <div class="bs-callout bs-callout-xxx" ... >...</div> and adds the markdown="1" argument.
  • --notes_wih_md - converts mixed content in the notes of format <div class="bs-callout bs-callout-xxx" markdown="1">...</div>

Cution: If the note is already in the valid Kramdown format and doesn't contain HTML, the tool still converts it and can break the valid formatting.

Example

bin/html-to-kramdown /Users/dshevtsov/projects/devdocs/ --images

Requirements

$ gem install kramdown

Precautions

Note, that the Kramdown parser doesn't recognize Kramdown elements inside HTML blocks by default. To make it work, provide additional parameter to enable Kramdown parsing within HTML: markdown="1", or markdown="span", or markdown="block"

Breaking example:

<ul>
  <li>[text](../link.html)</li>
</ul>

Working examnple:

<ul>
  <li markdown="span">[text](../link.html)</li>
</ul>

About

The tool helps to convert the particular types of HTML entities in the markdown documents to Kramdown.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages