docs build script

main
Ziyang Hu 2 years ago
parent 8caf770f84
commit f2a0c06077

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
VERSION=$(cat ../Cargo.toml | grep -E "^version" | grep -Eo '[0-9.]+')
DEST_DIR=../../cozodb_site/$VERSION
make html
touch build/html/.nojekyll
rm -fr $DEST_DIR
mkdir -p $DEST_DIR
mv build/html $DEST_DIR/manual
make latexpdf
mv build/latex/thecozodatabasemanual.pdf $DEST_DIR/manual.pdf
jupyter nbconvert --to html tutorial/tutorial.ipynb
mv tutorial/tutorial.html $DEST_DIR/

@ -166,4 +166,19 @@ If you need to set an auth string, modify the global variable ``COZO_AUTH``.
The JavaScript Console is not as nice to use as Jupyter notebooks,
but we think that it provides a much better experience than hand-rolled CLI consoles,
since you can use JavaScript to manipulate the results.
since you can use JavaScript to manipulate the results.
--------------
Building
--------------
If for some reason the binary distribution does not work for you,
you can build Cozo from source, which is straightforward.
First, clone the Cozo git repo (you need to pass the ``--recursive`` flag so that submodules are also cloned),
then you need to install the `Rust toolchain <https://www.rust-lang.org/tools/install>`_ for your system.
You also need a C++17 compiler.
After these preparations, run ``cargo build --release`` in the root of the cloned repo,
wait for potentially a long time, and you will find the compiled binary in ``target/release``
if everything goes well. You can pass ``-F jemalloc`` to the ``cargo build`` command
to indicate that you want to compile and use jemalloc as the memory allocator for the RocksDB storage backend,
which, depending on your workload, can make a difference in performance.

@ -51,13 +51,15 @@
]
},
{
"cell_type": "raw",
"id": "72a21b8e-d66a-48d3-b684-e9554ea382cc",
"cell_type": "markdown",
"id": "341d8539-d6e1-4610-bd1e-6c29568573a8",
"metadata": {},
"source": [
"```bash\n",
"gunzip cozoserver-*.gz\n",
"mv cozoserver-* cozoserver\n",
"chmod +x cozoserver"
"chmod +x cozoserver\n",
"```"
]
},
{
@ -69,11 +71,13 @@
]
},
{
"cell_type": "raw",
"id": "a11f0388-dd7b-49a2-825f-0dde834ceb6b",
"cell_type": "markdown",
"id": "9809d37e-b1b3-4419-8c19-5fe7bc8994a6",
"metadata": {},
"source": [
"Expand-Archive -Path .\\cozoserver-*.zip -DestinationPath ."
"```powershell\n",
"Expand-Archive -Path .\\cozoserver-*.zip -DestinationPath .\n",
"```"
]
},
{
@ -87,11 +91,13 @@
]
},
{
"cell_type": "raw",
"id": "b4f837e4-6f26-4c57-a7a9-fb5765e4bc92",
"cell_type": "markdown",
"id": "59c6fdfc-1a3c-4da3-8138-6c653592995f",
"metadata": {},
"source": [
"./cozoserver ./tutorial-data"
"```bash\n",
"./cozoserver ./tutorial-data\n",
"```"
]
},
{
@ -111,11 +117,13 @@
]
},
{
"cell_type": "raw",
"id": "e7bd8545-8d42-43a4-ae3b-e946fc5ff19b",
"cell_type": "markdown",
"id": "e975d0a6-0851-4eed-9a24-d6b3d55fa09f",
"metadata": {},
"source": [
"./cozoserver -h"
"```bash\n",
"./cozoserver -h\n",
"```"
]
},
{
@ -153,11 +161,13 @@
]
},
{
"cell_type": "raw",
"id": "6ffa6d95-101b-4229-900a-ce9b14685439",
"cell_type": "markdown",
"id": "37b47a25-3708-490d-ba08-975771dc469d",
"metadata": {},
"source": [
"pip install pycozo pandas"
"```bash\n",
"pip install pycozo pandas\n",
"```"
]
},
{
@ -302,11 +312,13 @@
]
},
{
"cell_type": "raw",
"id": "fb8fee0c-4069-45c8-bb2a-9aa96037a6ed",
"cell_type": "markdown",
"id": "97547c5d-e2b4-4205-ac10-b2aeb5855782",
"metadata": {},
"source": [
"await run(`?[] <- [['hello', 'world', 'Cozo!']]`)"
"```javascript\n",
"await run(`?[] <- [['hello', 'world', 'Cozo!']]`)\n",
"```"
]
},
{

Loading…
Cancel
Save