this repo has no description

Add docstrings for distinguishing codeblock content and raw content

authored by

Paul-Elliot and committed by jon.recoil.org 9a5aa2c7 400b51a7

+36
+6
doc/dune
··· 54 54 odoc-config.sexp 55 55 (odoc_logo_placeholder.jpg as odoc-pages/odoc_logo_placeholder.jpg)) 56 56 (package odoc)) 57 + 58 + (install 59 + (section doc) 60 + (files 61 + (odoc-parser-config.sexp as odoc-config.sexp)) 62 + (package odoc-parser))
+1
doc/odoc-parser-config.sexp
··· 1 + (packages odoc)
+6
src/parser/ast.ml
··· 48 48 meta : code_block_meta option; 49 49 delimiter : string option; 50 50 content : string with_location; 51 + (** This is the raw content, that is the exact string inside the 52 + delimiters. In order to get the "processed" content, see 53 + {!Odoc_parser.codeblock_content} *) 51 54 output : nestable_block_element with_location list option; 52 55 } 53 56 ··· 55 58 [ `Paragraph of inline_element with_location list 56 59 | `Code_block of code_block 57 60 | `Verbatim of string 61 + (** This is the raw content, that is the exact string inside the delimiters. 62 + In order to get the "processed" content, see 63 + {!Odoc_parser.verbatim_content} *) 58 64 | `Modules of string with_location list 59 65 | `List of 60 66 [ `Unordered | `Ordered ]
+23
src/parser/odoc_parser.mli
··· 45 45 that call in addition to the {!Loc.point} being converted. *) 46 46 47 47 val codeblock_content : Loc.span -> string -> string * Warning.t list 48 + (** Process the content of a code block, following the rules described 49 + {{!/odoc/odoc_for_authors.indentation_code_blocks}here}. To achieve this, it 50 + needs the location of the code block (including the separators) and the raw 51 + content of the code block. For instance, with the following code block: 52 + 53 + {delim@ocaml[ 54 + {[ 55 + hello 56 + ]} 57 + ]delim} 58 + 59 + We can go from the raw content ["\n hello\n "] to the processed content 60 + [" hello"] with: 61 + {[ 62 + match codeblock.value with 63 + | `Code_block { content; _ } -> 64 + codeblock_content codeblock.location content.value 65 + ]} 66 + 67 + Also returns a list of warnings, eg if the content is not appropriately 68 + indented. *) 69 + 48 70 val verbatim_content : Loc.span -> string -> string * Warning.t list 71 + (** Similar to {!codeblock_content} but for verbatims. *)