Skip to content

Commit 5c6a019

Browse files
committed
Unsuccessful attempt
1 parent fb6bd3e commit 5c6a019

23 files changed

Lines changed: 177 additions & 54 deletions

.github/workflows/deploy-jb.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ jobs:
5454
run: |
5555
pip install -r requirements.txt
5656
57+
- name: Generate FAQ cards
58+
run: |
59+
cd website
60+
python generate_faq_cards.py
61+
5762
- name: Build HTML Assets
5863
run: |
5964
cd website

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ _build
33
.venv
44
.html
55
.DS_Store
6+
7+
# Generated files
8+
website/faq-include.md

README.md

Lines changed: 143 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,157 @@
11
# Developing this site
22

3-
- create a Python environment and install the dependencies:
3+
This site uses MyST (Markedly Structured Text) via Jupyter Book to build documentation with dynamic content.
4+
5+
## Setup
6+
7+
Create a Python environment and install the dependencies:
48

59
```bash
610
python -m venv .venv
7-
source .venv/bin/activate
11+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
812
pip install -r requirements.txt
913
```
1014

11-
- run the development server:
15+
## Building the Site
16+
17+
### Development Server
18+
19+
Run the live development server (auto-rebuilds on file changes):
1220

1321
```bash
1422
cd website
1523
jupyter book start
1624
```
1725

