Skip to content

Commit

Permalink
Build site, documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lovestaco committed Jul 22, 2023
1 parent e606b8c commit 2a2ddf9
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 46 deletions.
Binary file added docs/Lama2/site/explanation/l2configAtRoot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Lama2/site/explanation/l2env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 58 additions & 41 deletions docs/Lama2/site/explanation/l2format.html
Original file line number Diff line number Diff line change
Expand Up @@ -531,44 +531,51 @@
</li>

<li class="md-nav__item">
<a href="#environment-variables-switch-base-url" class="md-nav__link">
Environment Variables: Switch base URL
</a>

<nav class="md-nav" aria-label="Environment Variables: Switch base URL">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#api-variables-can-be-defined-in-apirequestl2" class="md-nav__link">
API variables can be defined in apirequest.l2
</a>

</li>

<li class="md-nav__item">
<li class="md-nav__item">
<a href="#api-environment-variables-can-be-defined-locally-in-l2env" class="md-nav__link">
API environment variables can be defined locally in l2.env
</a>

</li>

<li class="md-nav__item">
<a href="#api-environment-variables-can-be-defined-at-root-using-l2configenv" class="md-nav__link">
API environment variables can be defined at root using l2config.env
<li class="md-nav__item">
<a href="#api-environment-variables-can-be-defined-at-project-root-using-l2configenv" class="md-nav__link">
API environment variables can be defined at project root using l2config.env
</a>

</li>

<li class="md-nav__item">
<a href="#if-l2configenvroot-variables-are-redeclared-in-l2envlocal" class="md-nav__link">
If l2config.env(root) variables are redeclared in l2.env(local)
</a>

<nav class="md-nav" aria-label="If l2config.env(root) variables are redeclared in l2.env(local)">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#the-environment-file-can-load-results-of-commands" class="md-nav__link">
The environment file can load results of commands
<a href="#if-l2configenvroot-variables-are-redeclared-in-l2envlocal" class="md-nav__link">
If l2config.env(root) variables are redeclared in l2.env(local)
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#the-environment-file-can-load-results-of-commands" class="md-nav__link">
The environment file can load results of commands
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -857,44 +864,51 @@
</li>

<li class="md-nav__item">
<a href="#environment-variables-switch-base-url" class="md-nav__link">
Environment Variables: Switch base URL
</a>

<nav class="md-nav" aria-label="Environment Variables: Switch base URL">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#api-variables-can-be-defined-in-apirequestl2" class="md-nav__link">
API variables can be defined in apirequest.l2
</a>

</li>

<li class="md-nav__item">
<li class="md-nav__item">
<a href="#api-environment-variables-can-be-defined-locally-in-l2env" class="md-nav__link">
API environment variables can be defined locally in l2.env
</a>

</li>

<li class="md-nav__item">
<a href="#api-environment-variables-can-be-defined-at-root-using-l2configenv" class="md-nav__link">
API environment variables can be defined at root using l2config.env
<li class="md-nav__item">
<a href="#api-environment-variables-can-be-defined-at-project-root-using-l2configenv" class="md-nav__link">
API environment variables can be defined at project root using l2config.env
</a>

</li>

<li class="md-nav__item">
<a href="#if-l2configenvroot-variables-are-redeclared-in-l2envlocal" class="md-nav__link">
If l2config.env(root) variables are redeclared in l2.env(local)
</a>

