Skip to content

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed Nov 25, 2024
1 parent 75856bb commit 2b3fed1
Show file tree
Hide file tree
Showing 9 changed files with 1,102 additions and 465 deletions.
64 changes: 0 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@

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

This file will become your README and also the index of your
documentation.

## Developer Guide

If you are new to using `nbdev` here are some useful pointers to get you
started.

### Install nb2fasthtml in Development mode

``` sh
Expand All @@ -25,59 +17,3 @@ $ nbdev_prepare
```

## Usage

### Installation

Install latest from the GitHub
[repository](https://github.com/AnswerDotAI/nb2fasthtml):

``` sh
$ pip install git+https://github.com/AnswerDotAI/nb2fasthtml.git
```

<!-- or from [conda](https://anaconda.org/AnswerDotAI/nb2fasthtml)
``` sh
$ conda install -c AnswerDotAI nb2fasthtml
```
or from [pypi](https://pypi.org/project/nb2fasthtml/)
``` sh
$ pip install nb2fasthtml
``` -->

### Documentation

Documentation can be found hosted on this GitHub
[repository](https://github.com/AnswerDotAI/nb2fasthtml)’s
[pages](https://AnswerDotAI.github.io/nb2fasthtml/). Additionally you
can find package manager specific guidelines on
[conda](https://anaconda.org/AnswerDotAI/nb2fasthtml) and
[pypi](https://pypi.org/project/nb2fasthtml/) respectively.

## How to use

Call a Jupyter notebook with the `nb2classic.core.render_nb` function. It will convert the notebook into FT Components. You will need to have the `MarkdownJS()` and `HighlightJS()` set in the FastHTML hdrs.

Here's an example that uses `demo.ipynb`, which is in the root of this project.

``` python
from nb2fasthtml.core import *
from fasthtml.common import *

hdrs = [
MarkdownJS(),
HighlightJS(langs=['python', 'javascript', 'html', 'css',]),
]

app, rt = fast_app(hdrs=hdrs)

@rt
def index():
return render_nb('demo.ipynb')

serve()
```

The `render_nb()` function can be configured to work with other layout libraries such as fh-frankenui.
Loading

0 comments on commit 2b3fed1

Please sign in to comment.