App-pandoc-preprocess

 view release on metacpan or  search on metacpan

ppp-Documentation.tex  view on Meta::CPAN

\end{itemize}

\begin{center}\rule{3in}{0.4pt}\end{center}

\newpage

\section{ditaa Diagrams}\label{ditaa-diagrams}

In order to generate \texttt{ditaa}-diagrams, ditaa needs to be
installed.

For an exhaustive list of options and possibilities, please check the
\href{http://ditaa.sourceforge.net/}{ditaa homepage}.

\subsection{ditaa Options}\label{ditaa-options}

Apart from the \hyperref[general-options]{General Options}, the possible
options specific to ditaa are:

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \texttt{.rounded-corners}
\item
  \texttt{.no-shadows}
\item
  \texttt{.no-antialias}
\item
  \texttt{.no-separation}
\end{itemize}

\subsection{ditaa Examples}\label{ditaa-examples}

Using ditaa, the following markup will produce Figure
\ref{fig:pipeline-overview}.

\scriptsize

\begin{verbatim}
~~~~~ {.ditaa .rounded-corners .no-shadows .scale=90%
       .title="The ppp and pandoc pipeline"
       .label=fig:pipeline-overview 
       .no-antialias .no-separation}
# Caution! These lines actually would have to be on *one* line only!
+-----------------+       +--------+           +--------------------+
| markdown source |------>| ppp    |------*--->| pröcessed markdown |
+-----------------+       +--------+      |    +--------------------+
                              |           \--->| image files        |
                    +------------------+       +--------------------+
                    | diagram creation |
                    +------------------+
                    | ditaa/dot/rdfdot |
                    +------------------+
~~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-1.png}
\caption{``The ppp and pandoc pipeline''\label{fig:pipeline-overview-x}}
\end{figure}

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-2.png}
\caption{``The ppp and pandoc pipeline''\label{fig:pipeline-overview-y}}
\end{figure}

As a contrast, turning off several options, ditaa will produce an output
as in Figure \ref{fig:pipeline-overview-2}:

\scriptsize

\begin{verbatim}
~~~~~ {.ditaa .scale=90% .title="The ppp and pandoc pipeline #2" .label=fig:pipeline-overview-2}
+-----------------+       +--------+           +--------------------+
| markdown source |------>| ppp    |------*--->| pröcessed markdown |
+-----------------+       +--------+      |    +--------------------+
                              |           \--->| image files        |
                    +------------------+       +--------------------+
                    | diagram creation |
                    +------------------+
                    | ditaa/dot/rdfdot |
                    +------------------+
~~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-3.png}
\caption{``The ppp and pandoc pipeline
\#2''\label{fig:pipeline-overview-2}}
\end{figure}

\begin{center}\rule{3in}{0.4pt}\end{center}

\newpage

\hyperdef{}{dot-diagrams}{\section{dot Diagrams}\label{dot-diagrams}}

\texttt{dot} rendering is done through
\href{http://www.graphviz.org/}{GraphViz}'s engine. Please cf.
\href{http://www.graphviz.org/Documentation.php}{Graphviz's
Documentation} for exact usage specifics on the usage of \texttt{dot}.

\hyperdef{}{dot-options}{\subsection{dot Options}\label{dot-options}}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  currently none apart from the \hyperref[general-options]{General
  Options}
\end{itemize}

\subsection{dot Examples}\label{dot-examples}

With \texttt{dot} as the \emph{renderer}, the following markup produces
the figure as seen in Figure \ref{fig:dot-fsa}.

\scriptsize

\begin{verbatim}
~~~~~ {.dot .scale=50% .title=dot Finite State Automaton .label=fig:dot-fsa}
digraph finite_state_machine {
  rankdir=LR;
  node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
  node [shape = circle];
  LR_0 -> LR_2 [ label = "SS(B)" ];
  LR_0 -> LR_1 [ label = "SS(S)" ];
  LR_1 -> LR_3 [ label = "S($end)" ];
  LR_2 -> LR_6 [ label = "SS(b)" ];
  LR_2 -> LR_5 [ label = "SS(a)" ];
  LR_2 -> LR_4 [ label = "S(A)" ];
  LR_5 -> LR_7 [ label = "S(b)" ];
  LR_5 -> LR_5 [ label = "S(a)" ];
  LR_6 -> LR_6 [ label = "S(b)" ];
  LR_6 -> LR_5 [ label = "S(a)" ];
  LR_7 -> LR_8 [ label = "S(b)" ];
  LR_7 -> LR_5 [ label = "S(a)" ];
  LR_8 -> LR_6 [ label = "S(b)" ];
  LR_8 -> LR_5 [ label = "S(a)" ];
}
~~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-4.png}
\caption{dot Finite State Automaton\label{fig:dot-fsa}}
\end{figure}

\begin{center}\rule{3in}{0.4pt}\end{center}

\newpage

\section{neato Diagrams}\label{neato-diagrams}

\texttt{neato} diagrams behave very similarly to
\hyperref[dot-diagrams]{dot Diagrams}. Please cf
\hyperref[dot-diagrams]{dot Diagrams} for more information

\subsection{neato Options}\label{neato-options}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  same as \hyperref[dot-options]{dot Options}
\end{itemize}

\subsection{neato Examples}\label{neato-examples}

The following example produces Figure \ref{fig:neato-diagram}.

\scriptsize

\begin{verbatim}
~~~~~ {.neato .scale=80% .title=neato diagram .label=fig:neato-diagram}
graph G {
  n0 -- n1 -- n2 -- n3 -- n0;
}
~~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-5.png}
\caption{neato diagram\label{fig:neato-diagram}}
\end{figure}

