def reference_field(key, value, value_text=None): field_name = nodes.field_name(key, key) field_body_ref = nodes.reference(value, value_text or value, refuri=value) field_body_p = nodes.paragraph('', '', field_body_ref) field_body = nodes.field_body('', field_body_p) return nodes.field('', field_name, field_body)
def text_field(key, value): field_name = nodes.field_name(key, key) field_body_p = nodes.paragraph(value, value) field_body = nodes.field_body('', field_body_p) return nodes.field('', field_name, field_body)