You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/publishing/sections/5_analytics_portfolio_site.md
+28-12Lines changed: 28 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,9 @@ present in the data-analyses repo is your friend. You can find the Cal-ITP Analy
10
10
11
11
## Netlify Setup
12
12
13
-
Netlify is the platform turns our Jupyter Notebooks uploaded to GitHub into a full website. You must set up netlify key and/or make sure your Netlify token is up to date:
13
+
Netlify is the platform turns our Jupyter Notebooks uploaded to GitHub into a full website.
14
+
15
+
To setup your netlify key:
14
16
15
17
- Install netlify: `npm install -g netlify-cli`
16
18
- Navigate to your main directory
@@ -25,6 +27,10 @@ Netlify is the platform turns our Jupyter Notebooks uploaded to GitHub into a fu
25
27
- For the changes to take effect, open a new terminal or run `source ~/.bash_profile`
26
28
- Back in your terminal, enter `env | grep NETLIFY` to see that your Netlify token is there
27
29
30
+
To make sure your Netlify token is up to date:
31
+
32
+
- COMING SOON
33
+
28
34
## File Setup
29
35
30
36
In order to publish to analysis.calitp.org, you need to create two different files.
@@ -34,27 +40,28 @@ In order to publish to analysis.calitp.org, you need to create two different fil
34
40
35
41
### README.md
36
42
37
-
Create a `README.md` file in the repo where your work liesto detail the purpose of your website, methologies, relevant links, instructions, and more.
43
+
Create a `README.md` file in the repo where your work lies. This serves to detail purpose of your website, methologies, relevant links, instructions, and more. However, this also forms the landing page of your website.
38
44
39
-
- Your file should <b>always</b> be titled as `README.md`. No other variants such as `README_gtfs.md` or `read me.md` or ` README.md`. The portfolio can only take a `README.md` file when generating the landing page of your website.
45
+
- Your file should <b>always</b> be titled as `README.md`. No other variants such as `README_gtfs.md` or `read me.md` or ` README.md` are allowed. The portfolio can only take a `README.md` when generating the landing page of your website.
40
46
- If you do accidentally create a `README.md` file with extra strings, you can fix this by taking the following steps:
-`rm portfolio/my_analysis/_build/html/README_accidentally_named_something.html`. We use `rm` because \_build/html folder is not checked into GitHub
43
49
-`python portfolio/portfolio.py build my_report --no-execute-papermill --deploy` to rerun the portfolio to incorporate only the new changes to your `README.md` if the other pages are correct.
44
50
45
51
### YML
46
52
47
-
A`.yml`specifies the parameter you want your notebook to iterate over. For example, the [DLA Grant Analysis's`.yml`](https://github.com/cal-itp/data-analyses/blob/main/portfolio/sites/dla.yml) runs the same notebook for each of the 12 Caltrans districts and the districts are also listed on the \[left hand side\]((https://dla--cal-itp-data-analyses.netlify.app/readme) to form the "Table of Contents."
53
+
Each`.yml`file creates a new site on the [Portfolio's Index Page](https://analysis.calitp.org/), so every project needs its own file. DLA Grant Analysis, SB125 Route Illustrations, and Active Transportation Program all have their own `.yml` file.
48
54
49
-
Because each`.yml`file creates a new site on the [Portfolio's Index Page](https://analysis.calitp.org/), so every project needs its own file. DLA Grant Analysis, SB125 Route Illustrations, and Active Transportation Program all have their own `.yml` file.
55
+
All the`.yml`files live here at [data-analyses/portfolio/sites](https://github.com/cal-itp/data-analyses/tree/main/portfolio/sites).
50
56
51
-
The `.yml` files live here at [data-analyses/portfolio/sites](https://github.com/cal-itp/data-analyses/tree/main/portfolio/sites).
52
-
53
-
To create a `yml` file:
57
+
Here's how to create a `yml` file:
54
58
55
59
- Include the directory to the notebook(s) you want to publish.
60
+
56
61
- Name your `.yml` file. For now we will use `my_report.yml` as an example.
62
+
57
63
- The structure of your `.yml` file depends on the type of your analysis:
64
+
58
65
- If you have one parameterized notebook with **one parameter**:
- If you have a parameterized notebook with **multiple parameters**:
76
90
77
-
- Example: [rt.yml](https://github.com/cal-itp/data-analyses/blob/main/portfolio/sites/rt.yml). You can automate making a `.yml` file using a script, [example here](https://github.com/cal-itp/data-analyses/blob/main/gtfs_digest/deploy_portfolio_yaml.py).
91
+
- Example: [rt.yml](https://github.com/cal-itp/data-analyses/blob/main/portfolio/sites/rt.yml). You can also automate making a `.yml` file using a script, [example here](https://github.com/cal-itp/data-analyses/blob/main/gtfs_digest/deploy_portfolio_yaml.py).
78
92
79
93
```
80
94
title: My Analyses
@@ -131,15 +145,15 @@ To create a `yml` file:
131
145
132
146
## Building and Deploying your Report
133
147
134
-
After your Jupyter Notebook, README.md, and `.yml` files are setup properly, it's time to deploy your work to the Portfolio!
148
+
After your Jupyter Notebook (refer to the previous section), `README.md`, and `.yml` files are setup properly, it's time to deploy your work to the Portfolio!
135
149
136
150
### Build your Report
137
151
138
152
**Note:** The build command must be run from the root of the repo at `~/data-analyses`!
139
153
140
154
1. Navigate back to the `~/data-analyses` and install the portfolio requirements with
141
155
`pip install -r portfolio/requirements.txt`
142
-
2. Then run `python portfolio/portfolio.py build my_report` to build your report
156
+
2. Run `python portfolio/portfolio.py build my_report` to build your report
143
157
- **Note:** `my_report.yml` will be replaced by the name of your `.yml` file in [data-analyses/portfolio/sites](https://github.com/cal-itp/data-analyses/tree/main/portfolio/sites).
144
158
- Your build will be located in: `data-analyses/portfolio/my_report/_build/html/index.html`
145
159
3. Add the files using `git add` and commit your progress!
@@ -164,9 +178,11 @@ After your Jupyter Notebook, README.md, and `.yml` files are setup properly, it'
164
178
165
179
5. Your notebook should now be displayed in the [Cal-ITP Analytics Portfolio](https://analysis.calitp.org/)
166
180
181
+
- If your work isn't showing up on the Index page above, run `python portfolio/portfolio.py index --deploy --prod` to add it.
182
+
167
183
### Other Specifications
168
184
169
-
- You also have the option to specify: run `python portfolio/portfolio.py build --help` to see the following options:
185
+
- You also have the option to specify after the initial `python portfolio/portfolio.py build my_report [specification goes here]`: run `python portfolio/portfolio.py build --help` to see the following options:
0 commit comments