Skip to content

Commit bbfe51f

Browse files
amandaha8edasmalchi
authored andcommitted
added index page lang, more districts in dla.yml example
1 parent 6238d95 commit bbfe51f

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

docs/publishing/sections/5_analytics_portfolio_site.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ present in the data-analyses repo is your friend. You can find the Cal-ITP Analy
1010

1111
## Netlify Setup
1212

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:
1416

1517
- Install netlify: `npm install -g netlify-cli`
1618
- Navigate to your main directory
@@ -25,6 +27,10 @@ Netlify is the platform turns our Jupyter Notebooks uploaded to GitHub into a fu
2527
- For the changes to take effect, open a new terminal or run `source ~/.bash_profile`
2628
- Back in your terminal, enter `env | grep NETLIFY` to see that your Netlify token is there
2729

30+
To make sure your Netlify token is up to date:
31+
32+
- COMING SOON
33+
2834
## File Setup
2935

3036
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
3440

3541
### README.md
3642

37-
Create a `README.md` file in the repo where your work lies to 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.
3844

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.
4046
- If you do accidentally create a `README.md` file with extra strings, you can fix this by taking the following steps:
4147
- `git rm portfolio/my_analysis/README_accidentally_named_something_else.md`
4248
- `rm portfolio/my_analysis/_build/html/README_accidentally_named_something.html`. We use `rm` because \_build/html folder is not checked into GitHub
4349
- `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.
4450

4551
### YML
4652

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.
4854

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).
5056

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:
5458

5559
- Include the directory to the notebook(s) you want to publish.
60+
5661
- Name your `.yml` file. For now we will use `my_report.yml` as an example.
62+
5763
- The structure of your `.yml` file depends on the type of your analysis:
64+
5865
- If you have one parameterized notebook with **one parameter**:
5966

6067
- Example: [dla.yml](https://github.com/cal-itp/data-analyses/blob/main/portfolio/sites/dla.yml)
@@ -70,11 +77,18 @@ To create a `yml` file:
7077
- params:
7178
district_parameter: 1
7279
district_title: District 1
80+
- params:
81+
district_parameter: 2
82+
district_title: District 2
83+
and so on...
84+
- params:
85+
district_parameter: 12
86+
district_title: District 12
7387
```
7488
7589
- If you have a parameterized notebook with **multiple parameters**:
7690
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).
7892
7993
```
8094
title: My Analyses
@@ -131,15 +145,15 @@ To create a `yml` file:
131145
132146
## Building and Deploying your Report
133147
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!
135149
136150
### Build your Report
137151
138152
**Note:** The build command must be run from the root of the repo at `~/data-analyses`!
139153
140154
1. Navigate back to the `~/data-analyses` and install the portfolio requirements with
141155
`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
143157
- **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).
144158
- Your build will be located in: `data-analyses/portfolio/my_report/_build/html/index.html`
145159
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'
164178
165179
5. Your notebook should now be displayed in the [Cal-ITP Analytics Portfolio](https://analysis.calitp.org/)
166180
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+
167183
### Other Specifications
168184
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:
170186
- `--deploy / --no-deploy`
171187
- deploy this component to netlify.
172188
- `--prepare-only / --no-prepare-only`

0 commit comments

Comments
 (0)