Archives For writing

Markdown and MultiMarkdown

January 8, 2011

I’ve recently (and finally) started using Markdown and MultiMarkdown, two excellent tools for writers. Markdown was created by John Gruber, in 2004. What it does is simple and brilliant: Markdown allows you to write using plain text, without a lot of markup or effort, and then export your writing as HTML. So instead of creating H tags, you can do just this:

# This is a Header 1
## This is a Header 2

To create emphasis, text is wrapped with one or two asterisks or underlines: Here is some *emphasis*. Here is more **emphasis**. You want to create a new paragraph? Just add a blank line. Simple! There are also ways to create lists, links, add images, and so forth.

You can learn the basics and the syntax at Gruber’s site, which also has an online tool, named Dingus, for converting Markdown text to HTML. What’s great about Markdown is there aren’t many rules to learn and you can write using it so easily. If you do a lot of writing that gets published online, like a blog, Markdown really lets you focus on the writing without spending too much time creating and balancing tags. Secondarily, text written using Markdown is easy to read, which means it’s also easier for the original writer to edit. If you work with a team of people on documents, there’s a lot to be said for Markdown as a format to use.

MultiMarkdown, which I haven’t used as much yet, is an extension of Markdown, adding features that Fletcher Penney, its creator, thought necessary. For starters, Multimarkdown lets you quickly create tables, footnotes and citations, metadata, definition lists, and more. More importantly (to me) MultiMarkdown can also be exported to more formats beyond HTML, because MultiMarkdown includes a tool that supports LaTeX. Through it, you can create PDFs, RTF documents, Word documents, and more. This means you can create entire books, PDF articles, and presentations using MultiMarkdown (along with HTML documents, of course).

I’ve been using Markdown for a couple of months now for my [intlink id=”2087″ type=”page”]newsletter[/intlink]. The newsletter gets sent out as HTML, but I write it as plain text. Not having to worry about the HTML, or even see it, as I do rewrite upon rewrite, speeds up the process tremendously. In a couple of weeks I’m going to begin writing a JavaScript book, to be self-published. For it I’ll use MultiMarkdown. By doing so I can export the final product as a series of HTML pages, to be published online, and as a PDF, to be printed as a bound or electronic book. I was looking for the best solution for my self-publishing ventures and I think MultiMarkdown will fit the bill nicely. (My previous inclination was to import plain text into InDesign, then do all the layout and formatting there. This would mean, for starters, that I’d have to learn InDesign.) For both my newsletters and the JavaScript book, I’ve taken to the Mac text editing application Scrivener, which has support for MultiMarkdown built-in (there’s a TextMate bundle for MultiMarkdown, too), which is a strong argument in favor of both Scrivener and MultiMarkdown.

Neither Markdown nor MultiMarkdown is something everyone needs, but if you do writing that needs to be published in HTML format, or in multiple formats, both are worth checking out.

In this edition…

About This Newsletter

So it’s been about six weeks since my last newsletter, or roughly twice as long as I normally hope I get these things out. The cause for the delay is simple: I’ve been working night and day on my forthcoming “Effortless E-Commerce with PHP and MySQL” book, trying to make the end-of-this-month deadline. I don’t think I will, but it’ll be close. Anyway, this newsletter has some stuff about that book that you may be interested in, along with a couple of other notable things I’ve found online. I went looking for some good questions to answer in this newsletter, but didn’t have any set aside, so if you’ve got a question you’d like me to answer in a future newsletter, including one you’ve previously submitted but I apparently ignored, please send it along. As always, thanks for reading and for your interest in my work!

On the Web => First Example Site for “Effortless E-Commerce with PHP and MySQL”

My “Effortless E-Commerce with PHP and MySQL” book has four parts to it. In the first part, there are two chapters of general information: one on the process and another on security. In the second part, I develop an entire e-commerce site. In the third, I develop a second e-commerce site. In the fourth, I discuss and demonstrate additions you could make to both sites. My original intention was to get all the code done (at least for Parts 2 & 3), and then start writing. As with all good plans, this is not how things went. But I’m happy to say that the first example site is complete, as are the first six chapters of the book (the first draft of those chapter, that is).

If you’re interested in the example I came up with, you can check it out online at http://ecom1.dmcinsights.com. This is a fully functioning, live version of the site, complete with registration, login, password management, content managment, and PayPal integration. The PayPal integration is currently done using PayPal’s Sandbox (i.e., their test system), so you can even pretend to pay for site access.You can also download the source code for the site, if you’d like to get a look at what the book will discuss. The source code is fairly well documented, so you should be able to get a sense of what I’m thinking through that.

On each page of the online site (this isn’t in the book) is a comments form for you to raise questions, make suggestions, and so forth. I would love to get as much feedback and as many points of view as possible. I’ll also give away a few copies of the book specifically to people who’ve submitted commments.

I’m working on the second site example now (well, as soon as I send this newsletter out) and will make that available when it’s ready.

On the Web => Rasmus Lerdorf’s No-Framework PHP MVC Framework

