Skip to content

Commit

Permalink
fix: set default theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Aug 30, 2023
1 parent c3d4a9d commit b5971ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ckanext/pygments/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def pygment_preview(resource: dict[str, Any], theme: str) -> tuple[str, str]:
else:
data = resp.text

css_styles = HtmlFormatter(style=theme).get_style_defs(".highlight")
css_styles = HtmlFormatter(style=theme or "default").get_style_defs(".highlight")

return (
highlight(
Expand Down
2 changes: 1 addition & 1 deletion ckanext/pygments/templates/pygment_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

{{ form.input('file_url', id='field-file_url', label=_('File URL'), placeholder=_('eg. http://example.com/test.sql (if blank uses resource url)'), value=data.file_url, error=errors.file_url) }}

{{ form.select('theme', id='field-theme', label=_('Preview theme'), options=h.get_preview_theme_options(), selected=data.theme, error=errors.theme) }}
{{ form.select('theme', id='field-theme', label=_('Preview theme'), options=h.get_preview_theme_options(), selected=data.theme or "default", error=errors.theme) }}

0 comments on commit b5971ff

Please sign in to comment.