Skip to content

Commit

Permalink
deploy: 0ffeb79
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 4, 2024
0 parents commit e43d123
Show file tree
Hide file tree
Showing 26 changed files with 7,357 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
634 changes: 634 additions & 0 deletions app.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions app.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# app


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

``` python
from nb2fasthtml.core import *
```
813 changes: 813 additions & 0 deletions core.html

Large diffs are not rendered by default.

190 changes: 190 additions & 0 deletions core.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# nb


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

``` html
<script type="module" src="https://cdn.jsdelivr.net/npm/zero-md@3?register"></script>
```

<script type="module" src="https://cdn.jsdelivr.net/npm/zero-md@3?register"></script>

``` python
example_nb_dir = Path('../example_nbs/')
with open(example_nb_dir/'explaining_xt_components.ipynb', 'r') as f: xt_nb = json.load(f)
```

------------------------------------------------------------------------

<a
href="https://github.com/AnswerDotAI/nb2fasthtml/blob/main/nb2fasthtml/core.py#L14"
target="_blank" style="float:right; font-size:smaller">source</a>

### strip_list

> strip_list (l, val='\n')
------------------------------------------------------------------------

<a
href="https://github.com/AnswerDotAI/nb2fasthtml/blob/main/nb2fasthtml/core.py#L21"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_md

> render_md (c)
------------------------------------------------------------------------

<a
href="https://github.com/AnswerDotAI/nb2fasthtml/blob/main/nb2fasthtml/core.py#L26"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_md_cell

> render_md_cell (cell)
``` python
# show(Div(*map(render_md_cell,[o for o in xt_nb['cells'][:3] if o['cell_type']=='markdown'])))
```

------------------------------------------------------------------------

<a
href="https://github.com/AnswerDotAI/nb2fasthtml/blob/main/nb2fasthtml/core.py#L31"
target="_blank" style="float:right; font-size:smaller">source</a>

### get_nb_lang

> get_nb_lang (nb)
------------------------------------------------------------------------

<a
href="https://github.com/AnswerDotAI/nb2fasthtml/blob/main/nb2fasthtml/core.py#L35"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_code_source

> render_code_source (cell, lang='python')
``` python
# show(Div(*map(render_code_source,[o for o in xt_nb['cells'][:10] if o['cell_type']=='code'])))
```

------------------------------------------------------------------------

<a
href="https://github.com/AnswerDotAI/nb2fasthtml/blob/main/nb2fasthtml/core.py#L41"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_code_output

> render_code_output (cell, lang='python')
``` python
nbs_dir = Path('../example_nbs/')
with open(nbs_dir/'00_core.ipynb', 'r') as f: nb = json.load(f)

# render_code_output(nb['cells'][9])
```

``` python
# show(Div(*map(render_code_output,[o for o in xt_nb['cells'][:20] if o['cell_type']=='code'])))
```

------------------------------------------------------------------------

<a
href="https://github.com/AnswerDotAI/nb2fasthtml/blob/main/nb2fasthtml/core.py#L56"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_nb

> render_nb (fpath, wrapper=functools.partial(<function ft_hx at
> 0x7f08d34869e0>, 'main'), cls='container',
> md_cell_wrapper=functools.partial(<function ft_hx at
> 0x7f08d34869e0>, 'div'), md_fn=<function render_md_cell>,
> code_cell_wrapper=<function Card>, cd_fn=<function
> render_code_source>, out_fn=<function render_code_output>,
> **kwargs)
<table>
<colgroup>
<col style="width: 6%" />
<col style="width: 25%" />
<col style="width: 34%" />
<col style="width: 34%" />
</colgroup>
<thead>
<tr class="header">
<th></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>fpath</td>
<td></td>
<td></td>
<td>Path to Jupyter Notebook</td>
</tr>
<tr class="even">
<td>wrapper</td>
<td>partial</td>
<td>functools.partial(&lt;function ft_hx at 0x7f08d34869e0&gt;,
‘main’)</td>
<td>Wraps entire rendered NB, default is for pico</td>
</tr>
<tr class="odd">
<td>cls</td>
<td>str</td>
<td>container</td>
<td>cls to be passed to wrapper, default is for pico</td>
</tr>
<tr class="even">
<td>md_cell_wrapper</td>
<td>partial</td>
<td>functools.partial(&lt;function ft_hx at 0x7f08d34869e0&gt;,
‘div’)</td>
<td>Wraps markdown cell</td>
</tr>
<tr class="odd">
<td>md_fn</td>
<td>function</td>
<td>render_md_cell</td>
<td>md cell -&gt; rendered html</td>
</tr>
<tr class="even">
<td>code_cell_wrapper</td>
<td>function</td>
<td>Card</td>
<td>Wraps Source Code (body) + Outputs (footer)</td>
</tr>
<tr class="odd">
<td>cd_fn</td>
<td>function</td>
<td>render_code_source</td>
<td>code cell -&gt; code source rendered html</td>
</tr>
<tr class="even">
<td>out_fn</td>
<td>function</td>
<td>render_code_output</td>
<td>code cell -&gt; code output rendered html</td>
</tr>
<tr class="odd">
<td>kwargs</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

## Todo

- Quarto stuff rendered?
- Implement default for Markdown based on FastHTML’s default
Loading

0 comments on commit e43d123

Please sign in to comment.