11

Recently I read this meta question, which explains how to embed a Windows Key in your text.

What tips and tricks do you use to make your questions and answers pleasing to the eye?

7
  • 9
    The trick is not to use too much formatting!
    – slhck Mod
    Commented Dec 25, 2012 at 23:09
  • 1
    Yes, that can always be a problem! Commented Dec 25, 2012 at 23:13
  • 2
    My rule is that formatting is only good while it makes things clearer. For example, a heading for a one-line answer doesn't really clear anything up, whereas headings throughout a 20,000 word answer probably would! Commented Dec 25, 2012 at 23:28
  • Of course. Perhaps another interpretation would be "What particular bits of markdown/site specific code are useful but not immediately obvious for someone with little experience with markdown/stack exchange/HTML in general?" (That's a bit wordy though.) Commented Dec 25, 2012 at 23:36
  • 1
    the windows key thing is a hack, but a good one ;p
    – Journeyman Geek Mod
    Commented Dec 26, 2012 at 0:53
  • 1
    The windows key will be very annoying when the server hosting the image is down. Text works just fine. Commented Jan 8, 2013 at 17:10
  • Good point, but it's not down very often. Commented Jan 8, 2013 at 17:11

4 Answers 4

8

Use non-ASCII characters

Oh, sure, if you type “1/2” for one half, “*” for multiplication, and “/” for division, most people will understand you.  But if you type ½ you will get ‘½’.  Similarly, × = ‘×’ and ÷ = ‘÷’.

If you don’t want to look up the HTML character names, type your post in a text processor like Microsoft Word, and then copy and paste into Super User.  For example, if you type  1/2  (note the preceding and trailing spaces), Word will convert it to  ½ .  (This behavior can be configured, so you might have to turn in on before it works.)   Another one: Ctrl+ followed by e will turn into ‘é’ (‘e’ with an accent mark, as in “résumé”).

Others

Preparing posts in Microsoft Word is a mini-trick in itself, insomuch as it checks your spelling and grammar.

And <kbd>Ctrl</kbd> to get Ctrl is a nice one, too.

1
4

Formatting pre-formatted text

Here's a "trick" I sometimes use to clarify commands. Usually, the four-space-indent code formatting doesn't allow you to format the code within:

./foo -o "blah" --another-option /path/to/something

However, if the command consists of options that the user will have to fill with their own variables, it often helps to differentiate between these. Also, a link to an appropriate manpage is nice to have.

You can do that with pre and code formatting:

./foo -o "blah" --another-option /path/to/something

The source for this would be simple HTML:

<pre><code>./<a href="http://example.com">foo</a> -o <i>"blah"</i> --another-option <i>/path/to/something</i></code></pre>

Of course, only do that if you have time and if it pays off for what you're trying to explain.

4
  • I believe that the <code> and </code> in your example are superfluous — if you delete them, the display doesn’t change. Commented Dec 29, 2012 at 0:46
  • I think it's standard to use angled brackets (<>) to indicate a variable the user should insert, e.g. <filename>. Probably from BNF, as is square brackets to indicate something optional ([--another option <path>]). Of course, a lot of users won't be aware of this syntax...
    – Bob
    Commented Jan 1, 2013 at 7:20
  • 1
    @Bob: I actively discourage the <filename> convention because < and > have meaning in the Windows Command Prompt and all Unix shells. The fact that we still feel the need to give instructions like, “Type "date –u" (but type only the part between the quotes, don’t type the quotes themselves),” tells me that we don’t trust 100% (or even 99.44%) of the user population to be able to distinguish characters from meta-characters. (Remember the user who asked, “Where’s the "any" key? The computer is telling me to "Press any key".”) Commented Jan 5, 2013 at 1:13
  • @Bob: Another example: the user who typed ‘E’, ‘n’, ‘t’, ‘e’, and ‘r’, and wondered why nothing was happening. I go along with using square brackets ([ and ]) for optional input somewhat grudgingly, partly because it’s not as likely to cause a mess if the user types it literally, and partly because there’s no widely recognized typesetting equivalent (although I have seen “<sub>opt</sub>”). But I recommend using italics for non-literal input (e.g., “filename”) whenever possible. Commented Jan 5, 2013 at 1:14
3

The trick lies not in how you use your formatting, but what you write.

If you're going to write a whole story, your question or answer won't please me as I'll get bored soon enough. If you get straight to the point about what your problem is and then provide more details after that, I'll be happy to attempt to give an answer. It doesn't have to be pleasing to the eye, it needs to be pleasing to my mind.

What tips and tricks do you use to make your questions and answers pleasing to the eye?

Any word or formatting that doesn't explain the problem or serve as a detail, is too much; I'll cut it.

1
  • Of course, a question is only as good as its framing. Thank you. (Maybe "to the eye" was a detail though =P) Commented Dec 26, 2012 at 18:29
1

Formatting code and comments

I use a trick similar to the one presented by slhck, but mine allows not only HTML markup in a gray block, but also variable-width characters.  I use the > (which is markdown for <blockquote>) at the beginning of the line, and then <code> and </code> and other markup/markdown as appropriate.  For example,

(prompt)> cd /              // cdis short for “change directory”.

WWWWWWWWiiiiiiii       //  Compare the widths of the characters.
 WWWWWWWWiiiiiiii

is produced by

>_(prompt)_><code> **cd /**</code>              _//_ `cd `_is short
for “change directory”._
>
`WWWWWWWWiiiiiiii`&nbsp; &nbsp; &nbsp; &nbsp;_//  Compare the widths
of the characters._☆☆
 WWWWWWWWiiiiiiii

where ‘☆’ represents a space (two spaces at the end of a line inside a blockquote acts like a <br>).

It’s sometimes tricky figuring out when you can use markup and when you can use markdown.  For example, anything you type between back-ticks (`…`) is displayed literally, where as text between <code> and </code> can contain markup (<b>bold</b>, <i>italic</i>, &amp; = ‘&’, &times; = ‘×’, etc.) and markdown (**bold**, _italic_, etc.)  Thus, since I wanted to put the cd / into bold, I needed to use <code> and </code> for that, but I could use back-ticks the other two places.

<edit>D’oh! I just realized that I could have said **`cd /`**.</edit>

Beware: The markdown processors in SU and MSU might not be identical.

1
  • Since when are comments not <code />? Using this much formatting in a code block is certainly bad. Commented Jan 4, 2013 at 12:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .