Comment on page
Creating a Publication
How to create publications to share with others or the world
DataCamp Workspace allows you to turn a notebook of your workspace into a publication: a static version of your notebook, that is optimized for reading.
To create a publication:
- 1.Open your workspace.
- 2.Click the Publish button in the left-hand sidebar.
- 3.Select the notebook file you want to publish.
- 4.Click Publish.
Creating a publication from a notebook in your workspace
There are two publication 'modes':
- By default, your notebook will be run from top to bottom before publishing. This ensures full reproducibility, i.e. all cells run without error and the outputs are the result of executing the notebook in order.
- If you're not worried about reproducibility (you just want to fix some typos or styles, for example), you can switch the "run notebook from top to bottom" toggle off before clicking Publish. A snapshot of your current notebook is taken and turned into a publication quasi-instantly.
Publish panel when notebook was published successfully
If the publication was successful, your publication will become available through a unique link that you can visit by clicking "Open live publication" (shown above). This is also how readers of your publication will see it.
To determine who can view your publication, the permissions on your workspace are followed.
- If your workspace is private to you and shared with no-one, only you can see this publication.
- If your workspace is only shared with specific people, only those people will be able to view your publication.
- If your group workspace is shared with an entire group, only the members in that group will be able to view the publication.
- If your workspace is public, your publication can be viewed by anyone.
If an error was encountered in your code while rerunning your notebook, the publication will fail. In the Publishing pane, you can click View errors to see exactly what went wrong so you can correct your notebook and try again.
Special care is needed when both of the below are true:
- Your notebook uses additional packages on top of the packages that are available in Workspace by default.
- You're publishing with the 'Run notebook from top to bottom' option enabled.
In this case, you should make sure to install these additional packages at the top of your notebook.
This is necessary because the publication of a notebook happens in a brand-new Workspace session, that does not have your additional packages available anymore. If you do the installs at the top of the notebook, the first thing that happens when the notebook is rerun from top to bottom is installing these additional dependencies.
For every workspace, you can only create a single publication. It is currently not possible to generate two distinct publications from the same workspace. If you have more than one notebook in your workspaces, you'll be able to select which notebook you want to create a publication from.
If you made changes to your workspace after publishing, these changes are not automatically reflected in the publication. For the changes to ripple through to your publication, open up the publish pane again and hit the "Update" button. The URL of the updated publication as well as its sharing settings are preserved.