diff --git a/README.md b/README.md index 3503628..d857fe2 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ The *full stack* contains: * A unit test that tests this module. * A *Sphinx* documentation for this module. * A *Jupyter Notebook* showing how to use this module. +* a *marimo* notbook using this module. * A Python UI application that uses this module. * A WebAssembly binary library and associated JavaScript code. * An HTML/JavaScript frontend that uses the above WebAssembly library. @@ -91,6 +92,7 @@ The *full stack* contains: PY --> PYTEST[Python Module Unit Test] PY --> SPHINX(Sphinx Documentation) PY --> NOTEBOOK[Jupyter Notebook] + PY --> MARIMO[Marimo Notebook] PY --> PYAPP[Python UI App] F --> WASM(WebAssembly + JavaScript) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ae47883..eda29f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,6 +21,7 @@ if(ADD_PYTHON_MODULE) add_subdirectory(py) add_subdirectory(app_py) add_subdirectory(py_ipynb) + add_subdirectory(py_marimo) endif() if(ADD_PY_DOCS) diff --git a/src/py_marimo/start_marimo_notebook.sh b/src/py_marimo/start_marimo_notebook.sh new file mode 100755 index 0000000..f31b5bd --- /dev/null +++ b/src/py_marimo/start_marimo_notebook.sh @@ -0,0 +1,2 @@ +export PYTHONPATH=$PYTHONPATH:. +marimo run title_case_marimo.py --port=2719 --headless diff --git a/src/py_marimo/title_case_marimo.py b/src/py_marimo/title_case_marimo.py new file mode 100644 index 0000000..fc2daab --- /dev/null +++ b/src/py_marimo/title_case_marimo.py @@ -0,0 +1,40 @@ +import marimo + + +__generated_with = "0.1.5" +app = marimo.App() + + +@app.cell +def __(): + import marimo as mo + return mo, + + +@app.cell +def __(mo): + mo.md("# Title Case Demonstration").left() + return + + +@app.cell +def __(mo): + text = mo.ui.text(placeholder="Enter text ...", label="Headline:", full_width=True) + return text, + +@app.cell +def __(mo, text): + import text_conversion + result = text_conversion.title_case(text.value) + + return result + + +@app.cell +def __(mo, text, result): + mo.vstack([text, mo.md(f"Result: \"{result}\"")]) + return + + +if __name__ == "__main__": + app.run() \ No newline at end of file