<nav class="md-nav" aria-label="If l2config.env(root) variables are redeclared in l2.env(local)">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#the-environment-file-can-load-results-of-commands" class="md-nav__link">
The environment file can load results of commands
<a href="#if-l2configenvroot-variables-are-redeclared-in-l2envlocal" class="md-nav__link">
If l2config.env(root) variables are redeclared in l2.env(local)
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#the-environment-file-can-load-results-of-commands" class="md-nav__link">
The environment file can load results of commands
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -981,7 +995,8 @@ <h3 id="cookies-are-sent-as-headers">Cookies are sent as headers<a class="header
<p>Cookies are specified in a <code>Cookie</code> header as follows:</p>
<div class="highlight"><pre><span></span><code>Cookie:&#39;sessionid=foo;another-cookie=bar&#39;
</code></pre></div>
<h3 id="api-variables-can-be-defined-in-apirequestl2">API variables can be defined in <code>apirequest.l2</code><a class="headerlink" href="#api-variables-can-be-defined-in-apirequestl2" title="Permanent link">&para;</a></h3>
<h3 id="environment-variables-switch-base-url">Environment Variables: Switch base URL<a class="headerlink" href="#environment-variables-switch-base-url" title="Permanent link">&para;</a></h3>
<h4 id="api-variables-can-be-defined-in-apirequestl2">API variables can be defined in <code>apirequest.l2</code><a class="headerlink" href="#api-variables-can-be-defined-in-apirequestl2" title="Permanent link">&para;</a></h4>
<p>L2 uses the variables declared inside the <code>.l2</code> file and makes the request</p>
<p>Example <code>login.l2</code>:</p>
<div class="highlight"><pre><span></span><code>let REMOTE = &quot;httpbin.org&quot;
Expand All @@ -997,26 +1012,28 @@ <h3 id="api-variables-can-be-defined-in-apirequestl2">API variables can be defin
}
</code></pre></div>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0021_varjson_variable/0021_varjson_variable.l2">Source Files</a></p>
<h3 id="api-environment-variables-can-be-defined-locally-in-l2env">API environment variables can be defined locally in <code>l2.env</code><a class="headerlink" href="#api-environment-variables-can-be-defined-locally-in-l2env" title="Permanent link">&para;</a></h3>
<h4 id="api-environment-variables-can-be-defined-locally-in-l2env">API environment variables can be defined locally in <code>l2.env</code><a class="headerlink" href="#api-environment-variables-can-be-defined-locally-in-l2env" title="Permanent link">&para;</a></h4>
<p><code>l2.env</code> is searched for, from the present directory and variables(local) are loaded from this file.</p>
<p>Example <code>l2.env</code>:</p>
<div class="highlight"><pre><span></span><code>export PHOTO=`base64 aadhaarlarge.jpg`
export AHOST=&quot;http://localhost:8000&quot;
</code></pre></div>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0004_env_switch_root">Source Files</a></p>
<h3 id="api-environment-variables-can-be-defined-at-root-using-l2configenv">API environment variables can be defined at root using <code>l2config.env</code><a class="headerlink" href="#api-environment-variables-can-be-defined-at-root-using-l2configenv" title="Permanent link">&para;</a></h3>
<p><img alt="l2.env at API level" src="l2env.png" /></p>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0023_l2env_declare">Source File</a></p>
<h4 id="api-environment-variables-can-be-defined-at-project-root-using-l2configenv">API environment variables can be defined at project root using <code>l2config.env</code><a class="headerlink" href="#api-environment-variables-can-be-defined-at-project-root-using-l2configenv" title="Permanent link">&para;</a></h4>
<p><code>l2config.env</code> is searched for, from the present directory to all its ancestors (upto <code>/</code>) and
variables(root) are loaded from this file.
Example <code>l2config.env</code>:</p>
<div class="highlight"><pre><span></span><code>export PHOTO=`base64 aadhaarsmall.jpg`
export AHOST=&quot;http://localhost:8001&quot;
</code></pre></div>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0019_env_switch_global_root">Source Files</a></p>
<h3 id="if-l2configenvroot-variables-are-redeclared-in-l2envlocal">If <code>l2config.env</code>(root) variables are redeclared in <code>l2.env</code>(local)<a class="headerlink" href="#if-l2configenvroot-variables-are-redeclared-in-l2envlocal" title="Permanent link">&para;</a></h3>
<p><img alt="l2config.env at Project root level" src="l2configAtRoot.png" /></p>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0022_l2config_declare">Source File</a></p>
<h4 id="if-l2configenvroot-variables-are-redeclared-in-l2envlocal">If <code>l2config.env</code>(root) variables are redeclared in <code>l2.env</code>(local)<a class="headerlink" href="#if-l2configenvroot-variables-are-redeclared-in-l2envlocal" title="Permanent link">&para;</a></h4>
<p>The local variable's value is taken into consideration regardless of both files residing in same directory</p>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0020_override_project_root_local">Source Files</a></p>
<p><img alt="Override of l2config.env with l2.env variable" src="l2envOverideL2config.png" /></p>
<h4 id="the-environment-file-can-load-results-of-commands">The environment file can load results of commands<a class="headerlink" href="#the-environment-file-can-load-results-of-commands" title="Permanent link">&para;</a></h4>
<p><img alt="l2config.env at Project root level" src="l2configAtRoot.png" /></p>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0020_override_project_root_local">Source File</a></p>
<h3 id="the-environment-file-can-load-results-of-commands">The environment file can load results of commands<a class="headerlink" href="#the-environment-file-can-load-results-of-commands" title="Permanent link">&para;</a></h3>
<p>Use the backtick notation <code>\</code>command`` to place the results of
commands into environment variables:</p>
<div class="highlight"><pre><span></span><code>export PHOTO=`base64 image.jpeg`
Expand Down
4 changes: 1 addition & 3 deletions docs/Lama2/site/reference/architecture.html
Original file line number Diff line number Diff line change
Expand Up @@ -795,11 +795,9 @@ <h3 id="description">Description<a class="headerlink" href="#description" title=
<li>Replace variables with values in the following order<ol>
<li>Try fetch variable from Javascript VM</li>
<li>If (1) fails, try fetch Local env variable from <code>l2.env</code> </li>
<li>Try fetch root env variable from <code>l2config.env</code></li>
</ol>
</li>
</ol>
</li>
<li>Try fetch root env variable from <code>l2config.env</code><ol>
<li>Use the processed elements to create an httpie-go request</li>
<li>Fetch response</li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion docs/Lama2/site/search/search_index.json