Some years ago, Rasmus Lerdorf, original creator of PHP, posted on his personal Web site a discussion of what he would look for in a framework for the MVC architecture. It’s an interesting read, from the master’s voice. He specifically talks about how to properly use MVC, how to guarantee performance and security, and how to design with scalability and flexibility in mind. Although the post is a few years old, most of it is still valid, with only little changes such as the fact that the PECL/Filter extension is now part of PHP proper.

On the Web => ServInt: Customer Service Done Right!

I’ve been using ServInt for my Web hosting for some time now (three years, I think) and could not be happier. In the past eleven years, I’ve probably had five hosts, ranging from the really cheap and totally awful to the not-that-cheap but still rather awful. For me, finding a Web host that I can rely on has been a huge weight off my shoulders. One thing ServInt does right is that they only do high-end hosting, starting with VPS (Virtual Private Server) and going up to dedicated hosting. What they don’t do is put 50 clients and hundreds of domains on a single server, which is what the cheap hosts do. Don’t get me wrong: cheap hosting is fine for many people, especially with small projects and new ones, and in many cases spending only a few dollars a month makes sense. If you’re just learning Web development today, you should probably start with a cheap host.

By comparison, I’m using the most basic ServInt plan and it’s running me $50/month (US). But, again, that peace of mind… The other thing that ServInt does right, which is the bigger deal, is their customer service. They respond immediately to concerns of mine and often help out on things that aren’t really their problem (i.e., when I screw up). Moreover, ServInt has just, for at least the second or third time since I’ve been with them, opted to provide more services at no additional cost. I received an email a few weeks back indicating that my basic account has been upgraded from 30GB of storage to 50GB (which, frankly, I needed, as I was at about 28GB and thinking I’d need to start weeding through my drives). ServInt has previously upgraded the storage before, as well as the RAM and bandwidth allotments, so this isn’t entirely surprising but is still a fantastic thing to see.

I’m not writing this in order to sell you on ServInt (although I can definitely recommend them in good conscience) but rather to highlight an example of excellent customer service. Good customer service properly fixes problems when they arise. Great customer service does so nicely, promptly, and with a little extra. Excellent customer service prevents problems from happening in the first place and provides extra services at no additional cost. I’m not a marketing guy by nature, but I know that ServInt has my business for the long run because of things like this. And just as I’m writing this, I’m thinking that if times were tight financially, if I had a little extra free time, and if I was looking to improve my business, I might go back to some of my clients and offer something for free, too, such as doing a bit of software upgrading or adding a feature they wanted but couldn’t afford. I’m sure that’d make an impression and generate more business in the long run. Once they accepted that you weren’t trying to scam them, that is!

On the Web => Geek Humor

I came across this cartoon, which is funny in a geek-y way, and thought I’d share: http://xkcd.com/327/

On the Blog => Yii-related How-To’s

I wrapped up my fourth Yii-based site a couple weeks back (although I’m still making minor tweaks per the client’s requests) and I’ve been doing some consulting for a client that’s learning to use Yii for his projects, so a number of my blog posts as of late have been about Yii. If you look under the Yii tag at my blog, you’ll see articles on:

  • Handling Related Models in Yii Forms
  • Handling Checkboxes in Yii with non-Boolean Values
  • Forcing Login for All Pages in Yii
  • Caching the Database Schema using MemCached with Yii

These are just the most recent articles I’ve written on Yii. There are some older ones about authorization and authentication, plus my original eight-part series on learning Yii. Perhaps next year, depending upon how my experience in self-publishing a JavaScript book goes, I’ll self-publish a guide to Yii, as I’ll have informally written a book on the subject by then!

On the Blog => “Effortless E-Commerce with PHP and MySQL” Updates

I recently published an update on my “Effortless E-Commerce with PHP and MySQL” book. The update reflects the actual Table of Contents for the first five chapters of the book, based upon the rough draft of them. You can also learn a bit about the content of each. I’ll probably post another update in about two weeks.

What is Larry Thinking? => Teaching, Not Selling

My blog has gotten a lot of attention over the past several months because of my series on the Yii-framework (on the Yii’s documentation page, the first link for learning Yii is to my series). I’m glad people like what I’ve written and feel like it’s a good way to learn, as it makes the work I put into the blog meaningful. However, I’ve been surprised to get a percentage of questions along the lines of “Why should I use Yii?”, even though that is a resonable question. But I also get the less reasonable “Why should I switch to Yii from XXX framework?” or just “I can already do these things much more easily using XXX.”

Asking about the benefits, which is also to say the strengths, of any new technology is natural. As a person writing about certain technologies, I feel that it’s part of my job to cover this side of things. But there’s a line between teaching and selling that I don’t cross: it’s never my goal to talk someone into using X or Y; my only aim is, if you want to learn X or Y, to make that learning process smoother. I have opinions about Yii and jQuery and Ruby/Flex/AIR/Mac OS X/PHP/MySQL/just-about-everything but I don’t care whether people do or do not use any particular technology (and I don’t mean that to sound harsh). What I do care about is, if they are trying to learn X using my writing, that my writing is helpful in that regard. In short, there’s a large part of who I am that’s a teacher, but I don’t have a selling bone in my body.

