New Bric: Markdown Parser


#1

Ever wanted to have the possibility to write markdown inside Blocs and have this automatically parsed to HTML?

First of all: What is Markdown all about? Markdown is a lightweight markup language with plain text formatting syntax. You are also able to use Markdown here in this discourse forum btw.

I have created a Markdown Parser bric for Blocs, which will convert paragraphs with Markdown text to HTML on the fly (by use of JavaScript, no PHP required).

For more information, see:


Blocs, brics and .... premade html widgets
#2

This is really cool. Great new Bric addition.


#3

This Bric is a must have, by using Markdown you can really cleanup your pages and reduce the number of bric that are needed. No more multiple paragraph bric, just use Markdown! This was the last remaining bric I was missing from the RW world, now that this is available I’m set in Blocs!

Thanks so much for making this bric available it works really well and for us Markdown writers it will be a godsend as now I only have to write the content once in Markdown and I can use it in multiple places.

The only future feature request I would have for this useful bric is the ability to import the markdown text from a file, but given how it currently works in conjunction with the standard paragraph bric I imagine this would be hard to achieve. Thought I would mention it anyway!

Everyone needs this Bric, best money I have spent in awhile!


#4

Thanks a lot for your purchase.

I just released v1.0.1 with an update, where you are able to mix markdown markup with paragraph HTML, which is good for using special syntax like opening links in new windows.

All updates are currently available with redownload from my.paddle.com

A future update of Blocs will also contain an inbuilt Bric updater :smiley:


#5

Thanks for this idea. I wanted to keep it simple for the start.

I am sure I will be able to add this functionality in this product as an additional Bric. I have to figure out if this can be done completely without PHP (for simplicity reasons on end user side).

Cheers!


#6

@InStacks OK, I think I have uncovered a problem with this bric, although it could be that I’m causing the problem.

My project is styled with the default paragraph text a BLACK color, but there are a number of places with dark backgrounds where I add an override of the color to WHITE. When I convert these paragraphs to use the Markdown parser the text is converted to the DEFAULT color and not the overridden WHITE color. The only way I can get the color to stay WHITE is if I delete the blocsaddons-markdown class that was added to the paragraph.

Is there something I’m doing wrong?


#7

This should be fixed in version 1.0.1

Please redownload the bric from https://my.paddle.com, delete the old version from page and bric library, reinstall new version, restart blocs, add a new markdown parser to the page, check that version is 1.0.1, test again.

Looking forward to the inbuilt bric updater.


#8

I hear you on the Brics updater, bit of a pain right now doing updates.

I am currently using the 1.0.1 version and that is showing this same problem with the font color. I have tested this in both the latest BETA and the current stable version.


#9

Custom colors are working for me, so I guess it’s the update process. Let clarify this “offline” in a private conversation. Thanks : - )


#10

But do they work if you change the PARAGRAPH color in the project settings, that appears to be what is causing my problems?


#11

Please send me a screenshot, as I don’t know how to replicate that, best directly on info@blocsaddons.com.

I addition please publish your example to a website so that I can double check.

Thanks!


#12

Does it require to export to see or can be preview?


#13

I am not able to inspect your preview page on your Mac. You could also export your website and send me the export as zip as direct message, or email: https://blocsaddons.com/contact/


#14

I’ve never used markdown previously on a website and didn’t give this much thought when it first appeared, but starting to realise how useful this could be. Am I right in thinking a new paragraph is created using markdown by simply hitting the enter key and that this will be read correctly as a new paragraph rather than a break?

Learning the correct syntax shouldn’t be that hard, however I found a few markdown editors yesterday like this one online that allow you to edit the text, rather like the formatting commands on his forum.

Using a markdown editor, it should be possible to create big chunks of contents like long lists or big areas of text and simply paste the contents to a single paragraph bric. This would be a time saver and presumably keep the website very light.

There do not appear to be options that allow for the fine control of text sizing or images that is possible using custom classes in Blocs, however we could pick and choose as required. My only slight concern is how markdown might impact Seo.


#15

Depends. A new line is a br tag. 2 new lines (so one empty line in between) is a new p tag.

I don’t get why this should impact SEO. You are able to define H1 - H6 headers also in markdown. That’s the only thing I see what’s relevant to SEO.


#16

It was just a query really if search engines treat markup with the same weight and understanding as typical html created by Blocs.

That’s excellent on the paragraph spacing using markup. I have a website done in Rapidweaver with a long summary list of book chapters, where each chapter is in a separate paragraph stack. It should really be a paragraph for each line, but it already takes over 20 seconds to preview the page. Being able to do that correctly and fast in Blocs would be fantastic.


#17

Search engines execute JavaScript, so they also see the HTML generated output.

We are not there yet that Blocs is able to use a PHP Markdown parser, which generates the HTML on the server. When that’s possible, I will include this also in the Markdown Parser Bric.


#18

This is exactly what I use this bric for, as I can create large blocks of text without the need to create a bric for each paragraph. For me this is really useful because I’m moving a site from Rapidweaver to Blocs and on Rapidweaver I use Scribe for the exact same reason, so I can simply copy the markdown text and paste it into Blocs, very handy!

I write all my markdown text in Macdown, which is a very handy app for previewing what you are writing. I also use it to write all of the blog entries fro my blog.

You can also do inline images with markdown, but you have little control over them. In Scribe there are child stacks that allow you to format images that are placed inline.


#19

I am aware of Scribe, but never used it to date. I’ve basically given up on RW these days and focussed on Blocs for development. I’ll take a look at Macdown.


#20

Yes, I’m heading in that direction myself, trying to move to Blocs exclusively, not there yet though but getting closer.