\begin{center}\rule{3in}{0.4pt}\end{center}

\newpage

\section{yUML}\label{yuml}

yUML needs a network connection and uses http://yuml.me as the rendering
service.

\subsection{yUML Options}\label{yuml-options}

Options specific to yUML can be:

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \texttt{.type=}: any of \texttt{{[}} \texttt{class},
  \texttt{activity}, \texttt{usecase} \texttt{{]}}
\item
  \texttt{.style=}: any of \texttt{{[}} \texttt{scruffy},
  \texttt{nofunky}, \texttt{plain} \texttt{{]}}
\item
  \texttt{.direction=}: any of \texttt{{[}} \texttt{LR}, \texttt{RL},
  \texttt{TD}, \texttt{{]}}
\end{itemize}

\subsection{yUML Examples}\label{yuml-examples}

\subsubsection{yUML Class diagrams}\label{yuml-class-diagrams}

With \emph{yUML} as the renderer, setting \texttt{.type=class} and using
the style \texttt{.style=nofunky}, the following markup produces Figure
\ref{fig:yuml-class-diagram}.

\scriptsize

\begin{verbatim}
~~~~ {.yuml .style=nofunky .type=class .direction=LR .scale=100% .title=yUML class diagram .label=fig:yuml-class-diagram}
[Customer] +1 ->        *[Order]
[Order]   ++1 -items>   *[LineItem]
[Order]       -0..1>     [PaymentMethod]
~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-6.png}
\caption{yUML class diagram\label{fig:yuml-class-diagram}}
\end{figure}

\newpage

\subsubsection{yuml Usecase diagrams}\label{yuml-usecase-diagrams}

With \texttt{scruffy} style and \texttt{.type=usecase}, the following
example produces Figure \ref{fig:yuml-usecase-diagram}.

\scriptsize

\begin{verbatim}
~~~~ {.yuml .style=scruffy .type=usecase .title=yUML usecase diagram .label=fig:yuml-usecase-diagram}
// Cool Use Case Diagram
[Customer]-(Make Cup of Tea)
(Make Cup of Tea)<(Add Milk)
(Make Cup of Tea)>(Add Tea Bag)
~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-7.png}
\caption{yUML usecase diagram\label{fig:yuml-usecase-diagram}}
\end{figure}

\newpage

\subsubsection{yuml Activity diagrams}\label{yuml-activity-diagrams}

Lastly, using \texttt{.type=activity} and \texttt{.style=plain} the
following example produces Figure \ref{fig:yuml-activity-diagram}.

\scriptsize

\begin{verbatim}
~~~~ {.yuml .style=plain .type=activity .title=yUML activity Diagram .label=fig:yuml-activity-diagram}
(start)->|a|,|a|->(Make Coffee)->|b|,|a|->(Make Breakfast)->|b|,|b|-><c>[want more coffee]->(Make Coffee),<c>[satisfied]->(end)
~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-8.png}
\caption{yUML activity Diagram\label{fig:yuml-activity-diagram}}
\end{figure}

\begin{center}\rule{3in}{0.4pt}\end{center}

\newpage

\section{plantuml}\label{plantuml}

plantuml -- based on graphviz --, has an extensive feature set

\subsection{plantuml Options}\label{plantuml-options}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \emph{General Options}
\end{itemize}

\subsection{plantuml Examples}\label{plantuml-examples}

\subsubsection{plantuml Example 1}\label{plantuml-example-1}

With \emph{plantuml} as the renderer, the following markup produces
Figure \ref{fig:plantuml-example-1}.

\scriptsize

\begin{verbatim}
~~~~ {.plantuml .scale=60% .title=PlantUML Example 1 .label=fig:plantuml-example-1}
@startuml
scale 350 width
[*] --> NotShooting

state NotShooting {
  [*] --> Idle
  Idle --> Configuring : EvConfig
  Configuring --> Idle : EvConfig
}

state Configuring {
  [*] --> NewValueSelection
  NewValueSelection --> NewValuePreview : EvNewValue
  NewValuePreview --> NewValueSelection : EvNewValueRejected
  NewValuePreview --> NewValueSelection : EvNewValueSaved

  state NewValuePreview {
     State1 -> State2
  }

}
@enduml
~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-9.png}
\caption{PlantUML Example 1\label{fig:plantuml-example-1}}
\end{figure}

\newpage

\subsubsection{plantuml Example 2}\label{plantuml-example-2}

If the colors don't match your taste exactly, add
\texttt{skinparam monochrome true} to retrieve Figure
\ref{fig:plantuml-example-2}.

\scriptsize

\begin{verbatim}
~~~~ {.plantuml .scale=120% .title=PlantUML Example 2 .label=fig:plantuml-example-2}
@startuml

skinparam monochrome true

actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C

User -> A: DoWork
activate A

A -> B: Create Request
activate B

B -> C: DoWork
activate C
C --> B: WorkDone
destroy C

B --> A: Request Created
deactivate B

A --> User: Done
deactivate A

@enduml
~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-10.png}
\caption{PlantUML Example 2\label{fig:plantuml-example-2}}
\end{figure}

\newpage

\begin{center}\rule{3in}{0.4pt}\end{center}

\newpage

\section{rdfdot Diagrams}\label{rdfdot-diagrams}

\subsection{rdfdot Options}\label{rdfdot-options}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  currently none apart from the \hyperref[general-options]{General
  Options}
\end{itemize}

\subsection{rdfdot Examples}\label{rdfdot-examples}

The following example produces Figure \ref{"fig:rdfdot-diagram"} on page
\pageref{"fig:rdfdot-diagram"}.

\scriptsize

\begin{verbatim}
~~~~~ {.rdfdot .scale=150% .title=rdfdot Diagram .label="fig:rdfdot-diagram"}
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@base <http://example.com/> .
<alice> foaf:name "Alice" ;
        foaf:knows [ foaf:name "Bob" ] .
~~~~~
\end{verbatim}

\normalsize

\begin{figure}[htbp]
\centering
\includegraphics{/Users/dbruder/tmp/FQdjc5eyxZ/image-11.png}
\caption{rdfdot Diagram\label{"fig:rdfdot-diagram"}}
\end{figure}

\newpage

\section{List of options}\label{list-of-options}

\begin{longtable}[c]{@{}ccc@{}}
\toprule\addlinespace
\begin{minipage}[b]{0.28\columnwidth}\centering
Renderer
\end{minipage} & \begin{minipage}[b]{0.33\columnwidth}\centering
Option
\end{minipage} & \begin{minipage}[b]{0.25\columnwidth}\centering
possible values
\end{minipage}
\\\addlinespace
\midrule\endhead
\begin{minipage}[t]{0.28\columnwidth}\centering
\emph{General}
\end{minipage} & \begin{minipage}[t]{0.33\columnwidth}\centering
\texttt{.scale}
\end{minipage} & \begin{minipage}[t]{0.25\columnwidth}\centering
e.g. \texttt{120\%}
\end{minipage}
\\\addlinespace
\begin{minipage}[t]{0.28\columnwidth}\centering
\end{minipage} & \begin{minipage}[t]{0.33\columnwidth}\centering
\texttt{.label}
\end{minipage} & \begin{minipage}[t]{0.25\columnwidth}\centering
\texttt{fig:my-figure}
\end{minipage}
\\\addlinespace
\begin{minipage}[t]{0.28\columnwidth}\centering
\end{minipage} & \begin{minipage}[t]{0.33\columnwidth}\centering
\texttt{.title}
\end{minipage} & \begin{minipage}[t]{0.25\columnwidth}\centering
\texttt{"Some label for the figure"}
\end{minipage}
\\\addlinespace
\begin{minipage}[t]{0.28\columnwidth}\centering
ditaa
\end{minipage} & \begin{minipage}[t]{0.33\columnwidth}\centering
\texttt{.rounded-corners}
\end{minipage} & \begin{minipage}[t]{0.25\columnwidth}\centering
\end{minipage}
\\\addlinespace
\begin{minipage}[t]{0.28\columnwidth}\centering
\end{minipage} & \begin{minipage}[t]{0.33\columnwidth}\centering
\texttt{.no-shadows}
\end{minipage} & \begin{minipage}[t]{0.25\columnwidth}\centering
\end{minipage}
\\\addlinespace
\begin{minipage}[t]{0.28\columnwidth}\centering
\end{minipage} & \begin{minipage}[t]{0.33\columnwidth}\centering
\texttt{.no-antialias}
\end{minipage} & \begin{minipage}[t]{0.25\columnwidth}\centering
\end{minipage}
\\\addlinespace
\begin{minipage}[t]{0.28\columnwidth}\centering



( run in 0.642 second using v1.01-cache-2.11-cpan-788537b7465 )