So the answer to a question about using Yii, or using Yii instead of, say, Zend, is that I think Yii’s approach makes sense to me, I like that it autogenerates code for you, jQuery is built-in, and that Yii is easily extendible. My answer to a question about why someone should switch to Yii is I don’t know and/or maybe you shouldn’t. I think people in this industry get hung up on what’s best or, even worse, what’s hip or new (“Web 2.0”? Ugh!). Or they feel like the announcement of or praise for something different is in some way an affront to what they’re currently doing. This is all immaterial. At the end of the day, the only question that really matters is: does this work for you? And that’s a question I can never answer, except to say “Maybe give it a whirl and see for yourself.”

Book Giveaway=> “Effortless Flex 4 Development” Update

There was a great response to my “Effortless Flex 4 Development” giveaway and I think I made many people happy with the free copies they got. Everyone should have received their book by now (actually, a couple of weeks ago), so let me know if you didn’t get yours. I have a couple more copies left that I’ll give away in a future newsletter.

Larry Ullman’s Book News => “Effortless E-Commerce with PHP and MySQL”

As you can tell, pretty much all of my time these days is being spent on the “Effortless E-Commerce with PHP and MySQL” book, which is coming along nicely. After doing recent books on Flex, Ruby, and Adobe AIR, it’s nice to get back to my programming roots. And as people have been requesting this book for years, and as I should have written it last year, it’s great to get this done. My hope is to wrap up the rough draft in very early September, meaning the book should be out in October. The book will also be put online via Peachpit’s Rough Cuts series, and I’ll post that URL once I know it.

I received a lot of interest, in response to my previous newsletter, about my planned self-published JavaScript book. I’m happy to see such interest, because it’s going to be a lot of work! Many people also volunteered to help proofread the text and test the code, which is wonderful and extremely generous. One thing I’ve learned writing books all these years is that having more people look at the book makes it better. It’s not a case of “too many cooks spoil the broth”, it’s more a matter of lots of tasters provide great feedback!

I’m also talking to Peachpit Press about doing the fourth editions of my “Dynamic Web Sites with PHP and MySQL: Visual QuickStart Guide” and “PHP for the Web: Visual QuickStart Guide” books. Both will be published in 2011, updated for the latest versions of PHP and MySQL (and dropping the PHP 6 moniker, which is thoroughly dead in the water). Per repeated requests, I’m also going to integrate a page or two of questions, suggestions, and exercises at the end of each chapter. Right now, it looks like I’ll write the fourth edition of “PHP for the Web: Visual QuickStart Guide” this fall, so that it’s published in early 2011.

Peachpit Press, on their Web site, is in the process of publishing two series of “Five Tips in Five Days” blog posts that I have written. One is on the Flex 4 framework and the other is on the Flash Builder IDE. As of this writing, nine of the ten posts have gone live with the other one  expected tomorrow. All of the posts are written for those with an understanding of Flex 4 and Flash Builder, respectively, highlighting new or less-known features and concepts. But even if you aren’t familiar with either, you may want to take a gander at them to get a sense of what Flex 4 and Flash Builder are capable of doing. The best way to access them is through my reference page at Peachpit’s site.

Peachpit Press, publisher of my forthcoming “Effortless Flex 4 Development” book, has published another excerpt of the book online, free for anyone to read. (Technically New Riders is the publisher, but New Riders is owned by Peachpit.) This article represents a few pages from Chapter 4 of the book, “Event Management”. It follows the previous excerpt (also from Chapter 4), which you should probably read first if you haven’t. The first excerpt largely discusses event handling theory; in this excerpt you’ll see how to turn that theory into actual code. Even if you don’t yet know Flex and ActionScript, you should still be able to follow along. Most importantly, Flex is largely an event-driven approach to application development (conversely, Flash Professional is primarily a timeline-driven approach), so this section is really a key insight into what it’s like to use Flex.

I’m just about to do two “5 Tips in 5 Days” blog posts for Peachpit’s site. One will be specifically on the Flex 4 framework and the other will be on Flash Builder. Flash Builder, in case you’re not familiar with it, used to be called Flex Builder and is just a commercial IDE for developing using Flex. You don’t have to use Flash Builder as the Flex 4 framework and its SDK are available for free, but it does ease the process significantly. The book does not assume you’re using Flash Builder, either. There are specific instructions for how to create Flex applications using a text editor and the command-line IDE, but there are also areas that cover how you would do X or Y using Flash Builder. Most of the book focuses on the Flex framework, so it doesn’t matter what development tools you’re using.

I’m pleased to say that the first draft of my latest book, “Effortless Flex 4 Development”, is now complete. In fact, I’ve already done the rewrites on half the book and should complete those this week. The final table of contents is below. The table lists all of the top level sections, but doesn’t reflect specifics covered in subsections or addressed in sidebars. There are a couple of minor topics that I wanted to get in there if there was room, such as effects, and I’ll write those up in this blog instead. Continue Reading…