Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Find And Replace In Template

Code

skeleton = """  $ZERO: $ZERO_set,"""

things = [
  ("checklist",),
  ("comment",),
  ("detail",),
  ("json",),
  ("json_plugin",),
  ("list",),
  ("preformatted",),
  ("standard",),
  ("table",),
  ("text_plugin",),
  ("yaml",),
]


print("ConfigSectionCategories {")

for thing in things:
  out = skeleton.replace("$ZERO", thing[0])
  print(out)

print("}")

Results

ConfigSectionCategories {
  checklist: checklist_set,
  comment: comment_set,
  detail: detail_set,
  json: json_set,
  json_plugin: json_plugin_set,
  list: list_set,
  preformatted: preformatted_set,
  standard: standard_set,
  table: table_set,
  text_plugin: text_plugin_set,
  yaml: yaml_set,
}