Wiki facilities == Description == HOP provides facilities for easing //wiki// implementations. The main functions are wiki parsers. They parse characters according to the HOP's ,( :class "href" :onclick ~(hop_notepad_select "doc-notepad" "doc-wiki") "wiki syntax") and they build a HOP element tree. Some additional functions apply some treatments on these elements. == Synopsis == === Server === ( arg ...) (wiki-string->hop string [syntax]) (wiki-file->hop string [syntax]) (wiki-input-port->hop iport [syntax]) (hop-wiki->toc expr :ul :li :max-depth) (class wiki-syntax ...) == Examples == wiki == Server Definitions == === ++++ === ^ attributes ^ type ^ default ^ short description ^ | :src | string | //random// | a file to be processed. | | :cache | boolean | _ | an optional cache. | | :syntax | ::wiki-syntax | _ | an optional wiki syntax. | | body | element | empty | the text to be processed. | This markup creates a Hop element from a wiki text. The text can either be located in a file and passed as argument. When the text is contained in a file (the :src attributes contains a file name), the result of the compilation of the wiki syntax is cached if the attributed :cache is a cache (i.e., an instance of the ::cache class). The :cache attribute has no effect when the wiki text is found in the body of the ++++ markup. A cache can be created such as: (instantiate::cache (path (make-file-path (hop-rc-directory) "cache" (string-append "demo-" (integer->string (hop-port))))) (out (lambda (o p) (xml-write o p (hop-xml-backend)))))) === ++(wiki-string->hop string [syntax]) === wiki-string->hop ^ arguments ^ type ^ default ^ short description ^ | string | string | _ | the string to be parsed. | | syntax | ::wiki-syntax | _ | a wiki syntax descriptor. | Parses a string according to the HOP ,( :class "href" :onclick ~(hop_notepad_select "doc-notepad" "doc-wiki") "wiki syntax"). It returns a tree. === ++(wiki-file-->hop file [syntax]) === wiki-file->hop ^ arguments ^ type ^ default ^ short description ^ | file | string | _ | the name of the file to be parsed. | | syntax | ::wiki-syntax | _ | an wiki syntax descriptor. | This function is provided for convenience, it is a simple wrapper that uses ++wiki-input-port->hop++. === ++(wiki-input-port->hop iport [syntax]) === wiki-input-port->hop ^ arguments ^ type ^ default ^ short description ^ | port | input-port | _ | the input port to be parsed. | | syntax | ::wiki-syntax | _ | an wiki syntax descriptor. | Parses an input port according to the HOP ,( :class "href" :onclick ~(hop_notepad_select "doc-notepad" "doc-wiki") "wiki syntax"). It returns a tree. === ++(hop-wiki->toc expr :max-depth) === hop-wiki->toc ^ arguments ^ type ^ default ^ short description ^ | expr | obj | _ | an HOP tree. | | :ul | procedure | ++