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.

    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 Why Getting Things Done is the Best Productivity System For You How to Beat Procrastination: 29 Ways to Beat It Once and for All To Automate or not to Automate Your Personal Productivity System

    Trending in Productivity

    1 The Science of Setting Goals (And How It Affects Your Brain) 2 What to Do When Bored at Work (And Why You Feel Bored Actually) 3 6 Effective Ways to Enhance Your Problem Solving Skills 4 How to Concentrate and Focus Better to Boost Productivity 5 15 Productive Things to Do When Bored (So Time Is Not Wasted)

    Read Next

    Advertising
    Advertising
    Advertising

    Last Updated on July 17, 2019

    The Science of Setting Goals (And How It Affects Your Brain)

    The Science of Setting Goals (And How It Affects Your Brain)

    What happens in our heads when we set goals?

    Apparently a lot more than you’d think.

    Goal setting isn’t quite so simple as deciding on the things you’d like to accomplish and working towards them.

    According to the research of psychologists, neurologists, and other scientists, setting a goal invests ourselves into the target as if we’d already accomplished it. That is, by setting something as a goal, however small or large, however near or far in the future, a part of our brain believes that desired outcome is an essential part of who we are – setting up the conditions that drive us to work towards the goals to fulfill the brain’s self-image.

    Apparently, the brain cannot distinguish between things we want and things we have. Neurologically, then, our brains treat the failure to achieve our goal the same way as it treats the loss of a valued possession. And up until the moment, the goal is achieved, we have failed to achieve it, setting up a constant tension that the brain seeks to resolve.

    Advertising

    Ideally, this tension is resolved by driving us towards accomplishment. In many cases, though, the brain simply responds to the loss, causing us to feel fear, anxiety, even anguish, depending on the value of the as-yet-unattained goal.

    Love, Loss, Dopamine, and Our Dreams

    The brains functions are carried out by a stew of chemicals called neurotransmitters. You’ve probably heard of serotonin, which plays a key role in our emotional life – most of the effective anti-depressant medications on the market are serotonin reuptake inhibitors, meaning they regulate serotonin levels in the brain leading to more stable moods.

    Somewhat less well-known is another neurotransmitter, dopamine. Among other things, dopamine acts as a motivator, creating a sensation of pleasure when the brain is stimulated by achievement. Dopamine is also involved in maintaining attention – some forms of ADHD are linked to irregular responses to dopamine.[1]

    So dopamine plays a key role in keeping us focused on our goals and motivating us to attain them, rewarding our attention and achievement by elevating our mood. That is, we feel good when we work towards our goals.

    Dopamine is related to wanting – to desire. The attainment of the object of our desire releases dopamine into our brains and we feel good. Conversely, the frustration of our desires starves us of dopamine, causing anxiety and fear.

    Advertising

    One of the greatest desires is romantic love – the long-lasting, “till death do us part” kind. It’s no surprise, then, that romantic love is sustained, at least in part, through the constant flow of dopamine released in the presence – real or imagined – of our true love. Loss of romantic love cuts off that supply of dopamine, which is why it feels like you’re dying – your brain responds by triggering all sorts of anxiety-related responses.

    Herein lies obsession, as we go to ever-increasing lengths in search of that dopamine reward. Stalking specialists warn against any kind of contact with a stalker, positive or negative, because any response at all triggers that reward mechanism. If you let the phone ring 50 times and finally pick up on the 51st ring to tell your stalker off, your stalker gets his or her reward, and learns that all s/he has to do is wait for the phone to ring 51 times.

    Romantic love isn’t the only kind of desire that can create this kind of dopamine addiction, though – as Captain Ahab (from Moby Dick) knew well, any suitably important goal can become an obsession once the mind has established ownership.

    The Neurology of Ownership

    Ownership turns out to be about a lot more than just legal rights. When we own something, we invest a part of ourselves into it – it becomes an extension of ourselves.

    In a famous experiment at Cornell University, researchers gave students school logo coffee mugs, and then offered to trade them chocolate bars for the mugs. Very few were willing to make the trade, no matter how much they professed to like chocolate. Big deal, right? Maybe they just really liked those mugs![2]

    Advertising

    But when they reversed the experiment, handing out chocolate and then offering to trade mugs for the candy, they found that now, few students were all that interested in the mugs. Apparently the key thing about the mugs or the chocolate wasn’t whether students valued whatever they had in their possession, but simply that they had it in their possession.

    This phenomenon is called the “endowment effect”. In a nutshell, the endowment effect occurs when we take ownership of an object (or idea, or person); in becoming “ours” it becomes integrated with our sense of identity, making us reluctant to part with it (losing it is seen as a loss, which triggers that dopamine shut-off I discussed above).

    Interestingly, researchers have found that the endowment effect doesn’t require actual ownership or even possession to come into play. In fact, it’s enough to have a reasonable expectation of future possession for us to start thinking of something as a part of us – as jilted lovers, gambling losers, and 7-year olds denied a toy at the store have all experienced.

    The Upshot for Goal-Setters

    So what does all this mean for would-be achievers?

    On one hand, it’s a warning against setting unreasonable goals. The bigger the potential for positive growth a goal has, the more anxiety and stress your brain is going to create around it’s non-achievement.

    Advertising

    It also suggests that the common wisdom to limit your goals to a small number of reasonable, attainable objectives is good advice. The more goals you have, the more ends your brain thinks it “owns” and therefore the more grief and fear the absence of those ends is going to cause you.

    On a more positive note, the fact that the brain rewards our attentiveness by releasing dopamine means that our brain is working with us to direct us to achievement. Paying attention to your goals feels good, encouraging us to spend more time doing it. This may be why outcome visualization — a favorite technique of self-help gurus involving imagining yourself having completed your objectives — has such a poor track record in clinical studies. It effectively tricks our brain into rewarding us for achieving our goals even though we haven’t done it yet!

    But ultimately, our brain wants us to achieve our goals, so that it’s a sense of who we are that can be fulfilled. And that’s pretty good news!

    More About Goals Setting

    Featured photo credit: Alexa Williams via unsplash.com

    Reference

    Read Next