v/cmd/tools/vdoc
Nick Treleaven 226bb4bd8b vdoc: highlight inline examples for `-f html`
This doesn't include multi-line examples or README.md example.
Part of https://github.com/vlang/v/issues/13851.

If the example isn't valid V:
```v
// Example: `if ouch { return error('an error occurred') }`
```
You'll get an error like:
```
internal_memory:1:47: error: invalid character literal `if ouch { return error('an error occurred') }` => `if ouch { return error('an error occurred') }` ([`i`, `f`, ` `, `o`, `u`, `c`, `h`, ` `, `{`, ` `, `r`, `e`, `t`, `u`, `r`, `n`, ` `, `e`, `r`, `r`, `o`, `r`, `(`, `'`, `a`, `n`, ` `, `e`, `r`, `r`, `o`, `r`, ` `, `o`, `c`, `c`, `u`, `r`, `r`, `e`, `d`, `'`, `)`, ` `, `}`]) (more than one character)
internal_memory:1:1: details: use quotes for strings, backticks for characters
```

This one is less informative about the source line:
```v
// Example: assert 'h`.is_capital() == false
```
```
internal_memory:1:33: error: unfinished string literal
```
2022-03-30 18:06:10 +01:00
..
tests os: add os.quoted_path/1, use it consistently for running V itself 2022-01-22 21:13:28 +02:00
theme tools: add a `-theme-dir folder/` parameter to `v doc` (#13550) 2022-02-21 12:08:46 +02:00
html.v vdoc: highlight inline examples for `-f html` 2022-03-30 18:06:10 +01:00
html_tag_escape_test.v vdoc: fix wrong escaping in HTML docs (#10638) 2021-07-30 12:00:03 +03:00
markdown.v v doc: small clean of `Return to contents` markdown link 2021-07-27 13:00:07 +03:00
utils.v strings: rename Builder.write_b() to Builder.write_byte(), add deprecation (#13313) 2022-01-28 20:34:44 +02:00
vdoc.v tools: add a `-theme-dir folder/` parameter to `v doc` (#13550) 2022-02-21 12:08:46 +02:00