Skip to content

Commit

Permalink
Merge pull request #48 from riscv/examples
Browse files Browse the repository at this point in the history
adding examples
  • Loading branch information
kersten1 authored Jul 31, 2024
2 parents cb4c91e + fa4674f commit d49b155
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 67 deletions.
54 changes: 53 additions & 1 deletion src/a_few_basics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ Unordered lists are created with the `*` before the list item. Ordered lists req

To create an unordered list, place a `*` and a space before an item. Put each new list item on a new line. Add a space between any supporting text at the beginning of a list.

Example:

[source,adoc]
----
* Priv
* Unpriv
* Debug
----

Example output:

* Priv
* Unpriv
* Debug
Expand All @@ -107,6 +118,15 @@ To create an unordered list, place a `*` and a space before an item. Put each ne

To create an ordered (numbered) list, place a `.` and a space before an item. Put each new list item on a new line. Add a space between any supporting text at the beginning of a list.

[source,adoc]
----
. Priv
. Unpriv
. Debug
----

Example output:

. Priv
. Unpriv
. Debug
Expand All @@ -123,7 +143,7 @@ To create a nested unordered list, use `** ` before the nested item.
* Unpriv
----

Which looks like this:
Example output:

* Priv
** Intro
Expand All @@ -133,20 +153,52 @@ Which looks like this:

To create a nested ordered list, use `.. ` before the nested list item.

[source,adoc]
----
. first item
.. nested item
.. second nested item
. back to original level.
----

Example output:

. first item
.. nested item
.. second nested item
. back to original level.

You can also create an unordered list that contains a nested ordered list (or an ordered list that contains a nested unordered list).

[source,adoc]
----
* unordered item
.. numbered item
.. second numbered item
* another bullet
----

Example output:

* unordered item
.. numbered item
.. second numbered item
* another bullet

==== Add a title to a list

Titles can help introduce your list content.

[source,adoc]
----
.Ordered list
. Priv
. Unpriv
. Debug
----

Example output:

.Ordered list
. Priv
. Unpriv
Expand Down
136 changes: 71 additions & 65 deletions src/blocks_notes_markers.adoc
Original file line number Diff line number Diff line change
@@ -1,69 +1,4 @@
[[blocks_notes_markers]]
=== Sidebars

Sidebars provide for a form of commentary.

[source,adoc]
----
****
This is content in a sidebar block.
image:example-3.svg[]
This is more content in the sidebar block.
****
----

This renders as follows:

****
This is content in a sidebar block.
image:example-3.svg[]
This is more content in the sidebar block.
****


You can add a title, along with any kind of content. Best practice for many of the "commentaries" in the LaTeX source that elucidate the decision-making process is to convert to this format with the `TIP` icon that illustrates a conversation or discussion, as in the following example:

[source,adoc]
----
.Optional Title
****
Sidebars are used to visually separate auxiliary bits of content
that supplement the main text.
TIP: They can contain any type of content, including admonitions like this, and code examples like the following.
.Source code block within a sidebar
[source,js]
/---- (1)
const { expect, expectCalledWith, heredoc } = require('../test/test-utils')
/---- (2)
****
----

1 and 2. Escapes are necessary to preserve this as an AsciiDoc code example.

Once the escapes are removed, the above renders with both the admonition and code blocks within the sidebar:

.Optional Title
****
Sidebars are used to visually separate auxiliary bits of content
that supplement the main text.
TIP: They can contain any type of content, including admonitions like this, and code examples like the following.
.Source code block in a sidebar
[source,js]
----
const { expect, expectCalledWith, heredoc } = require('../test/test-utils')
----
****

=== Admonition blocks

Five kinds of standard admonition blocks are available in AsciiDoc and these can be mapped to either default or custom icons.
Expand Down Expand Up @@ -181,6 +116,11 @@ CAUTION,bf3400,c99a2c
IMPORTANT,bf0000,b58f5b
|===


Testing changing important:



=== Code blocks

AsciiDoc enables code blocks that support syntax highlighting.
Expand Down Expand Up @@ -335,3 +275,69 @@ The hail-and-rainbow protocol can be initiated at three levels:
A bold statement!footnote:disclaimer[Opinions are my own.]

Another outrageous statement.footnote:disclaimer[]

=== Sidebars

Sidebars provide for a form of commentary.

[source,adoc]
----
****
This is content in a sidebar block.
image:example-3.svg[]
This is more content in the sidebar block.
****
----

This renders as follows:

****
This is content in a sidebar block.
image:example-3.svg[]
This is more content in the sidebar block.
****


You can add a title, along with any kind of content. Best practice for many of the "commentaries" in the LaTeX source that elucidate the decision-making process is to convert to this format with the `TIP` icon that illustrates a conversation or discussion, as in the following example:

[source,adoc]
----
.Optional Title
****
Sidebars are used to visually separate auxiliary bits of content
that supplement the main text.
TIP: They can contain any type of content, including admonitions like this, and code examples like the following.
.Source code block within a sidebar
[source,js]
/---- (1)
const { expect, expectCalledWith, heredoc } = require('../test/test-utils')
/---- (2)
****
----

1 and 2. Escapes are necessary to preserve this as an AsciiDoc code example.

Once the escapes are removed, the above renders with both the admonition and code blocks within the sidebar:

.Optional Title
****
Sidebars are used to visually separate auxiliary bits of content
that supplement the main text.
TIP: They can contain any type of content, including admonitions like this, and code examples like the following.
.Source code block in a sidebar
[source,js]
----
const { expect, expectCalledWith, heredoc } = require('../test/test-utils')
----
****
=======
2 changes: 1 addition & 1 deletion src/tables_symbols_math.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Follow these punctuation rules for tables.

The following example shows a simple table with 2 rows and 2 columns. To indicate a new row, put a empty line between them.

[source]
[source,adoc]
----
[cols="1,1"]
|===
Expand Down

0 comments on commit d49b155

Please sign in to comment.