help / Apr 01 2019

Importing and Exporting

Interoperability is a core value at Nextjournal. We want to make it easy to get work in and out of the platform.

1. Import

1.1. Drag-and-Drop Data, Images, and Files

Simply drag-and-drop data, images, and files into a Nextjournal notebook and they will be added to your project and saved in 'content addressed storage'. This means the data is saved and versioned along with your notebook.

You can also use the insert (+) menu to add content to your notebook

Here is an example of an uploaded file:

matrix-data.csv

1.2. One-click import for Jupyter, Markdown, and R Markdown

Click 'Add new notebook' and use the importer to upload the file from your local machine, or use the URL link to import a hosted notebook.

Don't forget that you will need to install dependencies and copy your data to the notebook to get it running.

1.3. Docker Images

Use the Import Docker Environment option in the ➕ insert menu to import Docker environments. For example, first load the Bash official image on Docker Hub:

bash
Download as Docker image from:
Copy
This image was imported from: bash:latest

Then create a new cell, change the environment to the new Docker container (in this case is is called bash), and inspect the operating system:

head -n 2 /etc/os-release

1.4. Amazon S3 and Google Cloud Storage

To connect to cloud storage, select Bucket Access (S3 / GCS) from the ➕ insert menu.

For example:

nextjournal-s3-demo
Public

Then, mount the repository by selecting + Add mount under the Runtime settings menu.

View the contents of the bucket.

ls -lah /nextjournal-s3-demo

1.5. GitHub

To connect to a GitHub repository, select Import GitHub Repository from the ➕ insert menu.

  • Repository Name: Use nextjournal/demo to name a repository with the URL https://github.com/nextjournal/demo

Then mount the repository by selecting + Add mount under the runtime settings.

2. Export

2.1. Markdown

Nextjournal exports a .njmd markdown document that will render in any markdown rendering software. The file also features metadata that makes importing back into Nextjournal painless.

2.2. Data

Data can be exported with a single click using the download button that is associated with every dataset on Nextjournal.

Click the cloud button to download the data.

matrix-data.csv

2.3. Docker Images

To download docker images, select Export the environment under Runtime settings to make the Docker image available for download.

Copy the url and download it using docker pull.

For example, this command will pull this notebook's environment:

docker pull docker.nextjournal.com/environment@sha256:5c5b14582615f16d41b27c7cd7cbdb41d2d98777405aaa1913b474b697e7c25c
Bash