Recently I read this meta question, which explains how to embed a in your text.
What tips and tricks do you use to make your questions and answers pleasing to the eye?
Recently I read this meta question, which explains how to embed a in your text.
What tips and tricks do you use to make your questions and answers pleasing to the eye?
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é”).
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.
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.
<>
) 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...
<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
[
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
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 tricksdo you use to make your questions and answers pleasingto the eye?
Any word or formatting that doesn't explain the problem or serve as a detail, is too much; I'll cut it.
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 /
//cd
is 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>, &
= ‘&’, ×
= ‘×’, 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.
formatting
!be
a problem
!