Categories
Tutorials & Tips

Plain text markup languages

Instead of relying in complicated bloated office programs or embedding messy WYSIWYG interfaces in web applications, a quick way to format plain text is to use a markup language. Just like HTML that has tags to structure a document and render into special formatting, plain text can also be “pretty” by using a standard markup language. It is easier to type as they normally don’t interfere much in the visual aspect of the text. That means that even if you don’t have support for the markup language, you can read the text without problems.

On code documentation files, plain text markup languages are preferred over languages like HTML or LaTeX to waste little time on editing without loosing good presentation.

Some of these languages are:

Markdown

It was created as a plain text to HTML markup language made to simplify writing formatted text that will generally end translated to HTML tags. The syntax is very simple and supported on many text editors and web platforms.

Basic markup guide

# Heading 1
## Heading 2
*Bold*
– List item 1
– List item 2
+ sublist item
[text](Link)

Cheatsheet

You can find a markup cheatsheet here

You can read more on the markdown project website.

Asciidoc

As the website defines it, it is more than just a markup language. It is a text based document generation tool. You can create beautiful documentation with it by exporting to formats like HTML, PDF or LaTeX. Besides the usual markup of plain text, you can also use variables with a certain value to reuse across your document, saving you from typing repeated text or update a value in several places with one change.

Basic markup guide

== Heading 1
=== Heading 2
\*Bold\*
* List item 1
* List item 2
** sublist item
link_url[Link_text]

Cheatsheet

There’s an asciidoc cheatsheet here

You can read more at the asciidoc website.

Org

Org was born in the Emacs org-mode users world. I think besides Emacs there are no other places where org syntax is being used. Org lets you do many things in plain text, like organizing your to-do lists, your agenda, plan your projects, add source code blocks and execute the code right in your document among many other things. You can easily export to HTML, LaTeX, PDF among other formats. Some parts of the syntax can be complicated but since it is intended to be used within Emacs, it’s easy to handle with simple keyboard shortcuts.

Basic markup

* Heading 1
** Heading 2
\*Bold\*
/italic/
\_underline\_
- List item 1
- List item 2
  - Sublist item
[[Link_url][link_text]]

Cheatsheet

There are many Org-mode key stroke cheatsheets, but for markup only you can consult here

You can read more on the org-mode website.

Keyboard photo by Wouter Verhelst on Flickr
Categories
personal

6 Tips for Writing as a Habit

Human Writes Performance Installation at UN Geneva

Writing is one of the best habits you can have. It helps telling stories, preserving memories, and organizing thought in general. Here are some gathered tips that I’ll be trying these days to have writing as a habit:

  1. Write daily

    Whatever you are thinking about, go ahead and put it in words. That thought will get lost with time and might be helpful for a future idea.

  2. Find your workflow

    Figure out the best times and ways to write. Reserve a certain hour in the early morning or before going to bed, or during lunch. Find what is the best times of the day and conditions that inspire you to write. Write in small bursts or complete thoughts from start to finish, whatever works for you.

  3. Make it easy

    Find an easy way or tool to quickly draft something in the middle of the day or while doing chores if you need to. That split second the idea comes, might never come again. Emacs Org-mode with Org Capture is my tool of choice when I’m at the computer. Use apps like Evernote, Google Keep, MobileOrg or whatever is easy for you to write things down while not on the computer (or paper notebook) where you store your drafts and writing.

  4. Figure out things later.

    Don’t worry about titles, headlines or main topics, not even file names. Just use the date as a filler and write. You can figure out later what it is about when you are halfway done or finished. For example, blog post is part of a larger writing that I ended up splitting in 3 posts.

  5. Don’t publish everything you write.

    The need to publish can be intimidating and cause self censorship. Publish when you feel like it, publish only what you want, but write about it first.

  6. Social media interactions don’t count as writing.

    They’re too short (140 character tweets) and meaningless most of the time, unless it’s something you thoughtfully and more extensively wrote and want to publish. But those short social media interactions can be a good source of inspiration of what you can write about.

Categories
personal

Writing to get out of the mental block

journal-writing.jpg

Writing is the best tool to organize your thoughts. Many authors and leaders advice to daily writing as a way to master clear thinking. They are right, but writing constantly is not that easy, then thinking clearly is more difficult. Sometimes you lack time, ideas or both. In my case, there’s a lot I want to say, but I haven’t been able to organize my thought in clear way to express myself.

Lately I’ve been having a lot of trouble to write my thoughts to publish on my blog. I don’t think it is the famous “writer’s block” but more of a general total thought blackout. I’ve been having trouble focusing because when I’m trying to gather an idea or work on a project, in the middle of it something else pops up and I get nothing done. I’ve been reading a several books that inspire me to write something but I can’t get myself to figure out what that something is. I feel like the world demands me, as I’ve reached my 30s, to do something or be someone and lately I don’t want to feel pushed to any of it. Things like: “Fix this bug”, “answer the phone”, “exercise”, “do business”, “figure out what to eat today”, even “go out with friends”…and the list goes on, feel annoying.

Recently it’s gotten worse: every time the phone rings with a notification, message, email or even calls, a small amount of anger rushes through my body. I feel there’s a lot of noise out there telling me what can or can’t I do and very little input from my part on what I want. The real problem is that I can’t figure out what is it that I want with all the annoyances. What I really want, although impossible, is to stop the noise, maybe even stop the world and time, so I can think.

Today I’m writing about wanting to write. And I want to write because I want to organize my thoughts. I don’t want to be annoyed and I can’t stop time, but as I write things down, I might be able to figure out what I want. Einstein said that “Nothing happens until something moves” and this post is my way to use writing as a tool to get out of the mental block and a passive attitude.

All this reminds me of a scene in Mad Men, where the main character, Don Draper, after a series of personal troubles starts writing in his journal to get his thoughts organized.

Categories
personal

How NOT to kill an idea

Sometime ago, I came across this image on a blog, 8 ways to kill an idea.

These are all clever and very real ways to kill an idea on the work environment. But it made me think of way’s I’ve killed an idea, on a personal level, and I realized its missing a nine-nth one: Not writing it down.

Your brain is constantly storming with ideas and shifting thoughts every second (or even faster). Think of how you’re thinking of something, then that leads you to something else and then to even something else almost totally randomly.

Sometimes you might get a flash of inspiration or come up with a great business idea or problem solution while doing something else like riding the bus, eating sushi or watching TV. Your brain works so fast that is hard to keep up with it or keep track of every thought at every moment. This is why its very important to write down your ideas as soon as you get them. Have a small notebook or note-taking app in your phone ready for whenever the situation presents.

It is very important to write down all your ideas, even the bad ones. Remember that practice makes perfection. You can’t expect to come up with a good idea on the first attempt. Also, how would you differentiate between a good or bad idea if you can’t compare them side by side written down on a media? It will also help you track down ideas that you’ve already have, so you don’t end up repeating your bad ideas later on.

Some applications worth looking at for brainstorming and note taking are:

Emacs Org-mode
Freemind

Categories
Emacs GNU/Linux Free Software & Open Source Tutorials & Tips

Post to WordPress blogs with Emacs & Org-mode

Recently I’ve discovered Org2blog, an Emacs mode to write your blog posts locally using org-mode post them to your WordPress blog in a very fast and easy way.

I’ve written before on how to write your blog posts and publish them using Emacs. Previously, my method of choice was using Weblogger mode. I even wrote some enhancements to it.

The problem I found with this method is that it uses message-mode as its base mode. So you’re basically writing an email. The shortcomings of it were that whenever I wanted to write links, bold text, or any custom formatting generally done through HTML tags, I had to either type out the HTML or temporarily switch to html-mode. That sometimes gave me some problems converting the HTML code into entities, and ended up with a mess to fix at the WordPress editing textarea.

Org-mode (included in Emacs since about version 22.1), if you haven’t heard about it already, is a very good way to take notes, organize your tasks, among other day to day useful things. You also get some basic formatting like bold text and italics, as well as links among many other useful things. Nowadays, I find myself typing things in org files constantly throughout my day, and with all its long list of qualities, it became a more suitable way for me to write blog posts.

Org2blog provides a way to post your Org files or post a subsection of your file with a few keystrokes. All you need to do is clone the repository on your load path directory

git clone http://github.com/punchagan/org2blog.git

Then, add this to your .emacs file

  (setq load-path (cons "~/.emacs.d/org2blog/" load-path))
  (require 'org2blog-autoloads)

Finally set up you blog(s) settings in you .emacs file

     (setq org2blog/wp-blog-alist
           '(("wordpress"
              :url "http://username.wordpress.com/xmlrpc.php"
              :username "username"   
              :default-title "Hello World"
              :default-categories ("org2blog" "emacs")
              :tags-as-categories nil)
             ("my-blog"             
              :url "http://username.server.com/xmlrpc.php"
              :username "admin")))

To start wrigint a new post, you can now use
M-x org2blog/wp-new-entry

Or, as I more frequently use, post a subtree of an existing org file using:
M-x org2blog/wp-post-subtree

I hope you enjoy writing and posting your blog posts within Emacs and Org-mode. I certainly do and has turned out to be a very fast way to quickly draft and later on (even offline) elaborate on the blog post details in a comfortable editing environment. Also you get the added benefit of having a local copy (backup) of your blog posts as Org files.