From b69711b1fd4bea4f9e16588527c325c01a29b09e Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Tue, 17 Sep 2024 20:19:08 +0200 Subject: [PATCH] update docs --- docs/mdsource/repom.generated.source.md | 6 +- .../script_variables_file.generated.source.md | 2 +- .../Templates/DocsPlugin.scriban-txt | 62 +++---------------- .../Templates/Parts/actionmenu.scriban-txt | 42 +++++++++++++ 4 files changed, 53 insertions(+), 59 deletions(-) create mode 100644 src/RepoM.ActionMenu.CodeGen/Templates/Parts/actionmenu.scriban-txt diff --git a/docs/mdsource/repom.generated.source.md b/docs/mdsource/repom.generated.source.md index f4e9160b..416cd24f 100644 --- a/docs/mdsource/repom.generated.source.md +++ b/docs/mdsource/repom.generated.source.md @@ -1,10 +1,6 @@ # RepoM Core Repository Actions -## Configuration - -This plugin has no configuration. - -This module contains the following methods, variables and/or constants: +The following actions are part of the core of RepoM and can always be used in your RepositoryActions. ## browse-repository@1 diff --git a/docs/mdsource/script_variables_file.generated.source.md b/docs/mdsource/script_variables_file.generated.source.md index e00de116..0c5fb893 100644 --- a/docs/mdsource/script_variables_file.generated.source.md +++ b/docs/mdsource/script_variables_file.generated.source.md @@ -1,6 +1,6 @@ # `file` -Provides file related action menu functions and variables accessable through `file`. +Provides file related action menu functions and variables accessible through `file`. This module contains the following methods, variables and/or constants: diff --git a/src/RepoM.ActionMenu.CodeGen/Templates/DocsPlugin.scriban-txt b/src/RepoM.ActionMenu.CodeGen/Templates/DocsPlugin.scriban-txt index 6848a28f..799cb462 100644 --- a/src/RepoM.ActionMenu.CodeGen/Templates/DocsPlugin.scriban-txt +++ b/src/RepoM.ActionMenu.CodeGen/Templates/DocsPlugin.scriban-txt @@ -33,15 +33,6 @@ end {{~ ## include: _plugin_enable ## ~}} To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM. -{{~ ## -- ProjectName: { { write_default_when_null plugin.ProjectName } } -- PluginName: { { write_default_when_null plugin.PluginName } } -- PluginDescription: { { write_default_when_null plugin.PluginDescription } } -- PluginMarkdownDescription: { { write_default_when_null plugin.PluginMarkdownDescription } } -## ~}} -{{~ else ~}} -# {{ plugin.IsPlugin ? plugin.PluginName : "RepoM Core Repository Actions" }} -{{~ end ~}} ## Configuration {{~ if plugin.HasConfiguration ~}} @@ -49,53 +40,18 @@ To use this module, make sure it is enabled in RepoM by opening the menu and nav {{ else }} This plugin has no configuration. {{ end ~}} +{{~ else ~}} +# {{ plugin.IsPlugin ? plugin.PluginName : "RepoM Core Repository Actions" }} +{{~ end ~}} {{~ include '30' }} {{~ if array.size(plugin.ActionMenus) > 0 ~}} +{{~ if plugin.IsPlugin ~}} This module contains the following methods, variables and/or constants: - {{~ for member in plugin.ActionMenus ~}} - -## {{ member.Name }} - -{{ member.Description }} - -Properties: - - {{~ for p in member.ActionMenuProperties ~}} -- `{{ hyphenated p.CSharpName }}`: {{ p.Description }} ({{ write_type_with_link p.ReturnType }}) - {{~ end ~}} - {{~ if member.Examples ~}} - -### Example - {{~ if !string.empty member.Examples.Description ~}} -{{ member.Examples.Description | regex.replace `^\s{4}` '' 'm' | string.rstrip }} - {{ end }} - {{~ for example_item in member.Examples.Items ~}} - {{~ if example_item.TypeName == 'Code' ~}} - -```{{ example_item.Language | string.downcase }} - {{~ if example_item.UseRaw ~}} -{{ example_item.Content | string.rstrip }} - {{~ else ~}} -{{ example_item.Content | regex.replace `^\s{4}` '' 'm' | string.rstrip }} - {{~ end ~}} -``` - - {{~ else if example_item.TypeName == 'Snippet' ~}} -{{ example_item.Mode | string.downcase }}: {{ example_item.Name }} - - {{~ else if example_item.TypeName == 'Header' ~}} -#### {{ example_item.Text }} - - {{~ else if example_item.TypeName == 'Text' ~}} -{{ example_item.Content }} - {{~ else if example_item.TypeName == 'Paragraph' ~}} - -{{ example_item.Text }} - {{~ else ~}} - NAME NOT FOUND!! {{ example_item.TypeName }}. - {{~ end ~}} - {{~ end ~}} - {{~ end ~}} +{{~ else ~}} +The following actions are part of the core of RepoM and can always be used in your RepositoryActions. +{{~ end ~}} + {{~ for actionmenu_item in plugin.ActionMenus }} + {{~ include 'actionmenu.scriban-txt' ~}} {{~ end ~}} {{~ end ~}} {{ include '99' ~}} \ No newline at end of file diff --git a/src/RepoM.ActionMenu.CodeGen/Templates/Parts/actionmenu.scriban-txt b/src/RepoM.ActionMenu.CodeGen/Templates/Parts/actionmenu.scriban-txt new file mode 100644 index 00000000..1352165a --- /dev/null +++ b/src/RepoM.ActionMenu.CodeGen/Templates/Parts/actionmenu.scriban-txt @@ -0,0 +1,42 @@ +## {{ actionmenu_item.Name }} + +{{ actionmenu_item.Description }} + +Properties: + + {{~ for p in actionmenu_item.ActionMenuProperties ~}} +- `{{ hyphenated p.CSharpName }}`: {{ p.Description }} ({{ write_type_with_link p.ReturnType }}) + {{~ end ~}} + {{~ if actionmenu_item.Examples ~}} + +### Example + {{~ if !string.empty actionmenu_item.Examples.Description ~}} +{{ actionmenu_item.Examples.Description | regex.replace `^\s{4}` '' 'm' | string.rstrip }} + {{ end }} + {{~ for example_item in actionmenu_item.Examples.Items ~}} + {{~ if example_item.TypeName == 'Code' ~}} + +```{{ example_item.Language | string.downcase }} + {{~ if example_item.UseRaw ~}} +{{ example_item.Content | string.rstrip }} + {{~ else ~}} +{{ example_item.Content | regex.replace `^\s{4}` '' 'm' | string.rstrip }} + {{~ end ~}} +``` + + {{~ else if example_item.TypeName == 'Snippet' ~}} +{{ example_item.Mode | string.downcase }}: {{ example_item.Name }} + + {{~ else if example_item.TypeName == 'Header' ~}} +#### {{ example_item.Text }} + + {{~ else if example_item.TypeName == 'Text' ~}} +{{ example_item.Content }} + {{~ else if example_item.TypeName == 'Paragraph' ~}} + +{{ example_item.Text }} + {{~ else ~}} + NAME NOT FOUND!! {{ example_item.TypeName }}. + {{~ end ~}} + {{~ end ~}} + {{~ end ~}} \ No newline at end of file