Advertising
Advertising

Use Markdown For Easy Web Writing

Use Markdown For Easy Web Writing

    In listening to a bunch of Mac-centric podcasts lately, especially on workflows with the Mac, I have come across a tool that has been around for a while but is still not extremely popular with everyone. The tool is called Markdown and was created by John Gruber (Daring Fireball fame). The best way to explain it is the first paragraph from Markdown’s description on Mr. Gruber’s page:

    Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

    Yeah that is it in a nutshell. Before I jump in how to use this awesome tool on Mac and Windows, you may be wondering what the point of a tool like this actually is.

    What’s the point?

    At first I didn’t get the reason for using Markdown. Cool, you can transfer plain text stuff into HTML, but who the hell uses HTML anymore? Well, if you are a web writer you use HTML every single day whether you know it or not and if you have used WordPress or any other CMS for any length of time you have most likely had to tweak some HTML.

    If you are using WordPress there is nothing more agrevating than the WYSIWYG editor becoming too helpful with HTML tags in the background essentially destorying your formatting. Markdown can help you by transforming your text file into valid HTML. This allows you to paste your HTML into the HTML editor thus keeping your hard-won formatting. So nice.

    Advertising

    Also, there is something to say for document portability. HTML is an agnostic type of document markup and can be rendered in pretty much any crappy web browser. With the continued use of many different operating systems and devices out in the wild (iOS, Android, Blackberry, Windows, Mac, Linux, etc) the need for a standard format for text is highly needed. Markdown helps this along by allowing you to standardized all your note formatting without locking you in to some proprietary format. Just HTML and txt files.

    Let’s use it, shall we?

    Markdown is pretty darn easy to use and if you have any experience messing aroudn with software and HTML it will be a snap. Markdown is written in Perl, so if you don’t have Perl on your Windows machine you can download and install Strawberry Perl from here. If you are a Mac user, Perl is already installed for you.

    Next, go over to Daring Fireball and grab the Markdown.pl script, unzip it and put the Markdown.pl file in the directory that you will use to create and tranform your input text files.

    Now the fun part; learning how to use the syntax and creating your input text file.

    Markdown syntax

    I am going to briefly explain some of the most used syntax snippets that will get you off an running with Markdown. If you want the whole shebang, head on over to Daring Fireball to get a detailed list of all the niceties of the Markdown syntax.

    Headers

    Headers tags (h1, h2, h3, etc) are simple to create in your text document. To signify the h1 tag, “underline” the text with the ‘=’ sign:

    Advertising

    This is a h1 header
    ===================
    

    or for h2 use the ‘-‘ character:

    This is a h2 header
    -------------------
    

    You don’t need to put the same amount of ‘=’ or ‘-‘ characters under the heading; any number will due to produce the header tags.

    Bullets and lists

    I think in bullets and lists so it’s nice that Markdown handles them well. To insert a bullet append an asterisk to your line like this:

    * This is my point
    

    You can also use the ‘+’ or ‘-‘ characters as bullets.

    Ordered lists are easy too:

    1. Number one
    2. Number two
    3. Number three... now you got it!
    

    If you want multiple paragraphs under a bullet or number just indent the first line of each paragraph or indent all the lines if you want it to look nicer:

    Advertising

    1. Here is the first point that I am trying to make about numbered lists.
    
       By the way, I should probably mention this too.
    
    2. Next point
    

    Links

    One of my favorite things of Markdown is the easy way to insert links. First, bracket the word or phrase that you would like to be “clickable” and then follow that by a parenthesized URL:

    [click here](http://www.google.com/)
    

    Outputting to HTML

    After you have created your text file it is now time to pass it to the Markdown.pl script to produce your HTML output. If you didn’t create a text file to test, you can download the quick text file that I created to try it out.

    Place your text file in the same directory as the Markdown.pl script (you can pass the arguments with the correct path if you want to, this is just to make it easier). After that is done open up your command prompt in Windows or your terminal on your Mac or Linux and navigate to the folder with your input file.

    To create the output directly in the terminal window use the following command:

    perl Markdown.pl input.txt

    This will then parse the text file and output the valid HTML markup to the terminal. If you want the ouput to be directed towards a totally seperate HTML file type the following command:

    Advertising

    perl Markdown.pl input.txt > output.html

    This will create the HTML file output.html in whatever directory you are currently in.

    Wrapping it up

    Let me just say that if you think Markdown is interesting and understand the utility of it, I highly suggest that if you write anything you should write it with Markdow

    n syntax. It is cross-platform, open source, free, and compatible with everything. To me it is a game changer and I feel like I am a little behind in not utilizing it sooner. Once again, there is much more to the syntax than I have highlighted here, so check out Daring Fireball for more.

    By the way, I wrote this entire article using Markdown and if you want to see the syntax you can download it here.

    More by this author

    CM Smith

    A technologist and writer who shares advice on personal productivity, creativity and how to use technology to get things done.

    5 Project Management Tools to Get Your Team on Track To Automate or not to Automate Your Personal Productivity System How to Beat Procrastination: 29 Simple Tweaks to Make Design Is Important: How To Fail At Blogging 7 Tools to Help Keep Track of Goals and Habits Effectively 6 Unexpected Ways Journaling Every Day Will Make Your Life Better

    Trending in Productivity

    1 How to Increase Willpower and Be Mentally Tough 2 How to Influence People and Make Them Feel Good 3 How to Be a Good Leader and Lead Effectively in Any Situation 4 Does the Pomodoro Technique Work for Your Productivity? 5 A Stress-Free Way To Prioritizing Tasks And Ending Busyness

    Read Next

    Advertising
    Advertising
    Advertising

    Last Updated on March 23, 2021

    Manage Your Energy so You Can Manage Your Time

    Manage Your Energy so You Can Manage Your Time

    One of the greatest ironies of this age is that while various gadgets like smartphones and netbooks allow you to multitask, it seems that you never manage to get things done. You are caught in the busyness trap. There’s just too much work to do in one day that sometimes you end up exhausted with half-finished tasks.

    The problem lies in how to keep our energy level high to ensure that you finish at least one of your most important tasks for the day. There’s just not enough hours in a day and it’s not possible to be productive the whole time.

    You need more than time management. You need energy management

    1. Dispel the idea that you need to be a “morning person” to be productive

    How many times have you heard (or read) this advice – wake up early so that you can do all the tasks at hand. There’s nothing wrong with that advice. It’s actually reeks of good common sense – start early, finish early. The thing is that technique alone won’t work with everyone. Especially not with people who are not morning larks.

    Advertising

    I should know because I was once deluded with the idea that I will be more productive if I get out of bed by 6 a.m. Like most of you Lifehackers, I’m always on the lookout for productivity hacks because I have a lot of things in my plate. I’m working full time as an editor for a news agency, while at the same time tending to my side business as a content marketing strategist. I’m also a travel blogger and oh yeah, I forgot, I also have a life.

    I read a lot of productivity books and blogs looking for ways to make the most of my 24 hours. Most stories on productivity stress waking up early. So I did – and I was a major failure in that department – both in waking up early and finishing early.

    2. Determine your “peak hours”

    Energy management begins with looking for your most productive hours in a day. Getting attuned to your body clock won’t happen instantly but there’s a way around it.

    Monitor your working habits for one week and list down the time when you managed to do the most work. Take note also of what you feel during those hours – do you feel energized or lethargic? Monitor this and you will find a pattern later on.

    Advertising

    My experiment with being a morning lark proved that ignoring my body clock and just doing it by disciplining myself to wake up before 8 a.m. will push me to be more productive. I thought that by writing blog posts and other reports in the morning that I would be finished by noon and use my lunch break for a quick gym session. That never happened. I was sleepy, distracted and couldn’t write jack before 10 a.m.

    In fact that was one experiment that I shouldn’t have tried because I should know better. After all, I’ve been writing for a living for the last 15 years, and I have observed time and again that I write more –and better – in the afternoon and in evenings after supper. I’m a night owl. I might as well, accept it and work around it.

    Just recently, I was so fired up by a certain idea that – even if I’m back home tired from work – I took out my netbook, wrote and published a 600-word blog post by 11 p.m. This is a bit extreme and one of my rare outbursts of energy, but it works for me.

    3. Block those high-energy hours

    Once you have a sense of that high-energy time, you can then mold your schedule so that your other less important tasks will be scheduled either before or after this designated productive time.

    Advertising

    Block them out in your calendar and use the high-energy hours for your high priority tasks – especially those that require more of your mental energy and focus. You also need to use these hours to any task that will bring you closer to you life’s goal.

    If you are a morning person, you might want to schedule most business meetings before lunch time as it’s important to keep your mind sharp and focused. But nothing is set in stone. Sometimes you have to sacrifice those productive hours to attend to other personal stuff – like if you or your family members are sick or if you have to attend your son’s graduation.

    That said, just remember to keep those productive times on your calendar. You may allow for some exemptions but stick to that schedule as much as possible.

    There’s no right or wrong way of using this energy management technique because everything depends on your own personal circumstances. What you need to remember is that you have to accept what works for you – and not what other productivity gurus say you should do.

    Advertising

    Understanding your own body clock is the key to time management. Without it, you end up exhausted chasing a never-ending cycle of tasks and frustrations.

    Featured photo credit: Collin Hardy via unsplash.com

    Read Next