from wrpylib.wrvalidators import rodelbahnbox_from_template, tristate_german_to_str, difficulty_german_to_str, \
avalanches_german_to_str, public_transport_german_to_str, opt_lonlat_from_str, \
opt_uint_from_str
-from wrpylib.lib_sledrun_wikitext_to_json import optional_set, get_sledrun_description
+from wrpylib.lib_sledrun_wikitext_to_json import optional_set, get_sledrun_description, wikilink_to_json, \
+ template_to_json, external_link_to_json
docuReplacements = {'¶ms;': pagegenerators.parameterHelp}
-def template_to_json(value: Template) -> dict:
- parameter = []
- for p in value.params:
- parameter.append({'value': str(p)})
- return {
- 'name': str(value.name),
- 'parameter': parameter
- }
-
-
-def wikilink_to_json(value: Wikilink) -> dict:
- wl = {'title': str(value.title)}
- if value.text is not None:
- wl['text'] = str(value.text)
- return wl
-
-
-def external_link_to_json(value: ExternalLink) -> dict:
- link = {'url': str(value.url)}
- if value.title is not None:
- link['text'] = str(value.title)
- return link
-
-
class SledrunWikiTextToJsonBot(
SingleSiteBot,
ConfigParserBot,