Skip to content

Commit

Permalink
Finish up making line numbers optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlipperPA committed Oct 21, 2021
1 parent e1d85f8 commit 911dbc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ INSTALLED_APPS = [

## Django Settings

### Line Numbers

Line numbers are enabled by default, but can be disabled in Django's settings:

```python
WAGTAIL_CODE_BLOCK_LINE_NUMBERS = False
```
### Themes

Wagtail Code Block defaults to the PrismJS "Coy" theme, which looks good with Wagtail's CMS editor design. You can choose a different theme by configuring `WAGTAIL_CODE_BLOCK_THEME` in your Django settings. PrismJS provides several themes:
Expand All @@ -61,8 +68,7 @@ If you want to use the Default theme: `WAGTAIL_CODE_BLOCK_THEME = None`

### Languages Available

You can customize the languages available by configuring `WAGTAIL_CODE_BLOCK_LANGUAGES` in your Django settings.
By default, it will be set with these languages, since most users are in the Python web development community:
You can customize the languages available by configuring `WAGTAIL_CODE_BLOCK_LANGUAGES` in your Django settings. By default, it will be set with these languages, since most users are in the Python web development community:

```python
WAGTAIL_CODE_BLOCK_LANGUAGES = (
Expand Down
2 changes: 2 additions & 0 deletions wagtailcodeblock/templatetags/wagtailcodeblock_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def line_numbers_js():
"url": "//cdnjs.cloudflare.com/ajax/libs/prism/{PRISM_VERSION}/plugins/line-numbers/prism-line-numbers.min.js"
}}
""")
else:
return ""


@register.simple_tag
Expand Down

0 comments on commit 911dbc8

Please sign in to comment.