////

  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      https://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

////

include::_settings.adoc[]
:presenter_name: Some Cool Person
:presenter_company: Apache Software Foundation

== Example Presentation
Doc Writer <cool.person@apache.org>
{docdate}
:revnumber: {project-version}
:example-caption!:

== Introduction

[%step]
* This is a presentation for an example project.
* This project does something.
* We just haven't decided what that is yet.

== Speaker Notes

Press the `*s*` key to access speaker notes.

[NOTE.speaker]
--
You've unlocked the super secret notes area.
Neat huh?
--

== Blank screen

You can press `*b*` or `*.*` to blank your current screen.

Hit it again to bring it back.

== Overview

Press the `*esc*` key to get an overview of your slides.

== Attributes

Press the down arrow key to see the next sub-slide.

=== Attributes Part 1
.Built-in
asciidoctor-version:: {asciidoctor-version}
safe-mode-name:: {safe-mode-name}
docdir:: {docdir}
docfile:: {docfile}
imagesdir:: {imagesdir}

=== Attributes Part 2
.Custom
project-version:: {project-version}
sourcedir:: {sourcedir}

== Including documents from subdir

.include::subdir/_b.adoc[]

include::subdir/_b.adoc[]

== Images

[.thumb]
image::logo-apache.png[scaledwidth=75%]

== Videos

Play videos from Youtube, or locally

video::BKorP55Aqvg[youtube, width=640, height=480]

== Lists

Asciidoctor allows a wide variety of list option.

For details see the documentation starting at: http://asciidoctor.org/docs/user-manual/#unordered-lists

Press the down arrow key to see the some examples.

=== Unordered List

* Protons
* Electrons
* Neutrons

=== Ordered List

. Protons
. Electrons
. Neutrons

=== Nested List

Nest lists, by duplicating the list-char

* Protons
** Electrons
* Neutrons

== Tables

[cols="2*", options="header"]
|===
| Header A | Header B
| Cell A1 | Cell B1
| Cell A2 | Cell B2
| Cell A3 | Cell B3
|===

== Source Code

[source,java]
.Java code from project
----
include::{sourcedir}/${packageInPathFormat}/StringUtils.java[tags=contains,indent=0]
----

== Two columns

[.west]
* Blah
* Blah
* Blah
* Blah
* Blah

[.east]
* Blah
* Blah
* Blah
* Blah
* Blah

== Fontawesome Icons

* icon:check[role=green]
* icon:wrench[]
* icon:beer[role=orange]

[NOTE.speaker]
--
* Find icons here: https://fontawesome.com/v4.7.0/icons/
* Color icons by defining css styles in apache.css and referencing them with "role"
--

== Diagrams

Press the down arrow key to see the different types of diagrams

=== Ditaa Diagram

[ditaa,asciidoctor-diagram-process]
....
                   +-------------+
                   | Asciidoctor |-------+
                   |   diagram   |       |
                   +-------------+       | PNG out
                       ^                 |
                       | ditaa in        |
                       |                 v
 +--------+   +--------+----+    /---------------\
 |        |---+ Asciidoctor +--->|               |
 |  Text  |   +-------------+    |   Beautiful   |
 |Document|   |   !magic!   |    |    Output     |
 |     {d}|   |             |    |               |
 +---+----+   +-------------+    \---------------/
     :                                   ^
     |          Lots of work             |
     +-----------------------------------+
....

=== PlantUML Diagram

[plantuml,auth-protocol]
....
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
....

=== GraphVIZ Diagram

[graphviz, dot-example, svg]
----
digraph g {
    a -> b
    b -> c
    c -> d
    d -> a
}
----

=== Seqdiag Diagram

[seqdiag,s7-communication,svg]
....
{
    A -> B -> C;
         B -> D;
}
....

=== Blockdiag Diagram

[blockdiag,blockdiag-test]
....
{
   A -> B -> C -> D;
   A -> E -> F -> G;
}
....

=== Actdiag Diagram

[actdiag,actdiag-test]
....
{
  write -> convert -> image

  lane user {
     label = "User"
     write [label = "Writing reST"];
     image [label = "Get diagram IMAGE"];
  }
  lane actdiag {
     convert [label = "Convert reST to Image"];
  }
}
....

=== Nwdiag Diagram

