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(/^ \* {0,1}/,"")
    s = s.gsub(/^\/\* /,"")
    s.chop! while s[-1] == "\n" || s[-1] == " "
    lines = s.split("\n")
    newlines = []
    lines.each{|l|
        if l[0] != ' '
            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 ( / ^  \*  {0,1} / , "" ) s = s . gsub ( / ^ \/ \* / , "" ) s . chop! while s [ - 1 ] == "\n" || s [ - 1 ] == " " lines = s . split ( "\n" ) newlines = [ ] lines . each { | l | if l [ 0 ] != ' ' 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
s
<not_specific>