1. camlspotter
  2. omy

Commits

camlspotter  committed d28e463

doc fix

  • Participants
  • Parent commits 3346f60
  • Branches default

Comments (0)

Files changed (1)

File doc/reSTOMake.py

View file
  • Ignore whitespace
         else:
             m = re.match("^\s*([A-Za-z_0-9\.]+\(.*\))\s*=", line) # a function
             if m:
-                heading = ".. function:: " + m.group(1) + "\n\n"
+                heading = ".. index::\n    " + m.group(1) + "\n\n" + m.group(1) + "\n\n"
             else:
                 m = re.match("^\s*([A-Za-z_0-9\[\]\.]+)\s*=(.*)", line) # a variable
                 if m:
-                    heading = ".. function:: " + m.group(1) + " variable\n\n" # CR variable required since py context add () otherwise
+                    heading = ".. index::\n    single: " + m.group(1) + "\n\n" + m.group(1) + "\n" # CR variable required since py context add () otherwise
                     if not re.match("^\s*$", m.group(2)):
                         formatted = ["\n", "::", "\n", "\n", "    = " + m.group(2) + "\n\n"] + formatted
                 elif re.match(":", line): # a rule
-                    heading = ".. function:: " + line  + "\n"
+                    heading = ".. index::\n    single: " + line + "\n\n" + line  + "\n"
                 else: # an expr
-                    heading = ".. function:: " + line + "\n"
+                    heading = ".. index::\n    single: " + line + "\n\n" + line + "\n"
     if heading == None:
         ()
     elif heading == "":