[nwdiag,nwdiag-test]
....
{
  network dmz {
      address = "210.x.x.x/24"

      web01 [address = "210.x.x.1"];
      web02 [address = "210.x.x.2"];
  }
  network internal {
      address = "172.x.x.x/24";

      web01 [address = "172.x.x.1"];
      web02 [address = "172.x.x.2"];
      db01;
      db02;
  }
}
....

=== Rackdiag Diagram

[rackdiag,rackdiag-test]
....
{
  // Change order of rack-number as ascending
  ascending;

  // define height of rack
  12U;

  // define description of rack
  description = "Tokyo/1234 East";

  // define rack units
  1: UPS [2U];   // define height of unit
  3: DB Server [5kg]  // define weight of unit
  4: Web Server [0.5A]  // define ampere of unit
  5: Web Server
  6: Web Server
  7: Load Balancer
  8: L3 Switch
}
....

=== Packetdiag Diagram

[packetdiag,packetdiag-test,svg]
....
{
  colwidth = 32
  node_height = 72

  0-15: Source Port
  16-31: Destination Port
  32-63: Sequence Number
  64-95: Acknowledgment Number
  96-99: Data Offset
  100-105: Reserved
  106: URG [rotate = 270]
  107: ACK [rotate = 270]
  108: PSH [rotate = 270]
  109: RST [rotate = 270]
  110: SYN [rotate = 270]
  111: FIN [rotate = 270]
  112-127: Window
  128-143: Checksum
  144-159: Urgent Pointer
  160-191: (Options and Padding)
  192-223: data [colheight = 3]
}
....

=== Meme Diagram

meme::../resources/images/toddy.jpg[May the Source,Be With You]

=== Entity Relation Diagram

[erd,erd-test,svg]
....
[Person]
*name
height
weight
+birth_location_id

[Location]
*id
city
state
country

# Cardinality    Syntax
# 0 or 1         ?
# exactly 1      1
# 0 or more      *
# 1 or more      +
Person *--1 Location
....

[NOTE.speaker]
--
--

////
=== Mermaid: Flowchart

mermaid::diagrams/mermaid-flowchart-test.mmd[png]

[NOTE.speaker]
--
--

=== Mermaid: Sequence Diagram

[mermaid,"mermaid-sequence-diagram-test",svg]
....
sequenceDiagram
    participant Alice
    participant Bob
    Alice->John: Hello John, how are you?
    loop Healthcheck
        John->John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail...
    John-->Alice: Great!
    John->Bob: How about you?
    Bob-->John: Jolly good!
....

=== Mermaid: Gant Diagram

[mermaid,mermaid-gant-diagram-test,svg]
....
gantt
        dateFormat  YYYY-MM-DD
        title Adding GANTT diagram functionality to mermaid
        section A section
        Completed task            :done,    des1, 2014-01-06,2014-01-08
        Active task               :active,  des2, 2014-01-09, 3d
        Future task               :         des3, after des2, 5d
        Future task2               :         des4, after des3, 5d
        section Critical tasks
        Completed task in the critical line :crit, done, 2014-01-06,24h
        Implement parser and jison          :crit, done, after des1, 2d
        Create tests for parser             :crit, active, 3d
        Future task in critical line        :crit, 5d
        Create tests for renderer           :2d
        Add to mermaid                      :1d
....
////

=== SVGBob: Mindmap

