62 lines
1.7 KiB
ReStructuredText
62 lines
1.7 KiB
ReStructuredText
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.
|