Skip to content

Latest commit

 

History

History
394 lines (306 loc) · 8.2 KB

EXAMPLE.adoc

File metadata and controls

394 lines (306 loc) · 8.2 KB

Asciidoc for Netbeans (Example)

1. Source code

Source code Main with callout
public class Main { (1)
}
  1. Main class

Another source code
public class Testt {
}

2. Listing

Linsting example
This is an example of a paragraph assigned
the `listing` style in an attribute list.
Notice that the monospace marks are
preserved in the output.
Linsting example block
This is a _delimited listing block_.

The content inside is displayed as <pre> text.
Delimited listing block with custom substitutions syntax
This is a _delimited listing block_
with the `subs` attribute assigned
the incremental value `+attributes`.
This attribute reference:

I've been replaced!

will be replaced with the attribute's
value when rendered.

3. Literal

Indicate literal text using an indent
~/secure/vault/defops
Literal style syntax
error: 1954 Forbidden search
absolutely fatal: operation lost in the dodecahedron of doom
Would you like to try again? y/n
Delimited literal block syntax
Kismet: Where is the *defensive operations manual*?

Computer: Calculating ...
Can not locate object.
You are not authorized to know it exists.

Kismet: Did the werewolves tell you to say that?

Computer: Calculating ...

4. Equations and Formulas (STEM)

\$sqrt(4) = 2\$

Water (\$H_2O\$) is a critical component.

A matrix can be written as \$[[a,b],[c,d]]((n),(k))\$.

Delimited stem block syntax
\$sqrt(4) = 2\$
Inline latexmath macro syntax

\(C = \alpha + \beta Y^{\gamma} + \epsilon\)

An e-xciting limit with LaTeX!
\$\lim_{n \to \infty}\frac{n}{\sqrt[n]{n!}} = {\large e}\$
A basic square root with AsciiMath
\$sqrt(4) = 2\$

5. Open Blocks

Open block syntax

An open block can be an anonymous container, or it can masquerade as any other block.

6. Collapsible Blocks

Details

This content is only revealed when the user clicks the block title.

Details
This content is only revealed when the user clicks the block title.
Click to reveal the answer

This is the answer.

Too much detail? Click here.

This content is revealed by default.

If it’s taking up too much space, the reader can hide it.

Show stacktrace
Error: Content repository not found (url: https://git.example.org/repo.git)
    at transformGitCloneError
    at git.clone.then.then.catch
Caused by: HttpError: HTTP Error: 401 HTTP Basic: Access Denied
    at GitCredentialManagerStore.rejected
    at fill.then

7. Sidebar

Simple sidebar example
Sidebars are used to visually separate auxiliary bits of content that supplement the main text.
Block sidebar example

Sidebars are used to visually separate auxiliary bits of content that supplement the main text.

Tip
They can contain any type of content.
Source code block in a sidebar
const { expect, expectCalledWith, heredoc } = require('../test/test-utils')

8. Example

Example 1. Optional title
This is an example of an example block.
Example 2. Onomatopoeia

The book hit the floor with a thud.

He could hear doves cooing in the pine trees’ branches.

9. Diagram

9.1. PlantUML

Plant uml demo png (show real file in target/asciidoc4netbeans)
class BlockProcessor
class DiagramBlock
class DitaaBlock
class PlantUmlBlock

BlockProcessor <|-- DiagramBlock
DiagramBlock <|-- DitaaBlock
DiagramBlock <|-- PlantUmlBlock
Plant uml demo svg (show real file in target/asciidoc4netbeans)
class BlockProcessor
class DiagramBlock
class DitaaBlock
class PlantUmlBlock

BlockProcessor <|-- DiagramBlock
DiagramBlock <|-- DitaaBlock
DiagramBlock <|-- PlantUmlBlock

9.2. Ditaa

Ditaa diagram demo
    +--------+   +-------+    +-------+
    |        | --+ ditaa +--> |       |
    |  Text  |   +-------+    |diagram|
    |Document|   |!magic!|    |       |
    |     {d}|   |       |    |       |
    +---+----+   +-------+    +-------+
        :                         ^
        |       Lots of work      |
        +-------------------------+

10. Quote

Quote or excerpt text
— attribution
citation title and information
After landing the cloaked Klingon bird of prey in Golden Gate park:
Everybody remember where we parked.
— Captain James T. Kirk
Star Trek IV: The Voyage Home
Block quote

Dennis: Come and see the violence inherent in the system. Help! Help! I’m being repressed!

King Arthur: Bloody peasant!

Dennis: Oh, what a giveaway! Did you hear that? Did you hear that, eh? That’s what I’m on about! Did you see him repressing me? You saw him, Didn’t you?

— Monty Python and the Holy Grail
Quoted paragraph
I hold it that a little rebellion now and then is a good thing, and as necessary in the political world as storms in the physical.
— Thomas Jefferson
Papers of Thomas Jefferson: Volume 11
Markdown-style blockquotes

I hold it that a little rebellion now and then is a good thing, and as necessary in the political world as storms in the physical.

— Thomas Jefferson
Papers of Thomas Jefferson: Volume 11
Markdown-style blockquote containing block content

What’s new?

I’ve got Markdown in my AsciiDoc!

Like what?

  • Blockquotes

  • Headings

  • Fenced code blocks

Is there more?

Yep. AsciiDoc and Markdown share a lot of common syntax already.

11. Verse

The fog comes
on little cat feet.
— Carl Sandburg
two lines from the poem Fog
The fog comes
on little cat feet.

It sits looking
over harbor and city
on silent haunches
and then moves on.
— Carl Sandburg
Fog

12. Admonition

Note
Admonition NOTE paragraph syntax
note example
Tip
Admonition TIP paragraph syntax
note example
Caution
Admonition CAUTION paragraph syntax
note example
Warning
Admonition paragraph syntax
Wolpertingers are known to nest in server racks. Enter at your own risk.
Important
Feeding the Werewolves

While werewolves are hardy community members, keep in mind the following dietary concerns:

  1. They are allergic to cinnamon.

  2. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.

  3. Celery makes them sad.

13. Lists

Unordered list
  • West wood maze

    • Maze heart

      • Reflection pool

    • Secret exit

  • Untracked file in git repository

  • Untracked file in git repository

Ordered list
  1. Protons

  2. Electrons

  3. Neutrons

Checklists
  • ✓ checked

  • ✓ also checked

  • ❏ not checked

  • normal list item

Description Lists
CPU

The brain of the computer.

Hard drive

Permanent storage for operating system and/or user files.

RAM

Temporarily stores information the CPU uses during operation.

Keyboard

Used to enter text or control items on the screen.

Mouse

Used to point to and select items on your computer screen.

Monitor

Displays information in visual form using text and graphics.

Description Lists (horizontal)
CPU

The brain of the computer.

Hard drive

Permanent storage for operating system and/or user files.

RAM

Temporarily stores information the CPU uses during operation.

14. Foonotes

The hail-and-rainbow protocol can be initiated at five levels:

  1. double[1]

  2. tertiary

  3. supernumerary

  4. supermassive

  5. apocalyptic

15. Table

Table 1. Table example with header, footer and stripes rows
Header 1 Header 2 Header 3

cell 1

cell 2

cell 3

cell 4

cell 5

cell 6

cell 7

cell 8

cell 9

cell 10

cell 11

cell 12

footer 1

footer 2

footer 3


1. The double hail-and-rainbow level makes my toes tingle.