path: root/meson_options.txt
diff options
authorXavi Artigas <>2019-04-11 10:38:40 +0200
committerXavi Artigas <>2019-04-11 10:39:09 +0200
commit04a41a37127e4491428ebce70689c180cb12418a (patch)
treecd01ce9d12e85c69676648d02dafddf6985fd251 /meson_options.txt
parent748070125ff43c001feb8e191cf2be8d0f59d01d (diff)
mono-docs: Allow embedding external examples
Summary: New option added to eolian_gen: -e <dir> This specifies a directory to search for examples. If a file is found with the same name as an EFL C# class (e.g. Efl.Ui.Button.cs) or as an EFL C# method or property (e.g. Efl.IText.Text.cs, Efl.IText.SetText.cs) its full contents will be embedded in the documentation for that class or method within <example> and <code> tags. This is, in turn, is parsed by DocFX and shown in Example boxes in the generated pages. If an example file is not found, no examples are embedded for that object. If -e is not used, no examples are embedded for any object. New option added to meson: mono-examples-dir to point to the examples directory. This directory is then passed to eolian_mono through -e. Do not use it (or define it to nothing) to disable example embedding. No performance drop has been observed because of these extra tests. Right now examples can only be given for base classes, not for derived ones (i.e. Efl.IText.Text but not Efl.Ui.Button.Text). This will be addressed in a later commit. Feature Depends on D8587 Test Plan: Create an examples folder and put some files in it: ``` mkdir /tmp/examples echo 'var button = new Efl.Ui.Button();' > /tmp/examples/Efl.Ui.Button.cs echo 'button.AutoRepeatEnabled = true;' > /tmp/examples/Efl.Ui.IAutorepeat.AutorepeatEnabled.cs echo 'button.SetAutoRepeatEnabled(true);' > /tmp/examples/Efl.Ui.IAutorepeat.SetAutorepeatEnabled.cs ``` Configure meson to embed examples and build: ``` meson configure -Dmono-examples-dir=/tmp/examples ninja ``` Examine the generated efl_ui_button.eo.cs file to see embedded <example> tags, or run DocFX and bask in the glory of documentation pages with examples: ``` cd doc/docfx ./ ``` Reviewers: lauromoura, felipealmeida, vitor.sousa, zmike, bu5hm4n Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
Diffstat (limited to 'meson_options.txt')
1 files changed, 6 insertions, 0 deletions
diff --git a/meson_options.txt b/meson_options.txt
index 105f4cf..0b6b0bb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -323,6 +323,12 @@ option('mono-beta',
323 description: 'Flag for enabling @beta Eo methods in the api' 323 description: 'Flag for enabling @beta Eo methods in the api'
324) 324)
325 325
327 type: 'string',
328 value: '',
329 description: 'Directory where eolian_mono will search for examples to embed into the documentation'
326option('lua-interpreter', 332option('lua-interpreter',
327 type: 'combo', 333 type: 'combo',
328 choices: ['luajit', 'lua'], 334 choices: ['luajit', 'lua'],