Text Formatting

Of course, you can type paragraphs into a Twine passage in Chapbook and it will display them as you would expect. But for other kinds of formatting, such as bold or italics, Chapbook follows the syntax of a popular markup language called Markdown.

The term 'markup language' might sound complex, but in reality it's just a set of conventions of how to represent formatting in plain text. For example, to make part of your text italicized when displayed, you simply type asterisks around it, *like so*.

If you've never used Markdown before, try using the dingus as you read this section. It's an online playground with a funny name that not only allows you to quickly see how text will be rendered, but also has a cheatsheet that summarizes the different formatting available to you. Bear in mind, however, that Chapbook has a few extra formatting options available to you above and beyond the standard Markdown set.

Italics and Boldface

To italicize a a phrase, type * or _ (a single underscore)1 around it.

Typed Displayed
_Unconventional_ tastes Unconventional tastes
*Unconventional* tastes Unconventional tastes

To make a phrase boldface, type ** or __ (two underscores) around it.

Typed Displayed
__Unconventional__ tastes Unconventional tastes
**Unconventional** tastes Unconventional tastes

It doesn't matter whether you use asterisks or underscores, so long as you're consistent in a single usage, and you can mix and match them in your text.

Typed Displayed
**"I'll _murder_ you,"** she hissed. “I'll murder you,” she hissed.

Monospaced Type

To set text in a monospaced typeface, like this, type backticks (`) around it.

Typed Displayed
`Beep boop,` HAL commented. Beep boop, HAL commented.

Small Caps

If you'd like to set some text in small caps, type ~~ (two tildes) around it.

Typed Displayed
Above the door was a ~~NO TRESPASSING~~ sign. Above the door was a NO TRESPASSING sign.

This convention, though not a part of original recipe Markdown, conflicts with some other Markdown dialects, which use ~~ for struck-out text, like so. To do this, type <del> and </del> around your text:

Typed Displayed
At the bottom of the page, nearly completely covered by the government censor's pen, was that same code name you had seen before: <del>S-5900</del>. At the bottom of the page, nearly completely covered by the government censor's pen, was that same code name you had seen before: S-5900.

Section Breaks

A convention sometimes used in publishing to indicate a new scene, or a new line of thought is to separate the text using a series of asterisks, like this:

It had been a long day, and I fell asleep nearly instantly.

*   *   *

The following morning was no better than the day before.

To add a section break to your text, type --- (three dashes) on a line by itself.

Block Quotations

To indent a long quotation, put > (a greater-than symbol) in front of each line.

Lists

To created a bulleted list (or, in the parlance of the web, an unordered list), type *, -, or + at the beginning of a new line. It doesn't matter which character you use, but you do need to be consistent in each list.

TypedDisplayed
* Red
* Green
* Blue
  • Red
  • Green
  • Blue

To create a numbered list (also known as an ordered list), start each line either with a number and a period, or just a #. The numbering you use doesn't actually matter–you can have two items starting with 2. and the list will still be numbered correctly.

Typed2Displayed
# Red
# Green
# Blue
  1. Red
  2. Green
  3. Blue
1. Red
2. Green
3. Blue
  1. Red
  2. Green
  3. Blue

Why bother to specially format a numbered list? Just like in word processors, using this format will cause each item to be nicely indented, so that the second line of text of each item appears to the right of the initial number.

Ignoring Formatting Characters

Occasionally you'll want to use Markdown formatting characters as-is, without them initiating formatting. The simplest way to do this is to put a \ (backslash) in front of them.

Typed Displayed
\*\* PLEASE EXIT NOW \*\* ** PLEASE EXIT NOW **

Other Custom Styling

You can also enter HTML into a passage without any extra code surrounding it. It will be displayed exactly as you type it in.

Markdown has a quirk where if you enter Markdown code inside of an inline element such as <b> or <span>, it will convert it to HTML. But in block elements such as <p> or <div>, it won't.

Blockquotes and Code Blocks Don't Behave As You Might Expect

There are two ways that Chapbook formatting differs from standard Markdown that will be covered in later sections.

The first is the use of > at the start of a line, which in standard Markdown marks a section of text as a block quotation. In typographic tradition, block quotations are indented to indicate that they aren't part of the main text. Chapbook uses the > to mark text as part of a forkinstead. If you'd like to display a block quotation, put <blockquote> and </blockquote> around it.

Typed Displayed
<blockquote>Call me Ishmael. Some years ago--never mind how long precisely--having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.</blockquote>
Call me Ishmael. Some years ago–never mind how long precisely–having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.

Secondly, there's a popular extension to Markdown that allows entry of long stretches of monospaced text, often computer code, by placing three backticks (```) on a line by itself, then text, the another set of three backticks. Chapbook uses this convention to allow embedding JavaScript code into a passage. This is discussed in more detail in Using JavaScript in Passages, but for now, remember that Markdown code blocks do not display as you might expect.

If you would like to display a long stretch of monospaced text, put <code> and </code> around it:

Typed Displayed
Onscreen it read:

<code>
10 PRINT "HELLO"
20 GOTO 10
</code>
Onscreen it read:

10 PRINT HELLO
20 GOTO 10
1. Underscores as italics have a tangled history behind them; they resemble underlines, which were more-or-less invented as a workaround for typewriters being unable to italicize words.

results matching ""

    No results matching ""