Sep 27, 2015

Markdown and Github Flavored Markdown... another way to embed code in blog

Markdown

MarkDown is a formatting syntax to make highly readable text markup, based largely on plain-text email conventions.

A web writer/viewer is at markable.in.

A subset implementation of MarkDown to render within a webpage with a small (1k) data footprint with Javascript. Add between head tags of Blogger template or other web page.
 
<script >
this.onload = function () {
  document.body.innerHTML = markdown(
    document.body.textContent
  );
};
<script>

Git-Flavored Markdown (GFM)

An extended, widely used version is the one used by github; it provides two things in particular to more easily render code blocks.
  • the triple grave accent to set off code blocks
  • interpreting underscores literally so that variable names will read properly; it substitutes "*" to emphasize strings.
I would like to find a way to include this in blogspot blogs, as code embedding is a multi-step process.

Update (10-12-16)


try: stackit    https://stackedit.io/editor to preformat in text or md.
plus google's prettify  https://github.com/google/code-prettify