Package markydown provides a parser for Markydown, a small subset of Markdown that is enough for my needs. YMMV. This is not a Markydown-to-HTML (or to any other format, for that matter) converter. The provided parser will simply call some methods of a user-supplied `Processor` object as it detects, for example, that a new paragraph started, the formatting changed or some text is to be "emitted". Example shows how to use the parser to create a simple Markydown-to-HTML converter. This gives an idea on how the parser works, but don't expect this coverter to be foolproof -- it is not!
Package bbcode implements a parser and HTML generator for BBCode.
Package bbcode implements a parser and HTML generator for BBCode.
Package markdown implements markdown parser and HTML renderer.
Package libxml2 is an interface to libxml2 library, providing XML and HTML parsers with DOM interface.
Package markdown implements markdown parser and HTML renderer.
Package libxml2 is an interface to libxml2 library, providing XML and HTML parsers with DOM interface.
Package markdown implements markdown parser and HTML renderer.
Package bbcode implements a parser and HTML generator for BBCode.
Package libxml2 is an interface to libxml2 library, providing XML and HTML parsers with DOM interface.
Package htmltojson is a HTML parser, based on net/html package.
Package markdown implements markdown parser and HTML renderer.
Package markdown implements markdown parser and HTML renderer.
Package markdown implements markdown parser and HTML renderer.
Package libxml2 is an interface to libxml2 library, providing XML and HTML parsers with DOM interface.
Command egg is an Expression Grammar Generator. At the moment it handles LL(1) grammars. We start in a directory containing the grammar file. The JSON grammar is Note: The productions for white space should no more accept empty strings and should use no repetitions. Use eg. ` |\n|\r|\t` or `[\n\r\t]` instead of the earlier examples where `( |\n|\r|\t)*` or `[\n\r\t]+` was used. The RecScanner handles sequences of white space by itself. Generate the parser from the above EBNF. Format the resulting Go files. Check the package docs. Initialize the module and pull in any dependencies. Run some tests. Run some benchmarks. Expression grammars are a slightly modified version of the EBNF used by the Go language specification: Productions are expressions constructed from terms and the following operators, in increasing precedence: Lowercase production names are used to identify lexical (terminal) tokens. Non-terminals are in CamelCase. Interpreted strings literals, like "foo", are tokens and will match literally, in this example the rune sequence "foo". Raw string literals, like `[0-9]`, are tokens and are interpreted as regexps, in this example matching a character class '0'-'9'. Repetitions, like in `re{min,max}` are not supported. Rune literals, like 'a', are tokens and will match literally, in this example the rune 0x61. Comments in the expression grammar start with the '#' character and stop at the end of the line. Lexical production names starting with '_' are reserved. Generated LL(1) parsers return an []int32. The slice encodes the AST as follows This is testdata/parser/expr.ebnf The parser generated from the above grammar in expr_test.go defines these symbols Having this example walk function And this AST from parsing testdata/expr/number="42\n" is Calling Prints (the part starting with # is an explanatory comment, it is not actually printed) The parser's Token method signature is The <file> argument names an Expression Grammar (EBNF) file. -constprefix <string> Strings to prepend to names of generated constants. The default is an empty string. -dbg Generate a parser producing debug traces during parsing. The parser calls function `trc` with the same signature as fmt.Printf. You need to provide the trc function somewhere in your package. -html2ebnf <string> The string argument names a HTML document containing <pre> nodes with class=ebnf and writes the result to os.Stdout or what -o says. Example: $ egg -o go_spec.ebnf -html2ebnf /usr/local/go/doc/go_spec.html -methodprefix <string> Strings to prepend to names of generated parser methods. The default is an empty string. -o <filename> Name the output parser file. Example $ egg -o parser.go ebnf.go This flag is optional, output defaults to os.Stdout. -package <string> The string argument is the package name for the produced parser. The argument defaults to "main". -start <string> The string argument names the top level non terminal in the input EBNF file. The argument defaults to "Start". -test <filename> Write a rudimentary test/benchmark facility to <filename>. Example $ egg -o parser.go -test parser_test.go -type <string> The string argument names the parser type. The argument defaults to "Parser". -typeprefix <string> Strings to prepend to names of other generated types. The default is an empty string. -varprefix <string> Strings to prepend to names of generated variables. The default is an empty string. -white <string> The string argument names the lexical/terminal production in the input EBNF file which defines white space separating tokens. The argument defaults to "white_space". When using the produced test facility, all non flag argument on the command line are considered test inputs. Example The produced test command line flags are -yes <string> A regular expression for input base names that must parse without errors. Defaults to "" meaning all test inputs are expected to parse without errors. Example: `-yes '^y_'` means all files with prefix `y_` must parse without errors. -no <string> A regular expression for input base names that must parse with errors. Defaults to "" meaning no test inputs are expected to parse with errors. Example: `-no '^n_'` means all files with prefix `n_` must parse with errors. -may <string> A regular expression for input base names that may parse with errors but that is not considered a failure. Defaults to "" meaning no test inputs are expected to parse with errors. Example: `-may '^i_'` means all files with prefix `i_` may parse with errors without failing the test. The benchmark considers all non flag argument on the command line as test inputs. Example
Package markdown implements markdown parser and HTML renderer.
Package libxml2 is an interface to libxml2 library, providing XML and HTML parsers with DOM interface.
Package markdown implements markdown parser and HTML renderer.
Package markdown implements markdown parser and HTML renderer.