21

Is it possible to have Markdown integration for Blogger? How can I do it if possible? Is there some sort of plugin or JavaScript trick that I can use to modify my template to make it support Markdown?

24

You could use StackEdit (I'm the developer). It's a web-based Markdown editor and it allows you to publish your document (Markdown or converted HTML) on different sites. Amongst others, you can post to Blogger.

  • +1. This seems pretty good for streamlining the process of posting to blogger. I've typically been using pandoc to convert a post to HTML and then pasting it into blogger. Nonetheless, the tricky bit comes when you want to edit an existing blogger post. Ideally, it would be as simple as clicking edit on the post and editing the markdown. But StackEdit along with other options don't seem to support this. – Jeromy Anglim Apr 27 '13 at 5:18
  • 1
    You can edit your document and update the post by clicking the "publish" button in the navigation bar (not the one in the menu). If you publish it again with the menu, you will have 2 different posts of the same document, which you can list by clicking "Manage publishing". – benweet Apr 27 '13 at 9:48
  • No longer seems to work due to 400 error. Way back machine link for @GianlucaCasati 's blog post: webapps.stackexchange.com/questions/40737/markdown-for-blogger Now the publish button is under the StackEdit icon in the upper right. – ShawnFeatherly Jan 21 '18 at 20:33
  • 1
    Clicking StackEdit's export to disk and saving as Plain HTML, then pasting that HTML into Blogger works great. – ShawnFeatherly Jan 21 '18 at 21:12
  • @ShawnFeatherly I removed the article and also the comment, thanks for the feedback. – Gianluca Casati Jan 23 '18 at 19:06
2

Where exactly do you want Markdown authoring to be available?

If it's for posts that you write, then the modification would need to be to Blogger's editor, not to your template: even if you write in HTML mode rather than Compose mode, Blogger still validates the HTML before publishing the post.

An alternative for posts would be if you want to publish via mail2Post. In that case, it would be reasonable to look for some on-line service that accepts Markdown-formatted content that you provide, converts it to HTML and then send it to an email address that you provide (your "secret-words" address from Blogger).

Another alternative is Windows Live Writer - but I'm not sure if it would support Markdown. And even if it does, AFAIK once a Blogger post is made with WLW, it can only be edited with WLW and not with Blogger's regular post-editor.

On the other hand, if you want Markdown format to be available for comments, then yes I could imagine some 3rd party commenting systems could be integrated, but I'm not sure what they are - perhaps Disqus (definitely works with Blogger) allows Markdown?

1

I'll rewrite @pajju's answer, because this was the path I chose and I think it works well, although I'll include examples. The source page is this: http://dvdotsenko.blogspot.in/2012/08/markdown-with-blogspotcom-and-bloggercom.html

The basic idea is to write your markdown in HTML mode in a script tag:

<script type="text/x-markdown">
#markdown supported post

even with some `code`:

    > rm -rf /

</script>

Then grab a javascript markdown library and include it in your template's HTML, just before </body>. For example, this: https://code.google.com/p/pagedown/source/browse/Markdown.Converter.js The CDATA tags are necessary or blogger's validator complains.

<script type="text/javascript">//<![CDATA[
... paste markdown js inline here
//]]>
</script> <!-- end markdown -->

I also threw in a link to google's code-prettify, but directly (unlike the method in the above blog):

<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>

Then include a little script to activate everything:

<script type="text/javascript">//<![CDATA[
(function(){
//from the above post  
var scripttags = document.getElementsByTagName('script')
, i, l
, s, d
for (i = 0, l = scripttags.length; i !== l; i++){
    if (scripttags[i].type === 'text/x-markdown') {
        s = scripttags[i]
        d = document.createElement('div')
        d.innerHTML = (new Markdown.Converter()).makeHtml(s.innerHTML)
        s.parentNode.insertBefore(d, s)
    }
}

//a little extra for syntax highlighting
var codetags = document.getElementsByTagName('code')
for (i = 0; i < codetags.length; ++i)
{
    codetags[i].className += ' prettyprint';
}

})()
//]]>
</script>

Debugging by writing a small post and hitting preview with the developer console open was necessary. The custom CSS of the template probably also needs some work to make it look decent.

-3

It is possible, just follow this link. It does work fine.

http://dvdotsenko.blogspot.in/2012/08/markdown-with-blogspotcom-and-bloggercom.html

  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Sathyajith Bhat Apr 17 '13 at 3:11
  • I think you can read. I just tried to help you here, and you down-vote too? Stackoverflow is getting like another troll place, because of people like you. – pajju Apr 18 '13 at 8:47
  • 7
    I didn't downvote you earlier, so here's downvote to prove that. This isn't Stack Overflow, this is Web Applications. It isn't a question of 'reading', if that blog goes down/removed, your so-called answer is worthless. And pointing out what's wrong with this answer and how you can improve it isn't 'trolling', it's called constructive criticism – Sathyajith Bhat Apr 18 '13 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.