Large diffs are not rendered by default.

Binary file modified docs/Lama2/site/sitemap.xml.gz
Binary file not shown.
8 changes: 7 additions & 1 deletion docs/Lama2/site/tutorials/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -975,16 +975,22 @@ <h3 id="case-1-l2env-adjacent-to-an-api-file">Case 1: <code>l2.env</code> adjace
<div class="highlight"><pre><span></span><code>export LOCAL=&quot;http://localhost:8000&quot;
export REMOTE=&quot;http://httpbin.org&quot;
</code></pre></div>
<p><img alt="l2.env at API level" src="l2env.png" /></p>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0023_l2env_declare">Source File</a></p>
<h3 id="case-2-root-variables">Case 2: Root variables<a class="headerlink" href="#case-2-root-variables" title="Permanent link">&para;</a></h3>
<p>In Lama2, you can have a large number of API files stored in a hierarchical folder configuration.
The root of such a project can be signified through <code>l2config.env</code>:</p>
<p>Within such a structure, you can have an API file anywhere, which can use variables defined in the root variables:
<strong>l2config.env</strong></p>
<div class="highlight"><pre><span></span><code>export LOCAL=&quot;http://localhost:8000&quot;
<p><div class="highlight"><pre><span></span><code>export LOCAL=&quot;http://localhost:8000&quot;
export REMOTE=&quot;http://httpbin.org&quot;
</code></pre></div>
<img alt="l2config.env at Project root level" src="l2configAtRoot.png" /></p>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0022_l2config_declare">Source File</a></p>
<h3 id="case-3-override-root-variable-with-local-variable">Case 3: Override Root variable with local variable<a class="headerlink" href="#case-3-override-root-variable-with-local-variable" title="Permanent link">&para;</a></h3>
<p>In this structure, if a variable is declared in both l2config.env and l2.env, the value from l2.env takes precedence.</p>
<p><img alt="Override of l2config.env with l2.env variable" src="l2envOverideL2config.png" /></p>
<p>Get <a href="https://github.com/HexmosTech/Lama2/tree/main/examples/0020_override_project_root_local">Source File</a></p>
<h2 id="headers">Headers<a class="headerlink" href="#headers" title="Permanent link">&para;</a></h2>
<p>Use <code>key:value</code> format to specify headers.</p>
<p>Specify strings for key/value in three ways:</p>
Expand Down
1 change: 1 addition & 0 deletions docs/Lama2/site/tutorials/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,7 @@ <h3 id="from-the-terminal">From the terminal<a class="headerlink" href="#from-th
-o, --output= Path to output JSON file to store logs, headers and result
-v, --verbose Show verbose debug information
-n, --nocolor Disable color in httpie output
-e --env Get a JSON of environment variables
-h, --help Usage help for Lama2
--version Print Lama2 binary version

Expand Down
Binary file added docs/Lama2/site/tutorials/l2configAtRoot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Lama2/site/tutorials/l2env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Lama2/site/tutorials/l2envOverideL2config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2a2ddf9

Please sign in to comment.