Insights

Using Markdown

One of the problems with running any website is how to create and store content that the site needs to display. In most content management systems like WordPress and Umbraco this problem is solved by providing the user with an editor that they can use to enter and format pages and blog posts, and an API that runs on a server that saves posts to display in the website. This works but it isn’t without its problems – a user has to be online to edit a page, they have to use an editor that might not be ideal for their needs rather than something they’re used to using like Word, the editor doesn’t work well if a post needs to be written by more than one person, and there are technical challenges to solve like how to do backups and how to migrate posts if you chose to move to a new website technology.

Markdown is a markup language that solves many of these problems in an elegant way.

What is it?

Markdown is what is known as a markup language – when you write in Markdown you include characters that denote how the text that follows should be displayed. Markdown enables you to use all the formatting elements that you would expect to see – headings, lists, bold and italic text, links, etc, with a straightforward language to mark each section of text with its semantic meaning.

For example, if you want to write a document that includes a title, a paragraph of text, and a list, you would use the ‘#’ for the title, a block of ordinary text for the paragraph, and asterisks to mark each item in the list.

 

Markdown

 

Markdown can also include HTML links, embedded content such as YouTube videos, and more. There is a standard set of features defined by the CommonMark standard, and then ‘flavours’ that extend the base feature set with additional elements that are appropriate for the context that individual flavour is used for. GitHub flavoured Markdown includes code highlighting, task lists, and tables as they’re more useful for GitHub users.

Why use it?

There are many reasons why Markdown is useful. It’s most notable advantage is that you can write Markdown content in any editor that supports entering text, and save it as a file like a document or a spreadsheet. This means you’re not locked in to a content management system or an application. Markdown is a universal language for content.

Being able to create Markdown content in practically any application also means backing up and sharing files is as easy as it would be for anything else. You only need to save your file to the cloud to create a safe offsite backup of it up. There’s never a worry that your content will be lost if your website database ever crashes.

As you can create Markdown content in any editor that supports plain text you can this means you can leverage the power of applications like Google Docs to create content with other people. Being able to write alongside your collaborators in the same document at the same time is immensely powerful. 

Lastly, the final big benefit of using Markdown is the portability of your content. Your content can be used in a website or a blog very easily, but it isn’t limited to just that platform. Markdown has been used to write books, share to social media, and even train machine learning models. Taking your content into new and exciting realms is much easier when it’s been created using a well defined and open standard.

Markdown in websites and content

One of the most common uses for Markdown recently has been to drive the content of websites. Using a ‘static site generator’ you can create a theme using JavaScript code and HTML, and use a generator to render the content stored in Markdown files to create a website that not only loads faster than most traditional WordPress websites but is more secure too. As the content of the website is entirely static HTML files there’s no way for an attacker to compromise the PHP code on the server – there is no PHP code to hack!

The KomodoDigital website has been created using the GatsbyJS static site generator for this very reason! 

Writing with Markdown

If you want to try Markdown you can learn more at https://www.markdownguide.org/, a great free online resource for everything about Markdown.

There are editors that work primarily in Markdown available too – https://macdown.uranusjr.com/ MacDown for OSX and http://markdownpad.com/ MarkdownPad for Windows

If you use Google Docs you can create documents and export them to Markdown using the free  Docs to Markdown extension – https://chrome.google.com/webstore/detail/docs-to-markdown/igffnbdfnodiaphfmfaiiaegmoljbghf

 

 

We help teams across the UK deliver successful digital projects. If you’d like to have a conversation with us, we’ll put the kettle on.

Drop us a line

Insights

Curiosity is what drives us to learn and grow professionally enabling us to remain vigilant to change and the opportunities it presents for our clients. We document some of this learning and share it via our 'Insights' section.