mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update ldoc
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
<li><a href="#Overview">Overview </a></li>
|
||||
<li><a href="#Custom_components">Custom components </a></li>
|
||||
<li><a href="#Best_practice_on_custom_components">Best practice on custom components </a></li>
|
||||
<li><a href="#Power_of_using_templates">Power of using templates </a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -80,18 +81,20 @@
|
||||
|
||||
<p><a name="Overview"></a></p>
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Druid allows you to create your custom components from druid basic components or other custom components</p>
|
||||
|
||||
|
||||
<p><a name="Custom_components"></a></p>
|
||||
<h2>Custom components</h2>
|
||||
|
||||
<p>Basic custom component template looks like this:</p>
|
||||
|
||||
<pre>
|
||||
<span class="keyword">local</span> const = <span class="global">require</span>(<span class="string">"druid.const"</span>)
|
||||
<span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
|
||||
|
||||
<span class="keyword">local</span> M = component.create(<span class="string">"your_component"</span>)
|
||||
<span class="keyword">local</span> M = component.create(<span class="string">"name_your_component"</span>)
|
||||
|
||||
<span class="comment">-- Component constructor
|
||||
</span><span class="keyword">function</span> M.init(self, ...)
|
||||
@@ -150,7 +153,7 @@ There is next interests in druid:
|
||||
|
||||
<p><a name="Best_practice_on_custom_components"></a></p>
|
||||
<h2>Best practice on custom components</h2>
|
||||
<p>On each component recomended describe component scheme in next way:</p>
|
||||
<p>On each component recommended describe component scheme in next way:</p>
|
||||
|
||||
|
||||
<pre>
|
||||
@@ -160,9 +163,9 @@ There is next interests in druid:
|
||||
<span class="keyword">local</span> M = component.create(<span class="string">"your_component"</span>)
|
||||
|
||||
<span class="keyword">local</span> SCHEME = {
|
||||
ROOT = <span class="string">"/root"</span>,
|
||||
ITEM = <span class="string">"/item"</span>,
|
||||
TITLE = <span class="string">"/title"</span>
|
||||
ROOT = <span class="string">"root"</span>,
|
||||
ITEM = <span class="string">"item"</span>,
|
||||
TITLE = <span class="string">"title"</span>
|
||||
}
|
||||
|
||||
<span class="keyword">function</span> M.init(self, template_name, node_table)
|
||||
@@ -189,11 +192,17 @@ There is next interests in druid:
|
||||
|
||||
|
||||
|
||||
<p><a name="Power_of_using_templates"></a></p>
|
||||
<h2>Power of using templates</h2>
|
||||
|
||||
<p>You can use one component, but creating and customizing templates for them. Templates only requires to match the component scheme.</p>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2020-03-22 02:23:51 </i>
|
||||
<i style="float:right;">Last updated 2020-03-22 12:55:11 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user