-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add documentation for the plugin system
- Loading branch information
Showing
9 changed files
with
105 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ | |
|
||
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> | ||
<div class="sidebar-scrollbox"> | ||
<ol class="chapter"><li class="chapter-item expanded "><a href="configuration.html" class="active"><strong aria-hidden="true">1.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="syntax.html"><strong aria-hidden="true">2.</strong> Syntax</a></li></ol> | ||
<ol class="chapter"><li class="chapter-item expanded "><a href="configuration.html" class="active"><strong aria-hidden="true">1.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="plugins.html"><strong aria-hidden="true">2.</strong> Plugins</a></li><li class="chapter-item expanded "><a href="syntax.html"><strong aria-hidden="true">3.</strong> Syntax</a></li></ol> | ||
</div> | ||
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> | ||
</nav> | ||
|
@@ -169,13 +169,13 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
</li> | ||
</ul> | ||
<p>For example a microservices architecture:</p> | ||
<pre class="mermaid"> | ||
<p>{{ #mermaid | ||
flowchart TD; | ||
A[Documentaion repo] --> B[A repo of Mecroservice 1]; | ||
A --> C[A repo of Mecroservice 2]; | ||
A --> D[A repo of Mecroservice 3]; | ||
</pre><script type="module"> import mermaid from "https://cdn.jsdelivr.net/npm/[email protected]/+esm"; mermaid.initialize({}); </script> | ||
<p><a href="https://github.com/daynin/fundoc/blob/master/#L36-L47">[~]</a></p> | ||
A[Documentaion repo] --> B[A repo of Mecroservice 1]; | ||
A --> C[A repo of Mecroservice 2]; | ||
A --> D[A repo of Mecroservice 3]; | ||
}} | ||
<a href="https://github.com/daynin/fundoc/blob/master/#L36-L47">[~]</a></p> | ||
<ul> | ||
<li> | ||
<p><code>repository_host</code> - an http url which will be used for creating a link to a file in a | ||
|
@@ -217,7 +217,7 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
<nav class="nav-wrapper" aria-label="Page navigation"> | ||
<!-- Mobile navigation buttons --> | ||
|
||
<a rel="next" href="syntax.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<a rel="next" href="plugins.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<i class="fa fa-angle-right"></i> | ||
</a> | ||
|
||
|
@@ -228,7 +228,7 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
|
||
<nav class="nav-wide-wrapper" aria-label="Page navigation"> | ||
|
||
<a rel="next" href="syntax.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<a rel="next" href="plugins.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<i class="fa fa-angle-right"></i> | ||
</a> | ||
</nav> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ | |
|
||
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> | ||
<div class="sidebar-scrollbox"> | ||
<ol class="chapter"><li class="chapter-item expanded "><a href="configuration.html" class="active"><strong aria-hidden="true">1.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="syntax.html"><strong aria-hidden="true">2.</strong> Syntax</a></li></ol> | ||
<ol class="chapter"><li class="chapter-item expanded "><a href="configuration.html" class="active"><strong aria-hidden="true">1.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="plugins.html"><strong aria-hidden="true">2.</strong> Plugins</a></li><li class="chapter-item expanded "><a href="syntax.html"><strong aria-hidden="true">3.</strong> Syntax</a></li></ol> | ||
</div> | ||
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> | ||
</nav> | ||
|
@@ -169,13 +169,13 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
</li> | ||
</ul> | ||
<p>For example a microservices architecture:</p> | ||
<pre class="mermaid"> | ||
<p>{{ #mermaid | ||
flowchart TD; | ||
A[Documentaion repo] --> B[A repo of Mecroservice 1]; | ||
A --> C[A repo of Mecroservice 2]; | ||
A --> D[A repo of Mecroservice 3]; | ||
</pre><script type="module"> import mermaid from "https://cdn.jsdelivr.net/npm/[email protected]/+esm"; mermaid.initialize({}); </script> | ||
<p><a href="https://github.com/daynin/fundoc/blob/master/#L36-L47">[~]</a></p> | ||
A[Documentaion repo] --> B[A repo of Mecroservice 1]; | ||
A --> C[A repo of Mecroservice 2]; | ||
A --> D[A repo of Mecroservice 3]; | ||
}} | ||
<a href="https://github.com/daynin/fundoc/blob/master/#L36-L47">[~]</a></p> | ||
<ul> | ||
<li> | ||
<p><code>repository_host</code> - an http url which will be used for creating a link to a file in a | ||
|
@@ -217,7 +217,7 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
<nav class="nav-wrapper" aria-label="Page navigation"> | ||
<!-- Mobile navigation buttons --> | ||
|
||
<a rel="next" href="syntax.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<a rel="next" href="plugins.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<i class="fa fa-angle-right"></i> | ||
</a> | ||
|
||
|
@@ -228,7 +228,7 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
|
||
<nav class="nav-wide-wrapper" aria-label="Page navigation"> | ||
|
||
<a rel="next" href="syntax.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<a rel="next" href="plugins.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<i class="fa fa-angle-right"></i> | ||
</a> | ||
</nav> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ | |
|
||
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> | ||
<div class="sidebar-scrollbox"> | ||
<ol class="chapter"><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">1.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="syntax.html"><strong aria-hidden="true">2.</strong> Syntax</a></li></ol> | ||
<ol class="chapter"><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">1.</strong> Configuration</a></li><li class="chapter-item expanded "><a href="plugins.html"><strong aria-hidden="true">2.</strong> Plugins</a></li><li class="chapter-item expanded "><a href="syntax.html"><strong aria-hidden="true">3.</strong> Syntax</a></li></ol> | ||
</div> | ||
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> | ||
</nav> | ||
|
@@ -170,13 +170,13 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
</li> | ||
</ul> | ||
<p>For example a microservices architecture:</p> | ||
<pre class="mermaid"> | ||
<p>{{ #mermaid | ||
flowchart TD; | ||
A[Documentaion repo] --> B[A repo of Mecroservice 1]; | ||
A --> C[A repo of Mecroservice 2]; | ||
A --> D[A repo of Mecroservice 3]; | ||
</pre><script type="module"> import mermaid from "https://cdn.jsdelivr.net/npm/[email protected]/+esm"; mermaid.initialize({}); </script> | ||
<p><a href="https://github.com/daynin/fundoc/blob/master/#L36-L47">[~]</a></p> | ||
A[Documentaion repo] --> B[A repo of Mecroservice 1]; | ||
A --> C[A repo of Mecroservice 2]; | ||
A --> D[A repo of Mecroservice 3]; | ||
}} | ||
<a href="https://github.com/daynin/fundoc/blob/master/#L36-L47">[~]</a></p> | ||
<ul> | ||
<li> | ||
<p><code>repository_host</code> - an http url which will be used for creating a link to a file in a | ||
|
@@ -212,6 +212,35 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a> | |
<p>In case when you don't write the enable-comment all text from disable comment until the end of | ||
the file will be ignored | ||
<a href="https://github.com/daynin/fundoc/blob/master/#L285-L291">[~]</a></p> | ||
<div style="break-before: page; page-break-before: always;"></div><h1 id="plugins"><a class="header" href="#plugins">Plugins</a></h1> | ||
<p>You can create a plugin for Fundoc to convert any text block of the following code in documentation:</p> | ||
<pre><code>{{ #your-plugin-name any text here }} | ||
|
||
</code></pre> | ||
<p>This insertion can be multiline as well:</p> | ||
<pre><code>{{ #your-plugin-name | ||
any text here | ||
}} | ||
|
||
</code></pre> | ||
<p>To create a plugin for parsing these blocks, you should add a file called <code>your-plugin-name.html.lua</code> into the plugins folder. By default, it's <code>./plugins</code>, but it's possible to change it in the config file. | ||
Then you should add the following strings into the <code>book.toml</code> file:</p> | ||
<pre><code class="language-toml">[preprocessor.your-plugin-name] | ||
command = "fundoc -e" | ||
</code></pre> | ||
<p>The <code>-e</code> artument runs Fundoc in mdBook extension mode.</p> | ||
<p>And in your your-plugin-name.html.lua, you should implement text transformation like this:</p> | ||
<pre><code class="language-lua">function transform(text) | ||
result = 'transformted text' | ||
end | ||
</code></pre> | ||
<p>Fundoc calls the <code>transform</code> function and passes the parsed text from the marked text block. You can transform it in any way you want. | ||
<a href="https://github.com/daynin/fundoc/blob/master/src/plugins.rs#L16-L52">[~]</a></p> | ||
<blockquote> | ||
<p>[note] mdBook runs Fundoc twice. The first time fundoc should exit with 0 code. The | ||
second time Fundoc transforms the text. | ||
<a href="https://github.com/daynin/fundoc/blob/master/#L71-L73">[~]</a></p> | ||
</blockquote> | ||
<div style="break-before: page; page-break-before: always;"></div><h1 id="syntax"><a class="header" href="#syntax">Syntax</a></h1> | ||
<p><code>@Article <Article name></code> is for marking documentation sections to tell in which article this section should | ||
be merged. You can use <code>markdown</code> syntax in documentation sections.</p> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters