6.19.10.2.25.1. Headings

Start python section to interscript/frames/inputf.py[35 /42 ] Next Prev First Last
  1160: #line 1517 "input_frame.ipk"
  1161:   def head(self, level, text, **kwds):
  1162:     level = int(level)
  1163:     level = level + self.head_offset
  1164:     self.last_head = level
  1165:     if 'headings' in self.process.trace:
  1166:       print ('  '*(level-1))+'"'+text+'"'
  1167:     self.pass_frame.toc.append((level,text, kwds))
  1168:     if self.current_tangler: self.code_foot()
  1169:     self.tangler_set(None)
  1170:     apply(add_translation,(text,),kwds.get('translations',{}))
  1171:     apply(self.current_weaver.head,(level,text),kwds)
  1172: 
  1173:   # like heading, but to be used in code as well:
  1174:   # doesn't switch to document mode, doesn't do
  1175:   # code headings and footings.
  1176:   # deprecated form client interface, but required for perl tangler
  1177: 
  1178:   def heading(self, level, text, **kwds):
  1179:     "Weave a heading"
  1180:     level = int(level)
  1181:     level = level + self.head_offset
  1182:     self.last_head = level
  1183:     if 'headings' in self.process.trace:
  1184:       print ('  '*(level-1))+'"'+text+'"'
  1185:     self.pass_frame.toc.append((level,text, kwds))
  1186:     apply(self.current_weaver.head,(level,text),kwds)
  1187: 
  1188:   def push_head(self, amt=1):
  1189:     "Push the heading level onto the heading level stack"
  1190:     self.head_offset = self.head_offset + amt
  1191: 
  1192:   def pop_head(self, amt=1):
  1193:     "Pop the heading level from the heading level stack"
  1194:     self.push_head(-amt)
  1195: 
  1196:   def set_head(self, amt=None):
  1197:     "Set the heading level"
  1198:     if amt != None:
  1199:       self.head_offset = amt - 1
  1200:     else:
  1201:       self.head_offset = self.last_head - 1
  1202: 
End python section to interscript/frames/inputf.py[35]