![]() |
![]() |
![]() |
![]() |
![]() |
Dark Mode | Mobile Adaption | Soft Syntax Highlight | Auto Language | Shortcut |
You can use links like cppref.microblock.cc/function
to jump to corresponding page directly.
The matching logic follows three steps:
-
Complete Match: The code first attempts a complete match for
xxx.html
. For example, if the user inputscstring.html
, the code tries to findcstring.html
. To facilitate matching, both the path and keyword are converted to lowercase, underscores are removed, and the.html
extension is stripped. -
Path Match: If the complete match fails, the code attempts to match inputs like
cpp26
to paths likecpp/26
. For instance, if the user inputscppstring
, the code tries to findcpp/string
. -
Partial Path Match: If the previous two matches fail, the code attempts a partial path match. This is the most complex part, allowing users to input a combination of partial paths, such as matching
functionalfunction
tocpp/functional/function.html
. It tries three matching strategies in decreasing order of priority:- No jumps, must match to the end: e.g.,
functionalfunction
matchesfunctional/function/function.html
orfunctional/function.html
- No jumps, doesn't have to match to the end: e.g.,
someabc
matchessome/abc/function.html
- Allows jumps, doesn't have to match to the end: e.g.,
someabc
might matchsome/xxxx/abc/yyyy.html
- No jumps, must match to the end: e.g.,
您可以使用类似 cppref.microblock.cc/function
的链接直接跳转到相应页面。
匹配逻辑遵循三个步骤:
-
完全匹配: 代码首先尝试完全匹配
xxx.html
。例如,如果用户输入cstring.html
,代码会尝试查找cstring.html
。为了便于匹配,路径和关键字都会转换为小写,下划线会被移除,并且会去掉.html
扩展名。 -
路径匹配: 如果完全匹配失败,代码会尝试将类似
cpp26
的输入匹配到路径cpp/26
。例如,如果用户输入cppstring
,代码会尝试查找cpp/string
。 -
部分路径匹配: 如果前两个匹配失败,代码会尝试进行部分路径匹配。这是最复杂的部分,允许用户输入部分路径的组合,例如将
functionalfunction
匹配到cpp/functional/function.html
。它按照优先级递减的顺序尝试三种匹配策略:- 无跳转,必须匹配到末尾:例如,
functionalfunction
匹配到functional/function/function.html
或functional/function.html
- 无跳转,不必匹配到末尾:例如,
someabc
匹配到some/abc/function.html
- 允许跳转,不必匹配到末尾:例如,
someabc
可能匹配到some/xxxx/abc/yyyy.html
- 无跳转,必须匹配到末尾:例如,
dir /s /b /o:gn > index.txt