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. After you published a notebook, you can control how others can find it:
- You can add it to your profile page, as such building out your data science portfolio
- You can share the publication link with peers for them to see your work.
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.
From this pane, you can also control whether or not your publication should be made available on your DataCamp profile page. That way your publications are discoverable without you having to share the link with specific people.
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.
Read Working with packagesto learn more about how to install and use additional packages in your notebook.
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.