diff --git a/Cargo.toml b/Cargo.toml index bf232fa..9eb1a93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fundoc" -version = "0.4.3" +version = "0.5.0" authors = ["Sergey Golovin "] edition = "2018" license = "MIT" diff --git a/docs/plugins.html b/docs/plugins.html new file mode 100644 index 0000000..68d5684 --- /dev/null +++ b/docs/plugins.html @@ -0,0 +1,227 @@ + + + + + + Plugins - Fundoc + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+
+

Plugins

+

You can create a plugin for Fundoc to convert any text block of the following code in documentation:

+
{{ #your-plugin-name any text here }}
+
+
+

This insertion can be multiline as well:

+
{{ #your-plugin-name
+ any text here
+}}
+
+
+

To create a plugin for parsing these blocks, you should add a file called your-plugin-name.html.lua into the plugins folder. By default, it's ./plugins, but it's possible to change it in the config file. +Then you should add the following strings into the book.toml file:

+
[preprocessor.your-plugin-name]
+command = "fundoc -e"
+
+

The -e artument runs Fundoc in mdBook extension mode.

+

And in your your-plugin-name.html.lua, you should implement text transformation like this:

+
function transform(text)
+  result = 'transformted text' 
+end
+
+

Fundoc calls the transform function and passes the parsed text from the marked text block. You can transform it in any way you want. +[~]

+
+

[note] mdBook runs Fundoc twice. The first time fundoc should exit with 0 code. The +second time Fundoc transforms the text. +[~]

+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + +
+ +