
\begin{DoxyItemize}
\item infos = Information about the yawn plugin is in keys below
\item infos/author = René Schwaiger \href{mailto:sanssecours@me.com}{\tt sanssecours@me.\+com}
\item infos/licence = B\+SD
\item infos/needs = directoryvalue yamlsmith
\item infos/provides = storage/yaml
\item infos/recommends =
\item infos/placements = getstorage
\item infos/status = maintained unittest preview experimental unfinished nodoc concept discouraged
\item infos/metadata =
\item infos/description = This storage plugin uses an Earley parser to read Y\+A\+ML files
\end{DoxyItemize}\hypertarget{autotoc_md943_src_plugins_yawn_README_md}{}\section{Y\+Awn}\label{autotoc_md943_src_plugins_yawn_README_md}
\hypertarget{autotoc_md943_autotoc_md944}{}\subsection{Introduction}\label{autotoc_md943_autotoc_md944}
This plugin uses \href{https://github.com/vnmakarov/yaep}{\tt Y\+A\+EP} to parse \href{http://yaml.org}{\tt Y\+A\+ML} data.\hypertarget{autotoc_md943_autotoc_md945}{}\subsection{Dependencies}\label{autotoc_md943_autotoc_md945}
This plugin requires \href{https://github.com/vnmakarov/yaep#installing}{\tt Y\+A\+EP}.\hypertarget{autotoc_md943_autotoc_md946}{}\subsection{Examples}\label{autotoc_md943_autotoc_md946}
\hypertarget{autotoc_md943_autotoc_md947}{}\subsubsection{Mappings}\label{autotoc_md943_autotoc_md947}

\begin{DoxyCode}
# Mount plugin
sudo kdb mount config.yaml user/tests/yawn yawn

# Set and retrieve some basic values
kdb set user/tests/yawn 'is obviously a move introduced in Generation III of Pokemon' # Source: Bulbapedia
kdb set user/tests/yawn/ing 'is something similar'

kdb get user/tests/yawn/
#> is obviously a move introduced in Generation III of Pokemon
kdb get user/tests/yawn/ing
#> is something similar

kdb ls user/tests/yawn
#> user/tests/yawn
#> user/tests/yawn/ing

# Undo modifications
kdb rm -r user/tests/yawn
sudo kdb umount user/tests/yawn
\end{DoxyCode}
\hypertarget{autotoc_md943_autotoc_md948}{}\subsubsection{Arrays}\label{autotoc_md943_autotoc_md948}

\begin{DoxyCode}
# Mount plugin
sudo kdb mount config.yaml user/tests/yawn yawn

kdb set user/tests/yawn/movies
kdb set user/tests/yawn/movies/#0 'YAwn I: Time to Wake Up'
kdb set user/tests/yawn/movies/#1 'YAwn II: The Awakening'
kdb set user/tests/yawn/movies/#2 'YAwn III: The Sleepover'
kdb set user/tests/yawn/movies/#3 'YAwn IV: YAwn Again'

# Retrieve last array index
kdb getmeta user/tests/yawn/movies array
#> #3

kdb get user/tests/yawn/movies/#1
#> YAwn II: The Awakening

# Undo modifications
kdb rm -r user/tests/yawn
sudo kdb umount user/tests/yawn
\end{DoxyCode}
\hypertarget{autotoc_md943_autotoc_md949}{}\subsubsection{Boolean Values}\label{autotoc_md943_autotoc_md949}
``` \hypertarget{autotoc_md943_autotoc_md950}{}\section{Mount plugin}\label{autotoc_md943_autotoc_md950}
sudo kdb mount config.\+yaml user/tests/yawn yawn\hypertarget{autotoc_md943_autotoc_md951}{}\section{Manually add a boolean value to the database}\label{autotoc_md943_autotoc_md951}
printf \textquotesingle{}bool\+: true\textquotesingle{} $>$ {\ttfamily kdb file user/tests/yawn}\hypertarget{autotoc_md943_autotoc_md952}{}\section{Elektra stores boolean values as `0` and `1`}\label{autotoc_md943_autotoc_md952}
kdb get user/tests/yawn/bool \#$>$ 1\hypertarget{autotoc_md943_autotoc_md953}{}\section{Undo modifications to the key database}\label{autotoc_md943_autotoc_md953}
kdb rm -\/r user/tests/yawn sudo kdb umount user/tests/yawn 
\begin{DoxyCode}
### Error Messages
\end{DoxyCode}
 \hypertarget{autotoc_md943_autotoc_md954}{}\section{Mount plugin}\label{autotoc_md943_autotoc_md954}
sudo kdb mount config.\+yaml user/tests/yawn yawn\hypertarget{autotoc_md943_autotoc_md955}{}\section{Manually add data containing syntax errors}\label{autotoc_md943_autotoc_md955}
printf -- \textquotesingle{}Brutus\+: ~\newline
\textquotesingle{} $>$ {\ttfamily kdb file user/tests/yawn} printf -- \textquotesingle{}-\/ Burst~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yawn} \# Incorrect indentation printf -- \textquotesingle{} Holon \+: Anamnesis\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yawn} \# Either incorrect indentation or line above should be removed\hypertarget{autotoc_md943_autotoc_md956}{}\section{Try to retrieve data}\label{autotoc_md943_autotoc_md956}
kdb ls user/tests/yawn \hypertarget{autotoc_md943_autotoc_md957}{}\section{R\+E\+T\+: 5}\label{autotoc_md943_autotoc_md957}
\hypertarget{autotoc_md943_autotoc_md958}{}\section{Let us look at the error message more closely.}\label{autotoc_md943_autotoc_md958}
\hypertarget{autotoc_md943_autotoc_md959}{}\section{Since the location of `config.\+yaml` depends on the current user and O\+S,}\label{autotoc_md943_autotoc_md959}
\hypertarget{autotoc_md943_autotoc_md960}{}\section{we store the text before `config.\+yaml` as `user/tests/error/prefix`.}\label{autotoc_md943_autotoc_md960}
kdb set user/tests/error \char`\"{}\$(2$>$\&1 kdb ls user/tests/yawn)\char`\"{} kdb set user/tests/error/prefix \char`\"{}\$(kdb get user/tests/error $\vert$ grep \textquotesingle{}config.\+yaml\textquotesingle{} $\vert$ head -\/1 $\vert$ sed -\/\+E \textquotesingle{}s/(.$\ast$)config.\+yaml.$\ast$/\textbackslash{}1/\textquotesingle{})\char`\"{} \hypertarget{autotoc_md943_autotoc_md961}{}\section{We also store the length of the prefix, so we can remove it from every}\label{autotoc_md943_autotoc_md961}
\hypertarget{autotoc_md943_autotoc_md962}{}\section{line of the error message.}\label{autotoc_md943_autotoc_md962}
kdb set user/tests/error/prefix/length \char`\"{}\$(kdb get user/tests/error/prefix $\vert$ wc -\/c $\vert$ sed \textquotesingle{}s/\mbox{[} \mbox{]}$\ast$//g\textquotesingle{})\char`\"{}\hypertarget{autotoc_md943_autotoc_md963}{}\section{Since we only want to look at the “reason” of the error, we}\label{autotoc_md943_autotoc_md963}
\hypertarget{autotoc_md943_autotoc_md964}{}\section{remove the other part of the error message with `head` and `tail`.}\label{autotoc_md943_autotoc_md964}
kdb get user/tests/error $\vert$ tail -\/n6 $\vert$ cut -\/c\char`\"{}\$(kdb get user/tests/error/prefix/length)\char`\"{}-\/ \#$>$ config.\+yaml\+:2\+:1\+: Syntax error on input “-\/” \#$>$ -\/ Burst \#$>$ $^\wedge$ \#$>$ config.\+yaml\+:3\+:19\+: Syntax error on input “end of map” \#$>$ Holon \+: Anamnesis \#$>$ $^\wedge$\hypertarget{autotoc_md943_autotoc_md965}{}\section{Fix syntax errors}\label{autotoc_md943_autotoc_md965}
printf -- \textquotesingle{}Brutus\+: ~\newline
\textquotesingle{} $>$ {\ttfamily kdb file user/tests/yawn} printf -- \textquotesingle{} -\/ Burst~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yawn} printf -- \textquotesingle{}Holon \+: Anamnesis\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yawn} kdb ls user/tests/yawn \#$>$ user/tests/yawn/\+Brutus \#$>$ user/tests/yawn/\+Brutus/\#0 \#$>$ user/tests/yawn/\+Holon\hypertarget{autotoc_md943_autotoc_md966}{}\section{Undo modifications}\label{autotoc_md943_autotoc_md966}
kdb rm -\/r user/tests/error kdb rm -\/r user/tests/yawn sudo kdb umount user/tests/yawn ```\hypertarget{autotoc_md943_autotoc_md967}{}\subsection{Limitations}\label{autotoc_md943_autotoc_md967}
The plugin has the same limitations as \hyperlink{autotoc_md797_src_plugins_yambi_README_md}{Y\+A\+M\+Bi }. 