I'm currently making a blog, and the blog will use markdown for posts. Adding a title with markdown could be confusing for some, so I'd like to have a button that says, for instance, Add Title
, but I'm wondering how I should allow the title to be entered, for example, should a modal popup saying Enter your title here!
or should I just add the beginning character for the title, and hope people think to type after it?
1 Answer
Well, if your users need to know markdown anyway, and there's a live / dynamic preview, you might be able to get away with having the default text for a new post include the markdown for the title. So, for example, someone clicks the "new post" button and the file they get has this:
# Type your post's title here (but keep the #!)
Just start typing your post.
Hit return twice to start a new paragraph. [Here's a link.][http://foo.com]
- create
- bullet
- points
The user will have good feedback from the live preview. As they change the text they'll see the title updating on the right. You might try using javascript to preselect the range of text that they'll replace in the title, so they don't mess up the "# " syntax.
At the end of the day, if you choose to have them input a title with a modal, you should insert it into the markdown document with the proper syntax. This will help them learn how to do it by hand.
If you want to enforce more rigorous markup (i.e. only one h1 in the document, for example), a straight-up form field is probably the best. It's simple for people to understand — this is a field and it's where they type their post's title.
-
1Ooh, I never thought of doing that, I'm going to just do that, people will better understand that because they will just see
hey a link looks like that, i'm going to type that
, thanks! Oct 23, 2014 at 21:55
<input type=text id=title><textarea id=post/>