src/modules/gendoc.rb
# Convert the C comment to markdown
Convert the C comment to markdown
Convert the C comment to markdown
def markdown(s)
    s = s.gsub(/\*\/$/,"")
    s = s.gsub(/^ ?\* ?/,"")
    s = s.gsub(/^\/\*\*? ?/,"")
    s.chop! while s[-1] == "\n" || s[-1] == " "
    lines = s.split("\n")
    newlines = []
    lines.each{|l|
        if not l.start_with?('    ')
            l = l.gsub(/(?<!`)RM_[A-z()]+/){|x| "`#{x}`"}
            l = l.gsub(/(?<!`)RedisModule[A-z()]+/){|x| "`#{x}`"}
            l = l.gsub(/(?<!`)REDISMODULE_[A-z]+/){|x| "`#{x}`"}
        end
        newlines << l
    }
    return newlines.join("\n")
end
def markdown ( s ) s = s . gsub ( / \* \/ $ / , "" ) s = s . gsub ( / ^ ? \*  ? / , "" ) s = s . gsub ( / ^ \/ \* \* ? ? / , "" ) s . chop! while s [ - 1 ] == "\n" || s [ - 1 ] == " " lines = s . split ( "\n" ) newlines = [ ] lines . each { | l | if not l . start_with? ( '    ' ) l = l . gsub ( / (?<!`)RM_[A-z()]+ / ) { | x | "`#{x}`" } l = l . gsub ( / (?<!`)RedisModule[A-z()]+ / ) { | x | "`#{x}`" } l = l . gsub ( / (?<!`)REDISMODULE_[A-z]+ / ) { | x | "`#{x}`" } end newlines << l } return newlines . join ( "\n" ) end
Convert the C comment to markdown
Convert the C comment to markdown
# Backquote function, macro and type names, except if already backquoted and # in code blocks indented by 4 spaces.
s
<not_specific>