package htmlfromtexbooks
Install
Dune Dependency
Authors
Maintainers
Sources
md5=8eafd939e9dbcb31919c5be0ed144840
sha512=4e7d13452e0a6b358e013711085500d82faf034eb03845be7de86a631fbc7b66a9aede7eba63cfd35460992c16e74de6c7db9aa152234f7dbc3acf9ab31c12ee
doc/htmlfromtexbooks.lib/Htmlfromtexbooks/Parser/index.html
Module Htmlfromtexbooks.Parser
Source
Main module for parsing string to an AST representing LaTeX Books
type cmd =
| NullCommand
(*A nullcommand is nothing
*)| AtomCmd of string * string list
(*An atomic command just have a name and eventual parameters like \newline
*)| SimpleCmd of string * string list * string
(*A command with extactly one argument e.g. \chapter
*)name
| MultipleCmd of string * string list * string list
(*A command with multiple arguments e.g. \frac
*)x
Commande type : an internal used in the first phase of the parsing
type structure =
| Nul
| Line of string
(*A line of just plain text like "It's the Enterprise!"
*)| Cmd of cmd
(*A command of our internal type used in the parsing
*)| AtomicCmd of string * string list
(*The final type to represent an atomic command like \newline
*)| OneArgCmd of string * string list * structure list
(*Structure version of SimpleCdm
*)| MultipleArgCmd of string * string list * structure list list
(*Structure version of MultipleCmd
*)| Env of string * structure list
(*An environment like document,center,equation...
*)| Math of string
(*A re-latexified math literal to be sent to an online image processing
*)| Subsubsection of string * structure list
(*Represent the LaTeX subsubsection, a subsubsection have a name and a list of structure children
*)| Subsection of string * structure list
(*See above
*)| Section of string * structure list
(*See above
*)| Chapter of string * structure list
(*See above
*)
Structure used to represent in an AST-ish (just one node with a list of structure children) LaTeX
Parses an accolade for the first time (command reading)
Parses arguments of a function colorlinks,12pt
to a list of string "colorlinks","12pt"
Parses a command recursively, called when a \ is detected in the parsing of a string
Appends a line to a list if the line is not empty
Parses recursively a string into a list of structure, transforms commands to their final type
Take the list of structure and gives the preamble (everything before the start of the document) and the document itself
Recursively generates the environments (begin...end) statements
Reads the preamble for type,title,author and eventual glossary input