def domain_pass(struct): d = find_section(struct, name="Domains", section_type='section') if d: domains = find_all_sections(struct, name=re.compile('^.*Domain$'), section_type='section') for domain in domains: remove_section(struct, domain) domain['subtype'] = 'cleric_domain' add_section(d, domain) return struct
def domain_pass(struct): d = find_section(struct, name="Domains", section_type="section") if d: domains = find_all_sections(struct, name=re.compile("^.*Domain$"), section_type="section") for domain in domains: remove_section(struct, domain) domain["subtype"] = "cleric_domain" add_section(d, domain) return struct
def familiar_pass(rules, basename): if basename in ['familiar.html', 'newFamiliars.html']: creatures = find_all_sections(rules, section_type='creature') for creature in creatures: creature['subtype'] = 'familiar' return rules