──────────────────────────────────────────────────
Special Characters For Formatting
──────────────────────────────────────────────────
Non-breaking space.
If there is any
one essential character you should become familiar with, it is the non-breaking space.
It may be painful to use, though. Your browser and/or OS may or may not let you simply copy and paste it. Chrome browsers on Windows don’t, for example.
W I N D O W S
On Windows keyboards, you can hold down the
Alt key and type
2 5 5 on the Numeric Keypad.
L I N U X
On modern Linuxes, you can try
Alt+Shift+U followed by
0 0 A 0.
Or if your keyboard layout supports it,
AltGr+Space or
Ctrl+Shift+Space
O S X
Mac users will be pleased to know that
Option+Space typically works.
Other Special Characters
For the rule of pretty, there are also:
— em dash (use between words)
– en dash (use between numbers)
‘single quotes’
“double quotes”
TradeMark™
↑ ↓ → ← arrows (which only only look good in the normal font)
┌────┬────────┐
│line│graphics│
└────┴────────┘
etc
A good combination when formatting stuff to line up is non-breaking spaces and [
tt] blocks. For example, the following construct was used to align all the supported BBCode examples above:
[tt]
hello
[/tt]
There’s more to it though. See the “Quirks” section below.
──────────────────────────────────────────────────
Headers
──────────────────────────────────────────────────
It does not matter what you do for headers, as long as you are consistent.
I tend to use boxed / line graphics stuff for H1 type headers, bold for H2, and a combination of small, teletype, spaced uppercase for H3.
──────────────────────────────────────────────────
Lists
──────────────────────────────────────────────────
Lists are an essential ordering technique. Of course, there are two kinds of lists:
• Unordered
• Ordered
Unfortunately, cplusplus.com does not support either in BBCode. So we have to fake it.
For a simple
unordered list, I typically apply two or four non-breaking spaces, followed by a bullet character (Alt+0149 or Alt+7 on Windows), followed by another space and then the list item.
For
ordered lists, or any list with elements spanning
more than one line of text, additional formatting care must be taken.
[tt] • [/tt]No, Squidward, I meant...[i]good for your soul[/i].
[tt] [/tt][small]Oh, please! I have no soul.[/small]
• No, Squidward, I meant...
good for your soul.
Oh, please! I have no soul.
──────────────────────────────────────────────────
URLs
──────────────────────────────────────────────────
Cplusplus.com’s markup parser handles inline links starting with ht
tp:// and htt
ps://
, but it doesn’t really know when to stop. (Leading to a common bug:
https://www.google.com). ← clicking goes nowhere
The way to avoid this is to introduce an empty markup sequence:
(https://www.google.com[b][/b])
(
https://www.google.com) ← clicking works as intended
This technique is also useful when showing someone how to use [[
b][
/b]code] → [
code] tags.
Opaque Links are not supported. (They were trialed for a short while, but quickly removed.) This is expressly because opaque links are too easy to abuse. Juan Soulié would prefer all links to be explicit. Don’t complain; that’s the way it is.
To make a hard link more palatable, I will often add something that looks much like the markup for an opaque link:
Click for Microsoft’s documentation on (
GetConsoleMode|
https://www.google.com/search?btnI=1&q=msdn+GetConsoleMode)