Module Wiki_syntax

module Wiki_syntax : sig..end

Pretty print wiki to HTML5 using Eliom's TyXML Author(s): Vincent Balat


type 'res wikicreole_parser

The abstract type of the objects able to parse wiki creole syntax, possibly with extensions. Those objects are passed as arguments to all displaying functions

type ('res, 'res_without_interactive, 'content_link) ext_wikicreole_parser

The abstract type for extensible parser. See register_simple_extension and register_wiki_extension.

val cast_wp : 
  ('a, 'b, 'c) ext_wikicreole_parser ->
  'a wikicreole_parser

Cast an extensible parser to a raw parser to be used with xml_of_wiki.

val cast_niwp : 
  ('a, 'b, 'c) ext_wikicreole_parser ->
  'b wikicreole_parser

Cast an extensible parser to the associated non_interactive parser to be used with xml_of_wiki.

type 
  ('a, 'b, [< Eliom_service.get_service_kind ], [< Eliom_service.suff ]
   , [< Eliom_service.registrable ]
   , [< Eliom_registration.non_ocaml_service ])
wiki_service =
  ('a, unit, [< Eliom_service.get_service_kind ] as 'kind,
   [< Eliom_service.suff ] as 'c, 'b, unit,
   [< Eliom_service.registrable ] as 'd,
   [< Eliom_registration.non_ocaml_service ] as 'service)
  Eliom_service.service
type service_href = Wiki_syntax_types.service_href
type href = Wiki_syntax_types.href  =  | String_href of string | Service_href of service_href
val service_href : 
  ?fragment:string ->
  ?https:bool ->
  ('a, 'b, [< Eliom_service.get_service_kind ], [< Eliom_service.suff ],
   [< Eliom_service.registrable ],
   [< Eliom_registration.non_ocaml_service ])
  wiki_service -> 'a -> service_href
val uri_of_href : href -> Eliom_content.Html5.F.uri

Add a syntax extension to an existing parser.

type ('flow, 'flow_without_interactive, 'phrasing_without_interactive) plugin_content = 
  [ `Flow5 of 'flow Eliom_content.Html5.F.elt list Lwt.t
  | `Flow5_link of
   href * Wikicreole.attribs *
   'flow_without_interactive Eliom_content.Html5.F.elt list Lwt.t
  | `Phrasing_link of
   href * Wikicreole.attribs *
   'phrasing_without_interactive Eliom_content.Html5.F.elt list Lwt.t
  | `Phrasing_without_interactive of
   'phrasing_without_interactive Eliom_content.Html5.F.elt list Lwt.t ]
type ('flow_without_interactive, 'phrasing_without_interactive) ni_plugin_content = 
  [ `Flow5 of
   'flow_without_interactive Eliom_content.Html5.F.elt list Lwt.t
  | `Phrasing_without_interactive of
   'phrasing_without_interactive Eliom_content.Html5.F.elt list Lwt.t ]
type ('flow, 'flow_without_interactive, 'phrasing_without_interactive) interactive_simple_plugin = 
  (Wiki_widgets_interface.box_info,
   ('flow, 'flow_without_interactive, 'phrasing_without_interactive)
   plugin_content)
  Wikicreole.plugin

The type of extension that can be registred into both the interactive and non_interactive variant and of a parser.

type ('flow_without_interactive, 'phrasing_without_interactive) non_interactive_simple_plugin = 
  (Wiki_widgets_interface.box_info,
   ('flow_without_interactive, 'phrasing_without_interactive)
   ni_plugin_content)
  Wikicreole.plugin

The type of extension that can be registred into the interactive variant of a parser.

type preparser = 
  Wiki_types.wikibox ->
  Wikicreole.attribs -> string option -> string option Lwt.t
val register_simple_extension : 
  wp:('res, 'flow_without_interactive, 'phrasing_without_interactive)
   ext_wikicreole_parser ->
  name:string ->
  ?preparser:preparser ->
  ?ni_plugin:('flow_without_interactive, 'phrasing_without_interactive)
   non_interactive_simple_plugin ->
  ('res, 'flow_without_interactive, 'phrasing_without_interactive)
  interactive_simple_plugin -> unit
type ('content, 'flow_without_interactive, 'phrasing_without_interactive) wiki_plugin = 
  Wiki_widgets_interface.box_info ->
  Wikicreole.attribs ->
  'content Eliom_content.Html5.F.elt list Lwt.t option ->
  ('flow_without_interactive, 'phrasing_without_interactive)
  ni_plugin_content
val register_wiki_extension : 
  wp:('res, 'flow_without_interactive, 'phrasing_without_interactive)
   ext_wikicreole_parser ->
  name:string ->
  wp_rec:('a, 'b, 'c) ext_wikicreole_parser ->
  ?preparser:preparser ->
  ?context:(Wiki_widgets_interface.box_info ->
   Wikicreole.attribs -> Wiki_widgets_interface.box_info) ->
  ?ni_plugin:('b, 'flow_without_interactive,
   'phrasing_without_interactive)
   wiki_plugin ->
  ('a, 'res, 'phrasing_without_interactive) wiki_plugin ->
  unit
val register_raw_wiki_extension : 
  wp:('a, 'b, 'c) ext_wikicreole_parser ->
  name:string ->
  wp_rec:('d, 'e, 'f) ext_wikicreole_parser ->
  ?preparser:preparser ->
  ?ni_plugin:('e wikicreole_parser ->
   Wiki_widgets_interface.box_info ->
   Wikicreole.attribs ->
   string option -> ('b, 'c) ni_plugin_content) ->
  ('d wikicreole_parser ->
   Wiki_widgets_interface.box_info ->
   Wikicreole.attribs ->
   string option -> ('a, 'b, 'c) plugin_content) ->
  unit
val register_simple_flow_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  ([< Html5_types.flow5_without_interactive_header_footer ],
   [< Html5_types.phrasing_without_interactive ])
  non_interactive_simple_plugin -> unit
val register_interactive_simple_flow_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  ([< Html5_types.flow5_without_header_footer ],
   [< Html5_types.flow5_without_interactive_header_footer ],
   [< Html5_types.phrasing_without_interactive ])
  interactive_simple_plugin -> unit
type wiki_flow_pplugin = {
  fpp: 
    'a.
     (([< Html5_types.flow5
     > `Abbr `Address `Article `Aside `Audio `B `Bdo `Blockquote
     `Br `Button `Canvas `Cite `Code `Command `Datalist `Del
     `Dfn `Div `Dl `Em `Fieldset `Figure `Form `H1 `H2 `H3 `H4
     `H5 `H6 `Hgroup `Hr `I `Img `Input `Ins `Kbd `Keygen `Label
     `Map `Mark `Menu `Meter `Nav `Noscript `Object `Ol `Output
     `P `PCDATA `Pre `Progress `Q `Ruby `Samp `Script `Section
     `Select `Small `Span `Strong `Style `Sub `Sup `Svg `Table
     `Textarea `Time `U `Ul `Var `Video `Wbr ]
     as 'a)
     Html5_types.between_flow5_and_flow5_without_interactive_header_footer,
     'a, Html5_types.phrasing_without_interactive)
     wiki_plugin
;
}
val register_wiki_flow_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  wiki_flow_pplugin -> unit
type interactive_wiki_flow_pplugin = {
  ifpp: 
    'a 'b.
     (([< `A of [< Html5_types.flow5_without_interactive ] as 'b
     | `Abbr
     | `Address
     | `Article
     | `Aside
     | `Audio of Html5_types.flow5_without_media
     | `Audio_interactive of Html5_types.flow5_without_media
     | `B
     | `Bdo
     | `Blockquote
     | `Br
     | `Button
     | `Canvas of 'a
     | `Cite
     | `Code
     | `Command
     | `Datalist
     | `Del of 'a
     | `Details
     | `Dfn
     | `Div
     | `Dl
     | `Em
     | `Embed
     | `Fieldset
     | `Figure
     | `Footer
     | `Form
     | `H1
     | `H2
     | `H3
     | `H4
     | `H5
     | `H6
     | `Header
     | `Hgroup
     | `Hr
     | `I
     | `Iframe
     | `Img
     | `Img_interactive
     | `Input
     | `Ins of 'a
     | `Kbd
     | `Keygen
     | `Label
     | `Map of 'a
     | `Mark
     | `Menu
     | `Meter
     | `Nav
     | `Noscript of Html5_types.flow5_without_noscript
     | `Object of 'a
     | `Object_interactive of 'a
     | `Ol
     | `Output
     | `P
     | `PCDATA
     | `Pre
     | `Progress
     | `Q
     | `Ruby
     | `Samp
     | `Script
     | `Section
     | `Select
     | `Small
     | `Span
     | `Strong
     | `Style
     | `Sub
     | `Sup
     | `Svg
     | `Table
     | `Textarea
     | `Time
     | `U
     | `Ul
     | `Var
     | `Video of Html5_types.flow5_without_media
     | `Video_interactive of Html5_types.flow5_without_media
     | `Wbr
     > `A `Abbr `Address `Article `Aside `Audio `Audio_interactive
     `B `Bdo `Blockquote `Br `Button `Canvas `Cite `Code
     `Command `Datalist `Del `Details `Dfn `Div `Dl `Em `Embed
     `Fieldset `Figure `Form `H1 `H2 `H3 `H4 `H5 `H6 `Hgroup `Hr
     `I `Iframe `Img `Img_interactive `Input `Ins `Kbd `Keygen
     `Label `Map `Mark `Menu `Meter `Nav `Noscript `Object
     `Object_interactive `Ol `Output `P `PCDATA `Pre `Progress
     `Q `Ruby `Samp `Script `Section `Select `Small `Span
     `Strong `Style `Sub `Sup `Svg `Table `Textarea `Time `U `Ul
     `Var `Video `Video_interactive `Wbr ]
     as 'a, 'b)
     Html5_types.between_flow5_and_flow5_without_header_footer, 'a,
     Html5_types.phrasing_without_interactive)
     wiki_plugin
;
}
val register_interactive_wiki_flow_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  interactive_wiki_flow_pplugin -> unit
val register_simple_phrasing_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  ([< Html5_types.phrasing_without_interactive ],
   [< Html5_types.phrasing_without_interactive ])
  non_interactive_simple_plugin -> unit
val register_interactive_simple_phrasing_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  (Html5_types.phrasing, Html5_types.phrasing_without_interactive,
   Html5_types.phrasing_without_interactive)
  interactive_simple_plugin -> unit
type wiki_phrasing_pplugin = {
  ppp: 
    'a 'b.
     (([< `A of [< Html5_types.phrasing_without_interactive ] as 'b
     | `Abbr
     | `Audio of Html5_types.phrasing_without_media
     | `Audio_interactive of Html5_types.phrasing_without_media
     | `B
     | `Bdo
     | `Br
     | `Button
     | `Canvas of Html5_types.phrasing
     | `Cite
     | `Code
     | `Command
     | `Datalist
     | `Del of Html5_types.phrasing
     | `Dfn
     | `Em
     | `Embed
     | `I
     | `Iframe
     | `Img
     | `Img_interactive
     | `Input
     | `Ins of Html5_types.phrasing
     | `Kbd
     | `Keygen
     | `Label
     | `Map of Html5_types.phrasing
     | `Mark
     | `Meter
     | `Noscript of Html5_types.phrasing_without_noscript
     | `Object of Html5_types.phrasing
     | `Object_interactive of Html5_types.phrasing
     | `Output
     | `PCDATA
     | `Progress
     | `Q
     | `Ruby
     | `Samp
     | `Script
     | `Select
     | `Small
     | `Span
     | `Strong
     | `Sub
     | `Sup
     | `Svg
     | `Textarea
     | `Time
     | `U
     | `Var
     | `Video of Html5_types.phrasing_without_media
     | `Video_interactive of Html5_types.phrasing_without_media
     | `Wbr
     > `Abbr `B `Bdo `Br `Canvas `Cite `Code `Command `Datalist
     `Del `Dfn `Em `I `Img `Ins `Kbd `Map `Mark `Meter `Noscript
     `Object `PCDATA `Progress `Q `Ruby `Samp `Script `Small
     `Span `Strong `Sub `Sup `Svg `Time `U `Var `Wbr ]
     as 'a, 'b)
     Html5_types.between_phrasing_and_phrasing_without_interactive,
     'a, Html5_types.phrasing_without_interactive)
     wiki_plugin
;
}
val register_wiki_phrasing_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  wiki_phrasing_pplugin -> unit
val register_interactive_wiki_phrasing_extension : 
  name:string ->
  ?reduced:bool ->
  ?preparser:preparser ->
  wiki_phrasing_pplugin -> unit

The default syntax parser. It parses wiki creole syntax, as well as div, span, wikiname, raw, content, menu and cond tags. Default (and full) wiki parser.

val wikicreole_parser : 
  (Html5_types.flow5, Html5_types.flow5_without_interactive,
   Html5_types.phrasing_without_interactive)
  ext_wikicreole_parser

The same parser as wikicreole_parser but with a more precise type.

val reduced_wikicreole_parser0 : 
  (Html5_types.flow5, Html5_types.flow5_without_interactive,
   Html5_types.phrasing_without_interactive)
  ext_wikicreole_parser

The same, without subwikiboxes and containers (content). Used for example for forum messages.

val reduced_wikicreole_parser1 : 
  (Html5_types.flow5, Html5_types.flow5_without_interactive,
   Html5_types.phrasing_without_interactive)
  ext_wikicreole_parser

The same, without images, objects, subwikiboxes and containers (content). Used for example for forum messages with restricted features.

val reduced_wikicreole_parser2 : 
  (Html5_types.flow5, Html5_types.flow5_without_interactive,
   Html5_types.phrasing_without_interactive)
  ext_wikicreole_parser

The same, without images, objects, titles, tables, lists, subwikiboxes and containers (content).

val reduced_wikicreole_parser_button_content : 
  (Html5_types.button_content, Html5_types.button_content,
   Html5_types.button_content)
  ext_wikicreole_parser

For button content.

val phrasing_wikicreole_parser : 
  (Html5_types.phrasing, Html5_types.phrasing_without_interactive,
   Html5_types.phrasing_without_interactive)
  ext_wikicreole_parser

Parser for phrasing wikicreole.

val menu_parser : 
  ([ `H1 | `H2 | `H3 | `H4 | `H5 | `H6 ],
   [ `H1 | `H2 | `H3 | `H4 | `H5 | `H6 ],
   Html5_types.phrasing_without_interactive)
  ext_wikicreole_parser

Parser for menu

val wikicreole_content_type : 
  Html5_types.flow5 Eliom_content.Html5.F.elt list
  Wiki_types.content_type

the content type for wikicreole boxes:

val reduced_wikicreole_content_type0 : 
  Html5_types.flow5 Eliom_content.Html5.F.elt list
  Wiki_types.content_type

the content type for reduced_wikicreole_parser0:

val reduced_wikicreole_content_type1 : 
  Html5_types.flow5 Eliom_content.Html5.F.elt list
  Wiki_types.content_type

the content type for reduced_wikicreole_parser1:

val reduced_wikicreole_content_type2 : 
  Html5_types.flow5 Eliom_content.Html5.F.elt list
  Wiki_types.content_type

the content type for reduced_wikicreole_parser2:

val rawtext_content_type : 
  Html5_types.flow5 Eliom_content.Html5.F.elt list
  Wiki_types.content_type

the content type for raw text boxes:

val wikicreole_phrasing_content_type : 
  Html5_types.phrasing Eliom_content.Html5.F.elt list
  Wiki_types.content_type

the content type for wikicreole phrasing content. It is using phrasing_wikicreole_parser.

val preprocess_extension : 
  'res wikicreole_parser -> Wiki_models.wiki_preprocessor

*

Functions displaying wikicreole code

val xml_of_wiki : 
  'res wikicreole_parser ->
  Wiki_widgets_interface.box_info ->
  string -> 'res Eliom_content.Html5.F.elt list Lwt.t

Returns the HTML5 corresponding to a wiki page

val string_of_extension : 
  string -> (string * string) list -> string option -> string

Returns the wiki syntax for an extension box from its name, arguments and content.

val parse_common_attribs : 
  ?classes:Html5_types.nmtokens ->
  Wikicreole.attribs ->
  [> Html5_types.common ] Eliom_content.Html5.F.attrib list

parses common attributes (class, id, style)

type force_https = bool option

Type of wiki link:

  • Wiki_page (None, path, _) means the page of the currently display wiki at the given path.
  • Wiki_page (Some wiki, path, _) means a page in the providede wiki at the given path.
  • Href path means a link relative to the the domain if starting with a '/' or relative to the current URL otherwise.
  • Site path means a link relative the Ocsigen application site.
  • Absolute means an absolute URL (<otherscheme>:href).
val make_href : 
  Wiki_widgets_interface.box_info ->
  link_kind -> string option -> href
val class_wikibox : Wiki_types.wikibox -> string

The class to use to denote the fact that the content comes from the specified wikibox