path: root/src/bindings
diff options
authorXavi Artigas <>2019-04-11 10:38:40 +0200
committerXavi Artigas <>2019-04-11 10:39:09 +0200
commit04a41a37127e4491428ebce70689c180cb12418a (patch)
treecd01ce9d12e85c69676648d02dafddf6985fd251 /src/bindings
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 'src/bindings')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bindings/mono/ b/src/bindings/mono/
index dc2c856404..e7c5e00d9a 100644
--- a/src/bindings/mono/
+++ b/src/bindings/mono/
@@ -127,6 +127,7 @@ foreach lib : mono_sublibs
127 command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories, 127 command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
128 '--dllimport', package_name, 128 '--dllimport', package_name,
129 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), 129 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
130 '-e', get_option('mono-examples-dir'),
130 '@INPUT@']) 131 '@INPUT@'])
131 endif 132 endif
132 endforeach 133 endforeach