|
1 |
| -# Notebook pub template |
| 1 | +# Notebook Publication Template |
2 | 2 |
|
3 |
| -This repo is a template for notebook publications. The publication rendered and hosted by this repository serves as a demo that can be viewed at [this URL](https://arcadia-science.github.io/notebook-pub-template/). |
| 3 | +This repo is a template for Jupyter notebook publications. The template produces a publication rendered and hosted by Quarto, which can be viewed at [this demo URL](https://arcadia-science.github.io/notebook-pub-template/). |
4 | 4 |
|
5 |
| -## How to use this template |
| 5 | +## Template Documentation |
6 | 6 |
|
7 |
| -1. Create a repo from this template |
| 7 | +All the learning resources for this template can be found in `developer-docs/`. |
8 | 8 |
|
9 |
| - In the top-right of this GitHub repo, select the green button that says "*Use this template*". |
| 9 | +- [Quickstart Guide](developer-docs/QUICKSTART.md) - **The most efficient way to get started** is to follow this guide (the rest can wait) |
| 10 | +- [Environment Setup Guide](developer-docs/ENVIRONMENT_SETUP.md) - How to set up your development environment |
| 11 | +- [Publishing Guide](developer-docs/PUBLISHING_GUIDE.md) - How to publish your notebook publication |
| 12 | +- [Template Architecture](developer-docs/TEMPLATE_ARCHITECTURE.md) - Understanding the template's structure |
10 | 13 |
|
11 |
| - **IMPORTANT**: When creating your repo from this template, you need to **check the box** that says, "*Include all branches*". This is because the hosted pub is managed on a separate branch. |
| 14 | +--- |
12 | 15 |
|
13 |
| -1. Config edits |
| 16 | +**NOTE: When ready to publish, fill in the information below, then delete this line and everything above it.** |
14 | 17 |
|
15 |
| - * Replace the variables in `_variables.yml` |
16 |
| - - For `google_analytics`, provide the publishing team your repo name and they'll provide you a Google Analytics tracking ID. |
17 |
| - * Replace the variables in `authors.yml`. |
18 |
| - - This can always be updated, but for now at least add yourself. |
| 18 | +# [PUB-TITLE] |
19 | 19 |
|
20 |
| -1. Install Quarto |
| 20 | +This code repository contains or points to all materials required for creating and hosting the publication entitled, *"[PUB-TITLE]"*. |
21 | 21 |
|
22 |
| - The publication is rendered with [Quarto](https://quarto.org/). If you don’t have it installed (check with quarto --version), you can install it [here](https://quarto.org/docs/get-started/). |
| 22 | +The publication is hosted at [this URL]([PUB-URL]). |
23 | 23 |
|
24 |
| -1. Setup the code environment |
| 24 | +## Data Description |
25 | 25 |
|
26 |
| - This repository uses conda to manage the computational and build environment. If you don’t have it installed (check with `conda --version`), you can find operating system-specific instructions for installing miniconda [here](https://docs.anaconda.com/miniconda/). |
| 26 | +[DESCRIPTION OF THE DATA] |
27 | 27 |
|
28 |
| - When you're ready, run the following commands to create and activate the environment. Replace `[REPO-NAME]` with your repository name. |
| 28 | +## Reproduce |
29 | 29 |
|
30 |
| - ```bash |
31 |
| - conda env create -n [REPO-NAME] --file env.yml |
32 |
| - conda activate [REPO-NAME] |
33 |
| - ``` |
| 30 | +Please see [SETUP.qmd](SETUP.qmd). |
34 | 31 |
|
35 |
| - (As you introduce dependencies to your publication, or if you already have your full set of dependencies, add them to `env.yml` with the version pinned.) |
| 32 | +## Contribute |
36 | 33 |
|
37 |
| - Now, install any internal packages in the repository: |
38 |
| - |
39 |
| - ```bash |
40 |
| - pip install -e . |
41 |
| - ``` |
42 |
| - |
43 |
| - And finally, install the [pre-commit](https://pre-commit.com/) hooks: |
44 |
| - |
45 |
| - ```bash |
46 |
| - pre-commit install |
47 |
| - ``` |
48 |
| - |
49 |
| - Test your installation with `make preview`. Your pub will open up in your browser. |
50 |
| - |
51 |
| - Afterwards, create a branch to work on (don't commit to `main` directly). |
52 |
| -
|
53 |
| -1. Register your publication with the Pub Team |
54 |
| -
|
55 |
| - If you intend to publish your analysis, fill out the "*Kick off a new pub*" form on the AirTable [Publishing toolkit](https://www.notion.so/arcadiascience/Publishing-2-0-f0c51bf29d1d4356a86e6cf8a72ae88b?pvs=4#e1de83e8dd2a4081904064347779ed25). |
56 |
| -
|
57 |
| -1. Create your pub |
58 |
| -
|
59 |
| - Edit `index.ipynb` to create your pub. As you work, render it in a live preview with `make preview`. |
60 |
| -
|
61 |
| -
|
62 |
| -## How to publish |
63 |
| -
|
64 |
| -1. Enable read/write permissions for GitHub Actions |
65 |
| -
|
66 |
| - In your repo, go to *Settings* -> *Actions* -> *General* -> *Workflow permissions*, and check the box, "*Read and write permissions*" |
67 |
| -
|
68 |
| -1. Populate the `README_TEMPLATE.md` |
69 |
| -
|
70 |
| - Populate `README_TEMPLATE.md` and then rename it to `README.md`. |
71 |
| -
|
72 |
| - **NOTE**: The content you're reading now is the current `README.md`, which is to be replaced with `README_TEMPLATE.md`. |
73 |
| - |
74 |
| -1. Remove placeholder package |
75 |
| - |
76 |
| - If you did not populate `src/analysis` with your own content, remove it (`rm -rf src/analysis`). |
77 |
| - |
78 |
| -1. Remove reference to the syntax demo from `_quarto.yml` |
79 |
| - |
80 |
| - Feel free to keep `demo.ipynb` in your repo, but remove the following lines in `_quarto.yml`: |
81 |
| - |
82 |
| - ``` |
83 |
| - - text: 'Demo' |
84 |
| - href: demo.ipynb |
85 |
| - ``` |
86 |
| - |
87 |
| - This will remove *Demo* from the navigation bar. |
88 |
| - |
89 |
| -1. Make the repository public |
90 |
| - |
91 |
| - In order for this pub to be open and reproducible, make the [repo public](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility). |
92 |
| - |
93 |
| -1. Enable comments |
94 |
| - |
95 |
| - Comments are handled with [Giscus](https://giscus.app/), which Quarto has an integration for. Once enabled, a widget is placed at the bottom of the publication that provides an interface to read, write, react, and respond to [GitHub Discussions](https://docs.github.com/en/discussions) comments. Comments made through the interface are automatically added as comments to a GitHub Discussions thread of your repository. |
96 |
| - |
97 |
| - First, [enable GitHub Discussions](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/enabling-or-disabling-github-discussions-for-a-repository) for your repo. |
98 |
| - |
99 |
| - Second, [install the Giscus App](https://github.com/apps/giscus) for your repository. Click *Configure*, select *Arcadia-Science*, then select your repository from the dropdown. Click *Update access*. |
100 |
| - |
101 |
| - **IMPORTANT**: Do not deselect any of the other Arcadia-Science repositories that already have the Giscus app installed, *e.g.* `Arcadia-Science/notebook-pub-template`. |
102 |
| - |
103 |
| - Now, edit the comments section in `_quarto.yml` with your repo name: |
104 |
| - |
105 |
| - ```yaml |
106 |
| - comments: |
107 |
| - giscus: |
108 |
| - repo: Arcadia-Science/notebook-pub-template |
109 |
| - input-position: top |
110 |
| - ``` |
111 |
| - |
112 |
| - You may have to wait a few minutes for `make preview` to properly render the Giscus widget. |
113 |
| - |
114 |
| -1. Get approval from the Pub Team |
115 |
| - |
116 |
| - Like all other pubs, follow the [AirTable toolkit guide](https://airtable.com/appN7KQ55bT6HHfog/pagm69ti1kZK1GhBx) through to the final step, "*Submit your pub for release*". |
117 |
| - |
118 |
| -1. Final run-through |
119 |
| - |
120 |
| - Begin with a clean branch (no uncommitted changes). Then run the notebook from the command line: |
121 |
| - |
122 |
| - ```bash |
123 |
| - make execute |
124 |
| - ``` |
125 |
| - |
126 |
| - This command will update `index.ipynb` with the latest execution results. Importantly, it may generate runtime artifacts in the `_freeze/` directory. |
127 |
| - |
128 |
| - Then run `make preview` to see how the publication is rendering. Verify that your changes appear how you intend them to appear. If not, make the necessary changes and re-run `make execute`. |
129 |
| - |
130 |
| - Once happy, commit `index.ipynb` and all files in the `_freeze/` directory. |
131 |
| - |
132 |
| - Now, create a pull request to merge your branch into `main`. Once your PR is approved, merge into `main`. |
133 |
| - |
134 |
| -1. Host the publication |
135 |
| - |
136 |
| - Publishing is automated through a GitHub Action that triggers when a pull request is merged into the `publish` branch. Thus, all that's required for your publication to go live is to merge into `publish`. By convention, we only merge changes from the `main` branch into `publish`. This ensures collaborators can merge their completed work into `main`, where others can see and build upon it, while keeping those changes private until they are deliberately hosted by merging `main` into `publish`. |
137 |
| -
|
138 |
| - When all your changes have been merged into `main` and you're ready for your publication to go live, open a pull request to merge `main` into `publish`. Once approved and merged, your publication will be live within minutes. |
139 |
| - |
140 |
| -## Publishing revisions |
141 |
| - |
142 |
| -See [CONTRIBUTING.qmd](CONTRIBUTING.qmd). |
| 34 | +Please see [CONTRIBUTING.qmd](CONTRIBUTING.qmd). |
0 commit comments