[svgbob,svgbob-mindmap-test,svg]
....
                                            .-->  Alpha
                                           /
                                          .---->  Initial Release
          Planning *-------.             /         \
                            \           /           '---> Patch 1
      Initial research       \         /             \
                *             \       /               '-->  Patch 2
                 \             \     .---------> Beta
                  \             \   /
                   \             o o                      _______
                    \          .---. o--.___             /       \
                     '------> (     )       '----*--->  . Release .
                               `---' o                   \_______/
                               o  o o \
                              /    \ \ \
                          .--'      \ \ \
                         /           \ \ '----+->  Push backs
                        .             \ \      \
                       /|              \ \      '----> Setbacks
                      / .               \ \
                     V /|                \ '-----> Reception
                Team  / .                 \
                     v /|                  \
             Worklaod / .                   '-->> Career change
                     V /
                 PTO  /
                     V
                 Bug
....

=== SVGBob: Circuit Diagram

[svgbob,svgbob-circuit-diagram-test,svg]
....
     +10-15V           ___0,047R
      *------o------o-|___|-o--o---------o----o-------.
             |      |       |  |         |    |       |
            ---     |       | .+.        |    |       |
      470uF  | +    |       | | |        |    |      .+.
      *------o      '--.    | '+'       .+.   |      '-'
             |         |6   |7 |8    1k | |   |       |
            GND      .-+----+--+--.     | |   |       |
                     |            |     '+'   |       |
                     |            |1     |  |/  BC    |
                     |            +------o--+   547   |
                     |            |      |  |`>       |
                     |            |     ,+.   |       |
                     |            | 220R| |   o----||-+  IRF9Z34
                     |            |     | |   |    |+->
                     |  MC34063   |     `+'   |    ||-+
                     |            |      |    |       |  BYV29     -12V6
                     |            |      '----'       o--|<-o----o--X OUT
                     |            |2                  |     |    |
                     |            |--o                C|    |    |
                     |            | GND         30uH  C|    |   --- 470
                     |            |3      1nF         C|    |
                     |            |-------||--.       |     |    | +
                     '-----+----+-'           |      GND    |   GND
                          5|   4|             |             |
                           |    '-------------o-------------o
                           |                           ___  |
                           '------/\/\/------------o--|___|-'
                                                   |       1k0
                                                  .+.
                                                  | | 5k6 + 3k3
                                                  | | in Serie
                                                  '+'
                                                   |
                                                  GND
....

=== Syntrax

[syntrax,syntrax-test,svg]
....
indentstack(10,
  line(opt('-'), choice('0', line('1-9', loop(None, '0-9'))),
    opt('.', loop('0-9', None))),

  line(opt(choice('e', 'E'), choice(None, '+', '-'), loop('0-9', None)))
)
....

////
=== Umlet

[umlet,umlet-test,svg]
....
<?xml version="1.0" encoding="UTF-8"?><umlet_diagram><element><type>com.umlet.element.base.Relation</type><coordinates><x>739</x><y>16</y><w>232</w><h>264</h></coordinates><panel_attributes>lt=&lt;-
when(spidersensor="rotate")
/block spider</panel_attributes><additional_attributes>161;244;161;34;71;34;71;74</additional_attributes></element><element><type>com.umlet.element.custom.FinalState</type><coordinates><x>890</x><y>260</y><w>20</w><h>20</h></coordinates><panel_attributes></panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>750</x><y>170</y><w>160</w><h>137</h></coordinates><panel_attributes>lt=&lt;-
after (10s)
/ block spider</panel_attributes><additional_attributes>140;100;66;100;66;20</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>340</x><y>420</y><w>100</w><h>40</h></coordinates><panel_attributes>wait</panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.custom.HistoryState</type><coordinates><x>230</x><y>440</y><w>20</w><h>20</h></coordinates><panel_attributes></panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>230</x><y>416</y><w>130</w><h>54</h></coordinates><panel_attributes>lt=&lt;-
restart</panel_attributes><additional_attributes>20;34;110;34</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>270</x><y>396</y><w>90</w><h>54</h></coordinates><panel_attributes>lt=&lt;-
pause</panel_attributes><additional_attributes>70;34;20;34</additional_attributes></element><element><type>com.umlet.element.custom.FinalState</type><coordinates><x>90</x><y>400</y><w>20</w><h>20</h></coordinates><panel_attributes></panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>46</x><y>256</y><w>114</w><h>164</h></coordinates><panel_attributes>lt=&lt;-
after (10s)
/timeout</panel_attributes><additional_attributes>54;144;54;34;94;34</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>230</x><y>110</y><w>190</w><h>170</h></coordinates><panel_attributes>lt=&lt;-
timeout</panel_attributes><additional_attributes>20;150;110;150;110;20;170;20</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>700</x><y>90</y><w>180</w><h>100</h></coordinates><panel_attributes>accept
boarding pass
--
entry/ release card
do/release spider</panel_attributes><additional_attributes>transparentSelection=true</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>540</x><y>140</y><w>205</w><h>100</h></coordinates><panel_attributes>lt=&lt;-
[passenger booked]</panel_attributes><additional_attributes>160;20;120;80;20;80</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>450</x><y>210</y><w>239</w><h>190</h></coordinates><panel_attributes>lt=&lt;-
[passenger not booked]</panel_attributes><additional_attributes>219;170;99;170;99;20</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>670</x><y>350</y><w>120</w><h>50</h></coordinates><panel_attributes>reject
boarding pass</panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>480</x><y>130</y><w>142</w><h>100</h></coordinates><panel_attributes>lt=&lt;-
result of search</panel_attributes><additional_attributes>71;80;71;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>270</x><y>70</y><w>150</w><h>40</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>130;20;20;20</additional_attributes></element><element><type>com.umlet.element.custom.ThreeWayRelation</type><coordinates><x>540</x><y>210</y><w>20</w><h>20</h></coordinates><panel_attributes></panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>140</x><y>60</y><w>150</w><h>420</h></coordinates><panel_attributes>read boarding pass
--</panel_attributes><additional_attributes>transparentSelection=true</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>400</x><y>60</y><w>180</w><h>90</h></coordinates><panel_attributes>check passenger
--
entry/start search
do/blink lamp</panel_attributes><additional_attributes>transparentSelection=true</additional_attributes></element><element><type>com.umlet.element.custom.FinalState</type><coordinates><x>170</x><y>410</y><w>20</w><h>20</h></coordinates><panel_attributes></panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>150</x><y>240</y><w>100</w><h>40</h></coordinates><panel_attributes>read
passenger ID</panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>150</x><y>330</y><w>100</w><h>40</h></coordinates><panel_attributes>identify
passenger</panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>160</x><y>260</y><w>40</w><h>90</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>20;70;20;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>160</x><y>100</y><w>40</w><h>70</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>20;50;20;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>160</x><y>350</y><w>40</w><h>80</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>20;60;20;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>140</x><y>170</y><w>78</w><h>90</h></coordinates><panel_attributes>lt=&lt;-
[valid]</panel_attributes><additional_attributes>39;70;39;20</additional_attributes></element><element><type>com.umlet.element.custom.State</type><coordinates><x>150</x><y>150</y><w>100</w><h>40</h></coordinates><panel_attributes>check
validity</panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element><element><type>com.umlet.element.custom.InitialState</type><coordinates><x>170</x><y>100</y><w>20</w><h>20</h></coordinates><panel_attributes></panel_attributes><additional_attributes>transparentSelection=false</additional_attributes></element></umlet_diagram>
....
////

////
=== Vega

[vega,vega-test,svg]
....
{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "width": 1000,
  "height": 500,
  "padding": 5,

  "data": [
    {
      "name": "iot-riskks1",
      "values": [
        {"cheese": "Security", "amount": 43},
        {"cheese": "IT/OT Integration", "amount": 30},
        {"cheese": "Unclear ROI", "amount": 28},
        {"cheese": "Technical Expertise", "amount": 26},
        {"cheese": "Interoperability", "amount": 26},
        {"cheese": "Data Portability", "amount": 24},
        {"cheese": "Vendor Risk", "amount": 22},
        {"cheese": "Transition Risk", "amount": 22},
        {"cheese": "Legal/regulatory issues", "amount": 22},
        {"cheese": "Network constraints", "amount": 21},
        {"cheese": "Vendor lock-in", "amount": 18}
      ]
    }
  ],

  "scales": [
    {
      "name": "xscale",
      "type": "band",
      "domain": {"data": "iot-riskks1", "field": "cheese"},
      "range": "width",
      "padding": 0.05,
      "round": true
    },
    {
      "name": "yscale",
      "domain": {"data": "iot-riskks1", "field": "amount"},
      "nice": true,
      "range": "height"
    }
  ],

  "marks": [
    {
      "type": "rect",
      "from": {"data":"iot-riskks1"},
      "encode": {
        "enter": {
          "x": {"scale": "xscale", "field": "cheese"},
          "width": {"scale": "xscale", "band": 1},
          "y": {"scale": "yscale", "field": "amount"},
          "y2": {"scale": "yscale", "value": 0}
        },
        "update": {
          "fill": {"value": "steelblue"}
        }
      }
    }
  ]
}
....
////

== Embedded HTML/JavaScript

++++
  <div id="iot-riskks1"></div>
  <script type="text/javascript">
c3.generate({
  bindto: '#iot-riskks1',
  size: { height: 500, width: 1000 },
  data: {
    x: 'x',
    columns: [
        ['x','Security','IT/OT Integration','Unclear ROI', 'Technical Expertise', 'Interoperability', 'Data Portability', 'Vendor Risk', 'Transition Risk', 'Legal/regulatory issues', 'Network constraints', 'Vendor lock-in'],
        ['%',43, 30, 28, 26, 26, 24, 22, 22, 22, 21, 18]
    ],
    type: 'bar'
  },
  axis: {
    rotated: true,
    x: {
      type: 'category',
      tick: {
        rotate: -90
      }
    }
  }
});
</script>
++++