26+
The site will be available at `http://localhost:3000`.
27+
28+
### Build Static HTML
29+
30+
Build the complete site:
31+
32+
```bash
33+
cd website
34+
python generate_faq_cards.py # Generate FAQ cards
35+
jupyter book build
36+
```
37+
38+
Or using `myst` directly:
39+
40+
```bash
41+
cd website
42+
python generate_faq_cards.py # Generate FAQ cards
43+
myst build
44+
```
45+
46+
**Important:** Run `generate_faq_cards.py` before building to regenerate the FAQ card grid from the individual FAQ files in `faq/`.
47+
48+
### Quick Build (Development)
49+
50+
For faster builds during development (if you haven't changed FAQ content):
51+
52+
```bash
53+
cd website
54+
jupyter book build
55+
```
56+
57+
## Project Structure
58+
59+
```
60+
website/
61+
├── myst.yml # MyST configuration and table of contents
62+
├── *.md # Main content pages
63+
├── faq/ # Individual FAQ pages (auto-listed)
64+
│ └── *.md
65+
├── images/ # Static assets
66+
└── _build/ # Generated output (not committed)
67+
└── html/
68+
```
69+
70+
## Dynamic Content
71+
72+
The FAQ landing page (`faq.md`) uses a preprocessing script to:
73+
- Automatically scan all files in `faq/` directory
74+
- Parse frontmatter (title, tags) from each FAQ
75+
- Generate `faq-include.md` with a responsive card grid layout
76+
- Update automatically when FAQ files are added/removed
77+
78+
To add a new FAQ:
79+
1. Create a new `.md` file in `website/faq/`
80+
2. Add frontmatter with `title` and `tags`
81+
3. Add the file to `myst.yml` under `faq.md` children
82+
4. Run `python generate_faq_cards.py` to regenerate cards
83+
5. Rebuild the site
84+
85+
## Testing
86+
87+
### Manual Testing
88+
Generate FAQ cards:**
89+
```bash
90+
cd website
91+
python generate_faq_cards.py
92+
```
93+
94+
2. **Local build test:**
95+
```bash
96+
cd website
97+
jupyter book build
98+
```
99+
100+
3. **Check for errors:**
101+
- Look for build errors in the terminal output
102+
- Check `_build/html/` directory was created
103+
- Verify `faq-include.md` was generated and contains card markup
104+
105+
4. **Visual testing:**
106+
```bash
107+
cd website
108+
jupyter book start
109+
```
110+
Navigate to `/faq` and verify:
111+
- All FAQ cards appear
112+
- Cards are clickable and link to correct pages
113+
- Card layout is responsive
114+
115+
### Automated Testing (CI/CD)
116+
117+
The GitHub Actions workflow automatically:
118+
- Installs dependencies from `requirements.txt`
119+
- Run `python generate_faq_cards.py` from the `website/` directory
120+
- Check that `faq-include.md` was generated
121+
- Verify FAQ files are in `website/faq/` and listed in `myst.yml`
122+
123+
**Build errors:**
124+
- Check YAML syntax in FAQ file frontmatter
125+
- Ensure all required packages are in `requirements.txt`
126+
- Verify frontmatter YAML is valid in all `.md` files
127+
- Check that `faq-include.md` contains valid MyST card syntax
128+
129+
**Links broken:**
130+
- Use relative paths with `/` prefix: `/faq/page-name`
131+
- Match filenames exactly (case-sensitive)
132+
- Check TOC entries in `myst.yml`
133+
134+
## AI Assistant Instructions
135+
136+
When working with this codebase:
137+
- Run `python generate_faq_cards.py` before building if FAQ files changed
138+
- FAQ pages must be added to both `website/faq/` AND `myst.yml` TOC
139+
- Use the MyST instructions file at `.github/instructions/myst.instructions.md`
140+
- Test builds locally before committing
141+
- Verify the GitHub Actions workflow passes
142+
- The preprocessing script must be run before each build when FAQ content chang
143+
## AI Assistant Instructions
144+
145+
When working with this codebase:
146+
- Always build with `--execute` flag when FAQ or dynamic content changes
147+
- FAQ pages must be added to both `website/faq/` AND `myst.yml` TOC
148+
- Use the MyST instructions file at `.github/instructions/myst.instructions.md`
149+
- Test builds locally before committing
150+
- Verify the GitHub Actions workflow passes
151+
152+
## Additional Resources
153+
154+
- [MyST Documentation](https://mystmd.org/guide)
155+
- [Jupyter Book Documentation](https://jupyterbook.org/)
156+
- [MyST Instructions](.github/instructions/myst.instructions.md)
157+

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
jupyter-book==2.1.2
2+
pyyaml

website/faq.md

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,12 @@ tags:
77
- replication
88
---
99

10-
... although some are not frequently asked, but might nevertheless be useful. Below questions and answers in random order. Please be sure to check out the [official list of FAQ](https://www.aeaweb.org/journals/data/faq) first. Should you have other questions not appearing on either page, please [create a new issue on Github](https://github.com/AEADataEditor/aea-de-guidance/issues/new), ask the question on [BlueSky](https://bsky.app/profile/aeadata.bsky.social), or send an email to the [AEA Data Editor](mailto:dataeditor@aeapubs.org).
11-
12-
## Citing and DOI
13-
14-
- [What is the DOI of my openICPSR deposit?](/faq/doi-openicpsr-deposit)
15-
- [How do I cite my own data and code supplement?](/faq/cite-own-data-code)
16-
- [Many data sources and citation page limits](/faq/many-data-sources-citations)
17-
18-
## Licensing
19-
20-
- [Reusing published data and licensing](/faq/reuse-data-licensing)
21-
22-
## Deposit Related
10+
:::{aside}
11+
{index}
12+
:type: tags
13+
:::
2314

24-
- [Should we keep our directory structure?](/faq/keep-directory-structure)
25-
- [I cannot upload or edit my repository](/faq/modify-repository-locked)
26-
- [How to update a published repository](/faq/update-published-repository)
27-
- [Replication package has more than 1,000 files](/faq/more-than-1000-files)
28-
- [What is the __MACOSX folder?](/faq/macosx-folder)
29-
30-
## Confidential Data
31-
32-
- [Confidential data and metadata](/faq/confidential-data-metadata)
33-
- [Providing confidential data to Data Editor](/faq/confidential-data-provide)
34-
- [Removing PSID data from materials](/faq/psid-data-remove)
35-
36-
## Version Control, Software, etc.
37-
38-
- [Custom software - how to provide access](/faq/custom-software-access)
39-
- [Version control integration (GitHub, etc.)](/faq/version-control-integration)
40-
- [R or Stata packages (CRAN, SSC)](/faq/r-stata-packages)
41-
- [Docker / Jupyter support](/faq/docker-jupyter-support)
42-
43-
## RCT
15+
... although some are not frequently asked, but might nevertheless be useful. Below questions and answers in random order. Please be sure to check out the [official list of FAQ](https://www.aeaweb.org/journals/data/faq) first. Should you have other questions not appearing on either page, please [create a new issue on Github](https://github.com/AEADataEditor/aea-de-guidance/issues/new), ask the question on [BlueSky](https://bsky.app/profile/aeadata.bsky.social), or send an email to the [AEA Data Editor](mailto:dataeditor@aeapubs.org).
4416

45-
- [Aligning AEA RCT Registry and Data Repository](/faq/rct-registry-alignment)
17+
```{include} faq-include.md
18+
```

website/faq/cite-own-data-code.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: How do I cite my own data and code supplement?
3-
orphan: true
43
tags:
54
- citation
65
- data deposit

website/faq/confidential-data-metadata.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Confidential data and metadata
3-
orphan: true
43
tags:
54
- confidential data
65
- metadata

website/faq/confidential-data-provide.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Providing confidential data to Data Editor
3-
orphan: true
43
tags:
54
- confidential data
65
- restricted data

website/faq/custom-software-access.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Custom software - how to provide access
3-
orphan: true
43
tags:
54
- software
65
- custom code

website/faq/docker-jupyter-support.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Docker / Jupyter support
3-
orphan: true
43
tags:
54
- Docker
65
- Jupyter

0 commit comments

Comments
 (0)