Skip to content

Commit

Permalink
#238 comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jand42 committed Aug 10, 2022
1 parent bb5a429 commit a950c2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions WebSharper.UI.Templating.Common/Settings.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ClientLoad =
// | Download = 3

/// Decide how the HTML is loaded when the template is used on the server side.
/// This only has an effect when passing a path to the provider, not inline HTML. (default: Once)
/// This only has an effect when passing a path to the provider, not inline HTML. (default: WhenChanged)
type ServerLoad =
/// The HTML is loaded from the file system on first use.
| Once = 1
Expand All @@ -46,5 +46,5 @@ type LegacyMode =
| Both = 1
/// Use the templating syntax inherited from WebSharper 3
| Old = 2
/// Use Zafir templating engine (experimental)
/// Use WebSharper 4+ templating engine
| New = 3
13 changes: 9 additions & 4 deletions WebSharper.UI.Templating/TemplatingProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,11 @@ type FileWatcher (invalidate: unit -> unit, disposing: IEvent<EventHandler, Even
watchers.Add(rootedPath, watcher)

[<TypeProvider>]
/// Creates a template from HTML with special templating syntax.
/// `pathOrHtml`: Path to an HTML file or an inline HTML string.
/// `clientLoad`: Decide how the HTML is loaded when the template is used on the client side, default is Inline.
/// `serverLoad`: Decide how the HTML is loaded when the template is used on the server side, default is WhenChanged.
/// `legacyMode`: Use WebSharper 3 or WebSharper 4+ templating engine or both, default is Both.
type TemplatingProvider (cfg: TypeProviderConfig) as this =
inherit TypeProviderForNamespaces(cfg)

Expand All @@ -620,13 +625,13 @@ type TemplatingProvider (cfg: TypeProviderConfig) as this =
templateTy.DefineStaticParameters(
[
ProvidedStaticParameter("pathOrHtml", typeof<string>)
.WithXmlDoc("Inline HTML or a path to an HTML file")
.WithXmlDoc("Path to an HTML file or an inline HTML string")
ProvidedStaticParameter("clientLoad", typeof<ClientLoad>, ClientLoad.Inline)
.WithXmlDoc("Decide how the HTML is loaded when the template is used on the client side")
.WithXmlDoc("Decide how the HTML is loaded when the template is used on the client side, default is Inline")
ProvidedStaticParameter("serverLoad", typeof<ServerLoad>, ServerLoad.WhenChanged)
.WithXmlDoc("Decide how the HTML is loaded when the template is used on the server side")
.WithXmlDoc("Decide how the HTML is loaded when the template is used on the server side, default is WhenChanged")
ProvidedStaticParameter("legacyMode", typeof<LegacyMode>, LegacyMode.Both)
.WithXmlDoc("Use WebSharper 3 or Zafir templating engine or both")
.WithXmlDoc("Use WebSharper 3 or WebSharper 4+ templating engine or both, default is Both")
],
fun typename pars ->
try
Expand Down

0 comments on commit a950c2b

Please sign in to comment.