# core


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

``` python
import nbformat
```

``` python
def is_n4l_cell(cell):
    """Pure function to check if cell has n4l marker"""
    return (cell.cell_type == 'raw' and 
            cell.source.strip().startswith('#| n4l'))

def extract_n4l_content(cell):
    """Pure function to extract content without marker"""
    lines = cell.source.strip().split('\n')
    return '\n'.join(lines[1:]).strip()

def process_notebook(notebook_path):
    """Main processing function using functional composition"""
    with open(notebook_path, 'r') as f:
        notebook = nbformat.read(f, as_version=4)
    
    # Functional pipeline
    return list(map(extract_n4l_content, 
                   filter(is_n4l_cell, notebook.cells)))
```

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

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

### find_dialog_name

>  find_dialog_name ()

``` python
from ipykernel import get_connection_info
```

``` python
# Get full connection details
conn_info = None
try:
    conn_info = get_connection_info()
except RuntimeError as e:
    print("not running in notebook", e)
conn_info
```

``` python
import json
```

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

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

### find_current_notebook

>  find_current_notebook ()

``` python
nb = None
try:
    nb = find_current_notebook()
except: pass
nb
```

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

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

### Path.export_n4l_content

>  Path.export_n4l_content ()

*Add n4l export capability to any Path object*

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

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

### nbsstorytime_export

>  nbsstorytime_export ()
