Skip to content

Commit 76fdd45

Browse files
committed
nbdev3
1 parent d628bc3 commit 76fdd45

5 files changed

Lines changed: 39 additions & 114 deletions

File tree

fasthtml/_modidx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Autogenerated by nbdev
22

33
d = { 'settings': { 'branch': 'main',
4-
'doc_baseurl': '/docs/',
4+
'doc_baseurl': '/docs',
55
'doc_host': 'https://www.fastht.ml',
66
'git_url': 'https://github.com/AnswerDotAI/fasthtml',
77
'lib_path': 'fasthtml'},

fasthtml/js.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@
66
__all__ = ['marked_imp', 'npmcdn', 'light_media', 'dark_media', 'MarkdownJS', 'KatexMarkdownJS', 'HighlightJS', 'SortableJS',
77
'MermaidJS']
88

9-
# %% ../nbs/api/03_js.ipynb #ddc8b61a
9+
# %% ../nbs/api/03_js.ipynb #cd3eb2a3
1010
import re
1111
from fastcore.utils import *
1212
from fasthtml.components import *
1313
from fasthtml.xtend import *
1414

15-
# %% ../nbs/api/03_js.ipynb #4c8d1272
15+
# %% ../nbs/api/03_js.ipynb #f7792683
1616
def light_media(
1717
css: str # CSS to be included in the light media query
1818
):
1919
"Render light media for day mode views"
2020
return Style('@media (prefers-color-scheme: light) {%s}' %css)
2121

22-
# %% ../nbs/api/03_js.ipynb #26cd2ccc
22+
# %% ../nbs/api/03_js.ipynb #0a2307c3
2323
def dark_media(
2424
css: str # CSS to be included in the dark media query
2525
):
2626
"Render dark media for night mode views"
2727
return Style('@media (prefers-color-scheme: dark) {%s}' %css)
2828

29-
# %% ../nbs/api/03_js.ipynb #c7cd64ef
29+
# %% ../nbs/api/03_js.ipynb #f60ca53b
3030
marked_imp = """import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
3131
"""
3232
npmcdn = 'https://cdn.jsdelivr.net/npm/'
3333

34-
# %% ../nbs/api/03_js.ipynb #857e3fe6
34+
# %% ../nbs/api/03_js.ipynb #3e318ccd
3535
def MarkdownJS(
3636
sel='.marked' # CSS selector for markdown elements
3737
):
3838
"Implements browser-based markdown rendering."
3939
src = "proc_htmx('%s', e => e.innerHTML = marked.parse(e.textContent));" % sel
4040
return Script(marked_imp+src, type='module')
4141

42-
# %% ../nbs/api/03_js.ipynb #fa5b6642
42+
# %% ../nbs/api/03_js.ipynb #595d4e8f
4343
def KatexMarkdownJS(
4444
sel='.marked', # CSS selector for markdown elements
4545
inline_delim='$', # Delimiter for inline math
@@ -54,7 +54,7 @@ def KatexMarkdownJS(
5454
css = Link(rel="stylesheet", href=npmcdn+"katex@0.16.11/dist/katex.min.css")
5555
return scr,css
5656

57-
# %% ../nbs/api/03_js.ipynb #c8144d89
57+
# %% ../nbs/api/03_js.ipynb #7a2a45ef
5858
def HighlightJS(
5959
sel='pre code:not([data-highlighted="yes"])', # CSS selector for code elements. Default is industry standard, be careful before adjusting it
6060
langs:str|list|tuple='python', # Language(s) to highlight
@@ -77,7 +77,7 @@ def HighlightJS(
7777
jsd(*hjc, 'highlightjs-copy.min.css', typ='css'),
7878
*langjs, Script(src, type='module')]
7979

80-
# %% ../nbs/api/03_js.ipynb #9004c11b
80+
# %% ../nbs/api/03_js.ipynb #59c00b7d
8181
def SortableJS(
8282
sel='.sortable', # CSS selector for sortable elements
8383
ghost_class='blue-background-class' # When an element is being dragged, this is the class used to distinguish it from the rest
@@ -88,7 +88,7 @@ def SortableJS(
8888
""" % sel
8989
return Script(src, type='module')
9090

91-
# %% ../nbs/api/03_js.ipynb #0e060ddb
91+
# %% ../nbs/api/03_js.ipynb #3518340d
9292
def MermaidJS(
9393
sel='.language-mermaid', # CSS selector for mermaid elements
9494
theme='base', # Mermaid theme to use

pyproject.toml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
11
[build-system]
2-
requires = ["setuptools>=64.0"]
2+
requires = ["setuptools>=64"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name="python-fasthtml"
6+
name="fasthtml"
7+
dynamic = ["version"]
8+
description = "The fastest way to create an HTML app"
9+
readme = "README.md"
710
requires-python=">=3.10"
8-
dynamic = [ "keywords", "description", "version", "dependencies", "optional-dependencies", "readme", "license", "authors", "classifiers", "entry-points", "scripts", "urls"]
11+
license = {text = "Apache-2.0"}
12+
authors = [{name = "Jeremy Howard and contributors", email = "github@jhoward.fastmail.fm"}]
13+
keywords = ['nbdev', 'jupyter', 'notebook', 'python']
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3 :: Only",
17+
]
18+
dependencies = []
919

10-
[tool.uv]
11-
cache-keys = [{ file = "pyproject.toml" }, { file = "settings.ini" }, { file = "setup.py" }]
20+
[project.urls]
21+
Repository = "https://github.com/AnswerDotAI/fasthtml"
22+
Documentation = "https://www.fastht.ml/docs/"
23+
24+
[project.entry-points.nbdev]
25+
fasthtml = "fasthtml._modidx:d"
26+
27+
[tool.setuptools.dynamic]
28+
version = {attr = "fasthtml.__version__"}
29+
30+
[tool.setuptools.packages.find]
31+
include = ["fasthtml"]
32+
33+
[tool.nbdev]
34+
jupyter_hooks = true
35+
custom_sidebar = false

settings.ini

Lines changed: 0 additions & 42 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)