New manpage for the library stuff

Added an own manpage for libraries. Also did some things around it ..
This commit is contained in:
matze 2020-07-30 09:56:18 +02:00
parent f2e589f2f8
commit af1dfdebda
3 changed files with 63 additions and 0 deletions

View file

@ -0,0 +1,61 @@
Library
=======
Description
-----------
The library features the sharing of common code. There is a global and
a type library to match the specific use case.
The library feature is simply making the path to the library folder
available to all scripts. With it, they can load files out of the library
from different locations. Through it, code must only written once, which
makes code easier and less redundant. Also, better code can be provided
by shared libraries.
Synopsis
--------
From `manifest`, `gencode-*` and `code-local`:
.. code-block::
$__library (global library directory path)
$__type/library (type library folder)
From the remote side (`explorer` and `code-remote`):
.. code-block::
$__library (remote copied library directory path)
$__type_library (remote copied type library folder)
*Type libraries are only available if the code is available in an object-
realated content. As example, there are not available in global explorer
or the initial manifest.*
How to use
----------
Because the library features only distribute files, it's not bond to
`posix shell scripts` or any programming or scripting language. To use
the library, you only need to load the library from the given path.
In shell scripts, it works as follow (here as a `type manifest`):
.. code-block:: sh
# loading a global library
. "$__library/manifest"
# loading type library
. "$__type/library/foo-bar"
# now, sourced shell functions can be used
# ...
Remote handling
---------------
The libraries may also required on the remote side. For this, the
library is completly copied to the remote. Therefor, it's completly
available on the remote side and can be used in the explorers and
generated remote code.

View file

@ -106,6 +106,7 @@ A type consists of
- explorer (optional) - explorer (optional)
- gencode (optional) - gencode (optional)
- nonparallel (optional) - nonparallel (optional)
- library (optional)
Types are stored below cdist/conf/type/. Their name should always be prefixed with Types are stored below cdist/conf/type/. Their name should always be prefixed with
two underscores (__) to prevent collisions with other executables in $PATH. two underscores (__) to prevent collisions with other executables in $PATH.

View file

@ -30,6 +30,7 @@ It natively supports IPv6 since the first release.
cdist-type cdist-type
cdist-types cdist-types
cdist-explorer cdist-explorer
cdist-library
cdist-messaging cdist-messaging
cdist-parallelization cdist-parallelization
cdist-inventory cdist-inventory