diff options
author | Viktor Söderqvist <viktor.soderqvist@est.tech> | 2022-06-21 16:00:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 17:00:24 +0300 |
commit | 02acb8fd3a6ec38cabad8dde520ccf0f359bd6ec (patch) | |
tree | 8ab20a143aec0efc0ea61e8ca6badf834812cc1a /utils | |
parent | 61baabd8d5cd9178f48b6fad79ae3cb477ef0a11 (diff) | |
download | redis-02acb8fd3a6ec38cabad8dde520ccf0f359bd6ec.tar.gz |
Module API docs corrections (#10890)
* Fix typo `RedisModule_CreatString` -> `RedisModule_CreateString` (multiple occurrences)
* Make the markdown gen script change all `RM_` to `RedisModule_` even in code examples, etc.
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/generate-module-api-doc.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/generate-module-api-doc.rb b/utils/generate-module-api-doc.rb index d4282cbfa..8829434bc 100755 --- a/utils/generate-module-api-doc.rb +++ b/utils/generate-module-api-doc.rb @@ -11,12 +11,13 @@ def markdown(s) s.chop! while s[-1] == "\n" || s[-1] == " " lines = s.split("\n") newlines = [] - # Fix some markdown, except in code blocks indented by 4 spaces. + # Fix some markdown lines.each{|l| + # Rewrite RM_Xyz() to RedisModule_Xyz(). + l = l.gsub(/(?<![A-Z_])RM_(?=[A-Z])/, 'RedisModule_') + # Fix more markdown, except in code blocks indented by 4 spaces, which we + # don't want to mess with. if not l.start_with?(' ') - # Rewrite RM_Xyz() to `RedisModule_Xyz()`. The () suffix is - # optional. Even RM_Xyz*() with * as wildcard is handled. - l = l.gsub(/(?<!`)RM_([A-z]+(?:\*?\(\))?)/, '`RedisModule_\1`') # Add backquotes around RedisModule functions and type where missing. l = l.gsub(/(?<!`)RedisModule[A-z]+(?:\*?\(\))?/){|x| "`#{x}`"} # Add backquotes around c functions like malloc() where missing. |