Rich text annotations in the Playground

In Xcode 7 among,Playground allows us to use Markdown syntax similar to rich text format code has comments,Now,We will briefly explain how the text rich text notes。

How to edit rich text annotations

Open your Xcode 7,In the Playground,Editor select the menu bar > Show Raw Markup to allow rich text annotations displayed as plain text mode,So that they can become the editor。This step can be performed once again recover。

grammar

We are here to several provisions of the placeholder,Then again introduce specific syntax:

<valid marked up text> Any legal footnotes。
<optional comment> This code is used to annotate rich text annotations,Will appear in plain text edit mode。
<string> A line of text,The beginning and end of the character can not be blank。
<integer> Any valid integer。
<blank line> Blank lines。

Single-line comments

Compared with ordinary comments,Is more than double slash behind a colon。

Multi-line consolidation

A plurality of single-line comments,If two connected single-line comments,Then they will automatically compose a comment block。

For chestnuts:

This is the effect:

Single-line comments automatically merge

Single-line comments automatically merge

Comment Block

We can also use the rich text to the comment block comment,And general comment blocks difference is,Beginning /* Also behind a colon,Like this: /*:

Let's take a chestnut:

This is the effect diagram:

Rich text notes block

Rich text notes block

Formatting elements

title

Like with Markdown,We use the # (pound) title to mark,The title and content of the pound at least one space distance。A # is a title,# Two subheadings is so ......。

title 1 # <string>
title 2 ## <string>
title 3 ### <string>

For chestnuts:

This is the effect diagram:

Note a subheadings

Note a subheadings

 

Another option

For primary and secondary terms of title,Another option we can use:

title 1 <string>

=<repeat for character count of heading string>

Use the equal sign to do a title underlined ( =).

Length equal number must be as long as the title character length。

title 2 <string>

-<repeat for character count of heading string>

Use hyphens to subheadings do underscore ( -).

Hyphen also have the title and length as long as the job。

For chestnuts:

This is the effect:

Adding a level-one heading

Adding a level-one heading

List of items

We use an asterisk * To mark list items,Asterisk with the list of words separated by one space:

For chestnuts:

This is the effect:

List of items with two elements

List of items with two elements

The list in numerical order

This much said,Direct look at an example of it,Well understood:

A list of <integer>. <string>
Two lists <integer>. <string>

4 Spaces

Three list <integer>. <string>

8 Spaces

chestnut:

effect:

With a list of numbers of two

With a list of numbers of two

Quoted text

Use a greater-than sign to mark the quoted text,Remember spaces!

For chestnuts:

effect:

Some of the content from Aesop's Fables

Some of the content from Aesop's Fables

Horizontal dividing line

Use four or more hyphens to mark the horizontal line,Remember free up and down the line!

For chestnuts:

effect:

Level

Level

Font effects

Italics

The following can be both

For chestnuts:

This is the effect:

Italics

Italics

Bold

Both can be the following

For chestnuts:

effect:

Bold face

Bold face


 

Some such syntax,It should have been enough for everyday use,Such as adding more links、Insert pictures and more advanced use described here do not,If you want to know the content,Please movePlayground Markup Format for Comments

 

Original article written by Gerber drop-off:R0uter's Blog » Rich text annotations in the Playground

Reproduced Please keep the source and description link:https://www.logcg.com/archives/1058.html

About the Author

R0uter's Blog

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Leave a Reply

Your email address will not be published.