Markdown code blocks migration part 7 (#20547)
This commit is contained in:
parent
13b3ea71da
commit
19ff746916
17 changed files with 426 additions and 411 deletions
|
|
@ -13,7 +13,7 @@
|
|||
##
|
||||
## You can use this to build your own syntax highlighting, check this example:
|
||||
##
|
||||
## .. code:: Nim
|
||||
## ```Nim
|
||||
## let code = """for x in $int.high: echo x.ord mod 2 == 0"""
|
||||
## var toknizr: GeneralTokenizer
|
||||
## initGeneralTokenizer(toknizr, code)
|
||||
|
|
@ -31,19 +31,20 @@
|
|||
## else:
|
||||
## echo toknizr.kind # All the kinds of tokens can be processed here.
|
||||
## echo substr(code, toknizr.start, toknizr.length + toknizr.start - 1)
|
||||
## ```
|
||||
##
|
||||
## The proc `getSourceLanguage` can get the language `enum` from a string:
|
||||
##
|
||||
## .. code:: Nim
|
||||
## ```Nim
|
||||
## for l in ["C", "c++", "jAvA", "Nim", "c#"]: echo getSourceLanguage(l)
|
||||
## ```
|
||||
##
|
||||
## There is also a `Cmd` pseudo-language supported, which is a simple generic
|
||||
## shell/cmdline tokenizer (UNIX shell/Powershell/Windows Command):
|
||||
## no escaping, no programming language constructs besides variable definition
|
||||
## at the beginning of line. It supports these operators:
|
||||
##
|
||||
## .. code:: Cmd
|
||||
## & && | || ( ) '' "" ; # for comments
|
||||
## ```Cmd
|
||||
## & && | || ( ) '' "" ; # for comments
|
||||
## ```
|
||||
##
|
||||
## Instead of escaping always use quotes like here
|
||||
## `nimgrep --ext:'nim|nims' file.name`:cmd: shows how to input ``|``.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue