Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimise highlightjs usage #602

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fasthtml/js.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def light_media(
def dark_media(
css: str # CSS to be included in the dark media query
):
"Render dark media for nught mode views"
"Render dark media for night mode views"
return Style('@media (prefers-color-scheme: dark) {%s}' %css)

# %% ../nbs/api/03_js.ipynb
Expand Down Expand Up @@ -56,7 +56,7 @@ def KatexMarkdownJS(

# %% ../nbs/api/03_js.ipynb
def HighlightJS(
sel='pre code', # CSS selector for code elements. Default is industry standard, be careful before adjusting it
sel='pre code:not([data-highlighted="yes"])', # CSS selector for code elements. Default is industry standard, be careful before adjusting it
langs:str|list|tuple='python', # Language(s) to highlight
light='atom-one-light', # Light theme
dark='atom-one-dark' # Dark theme
Expand Down
4 changes: 2 additions & 2 deletions nbs/api/03_js.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"def dark_media(\n",
" css: str # CSS to be included in the dark media query\n",
" ):\n",
" \"Render dark media for nught mode views\"\n",
" \"Render dark media for night mode views\"\n",
" return Style('@media (prefers-color-scheme: dark) {%s}' %css)"
]
},
Expand Down Expand Up @@ -228,7 +228,7 @@
"source": [
"#| export\n",
"def HighlightJS(\n",
" sel='pre code', # CSS selector for code elements. Default is industry standard, be careful before adjusting it\n",
" sel='pre code:not([data-highlighted=\"yes\"])', # CSS selector for code elements. Default is industry standard, be careful before adjusting it\n",
" langs:str|list|tuple='python', # Language(s) to highlight\n",
" light='atom-one-light', # Light theme\n",
" dark='atom-one-dark' # Dark theme\n",
Expand Down
Loading