|
| 1 | +# Document Assembly Line Documentation |
| 2 | + |
| 3 | +The Document Assembly Line Documentation is a Docusaurus-based documentation website that combines automatic Python API documentation generation with manually authored guides for the Document Assembly Line project by Suffolk LIT Lab. |
| 4 | + |
| 5 | +Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. |
| 6 | + |
| 7 | +## Working Effectively |
| 8 | + |
| 9 | +Bootstrap, build, and test the repository: |
| 10 | +- Install Python dependencies: `pip install docspec_python==2.2.1 git+https://github.com/nonprofittechy/pydoc-markdown@escape-brackets` -- takes 20 seconds |
| 11 | +- Clone external documentation sources (required for full build): |
| 12 | + ```bash |
| 13 | + cd .. # go up one directory from repo root |
| 14 | + git clone https://github.com/SuffolkLITLab/docassemble-AssemblyLine.git |
| 15 | + git clone https://github.com/SuffolkLITLab/FormFyxer.git |
| 16 | + git clone https://github.com/SuffolkLITLab/docassemble-ALToolbox.git |
| 17 | + git clone https://github.com/SuffolkLITLab/docassemble-EFSPIntegration.git |
| 18 | + cd docassemble-AssemblyLine-documentation # return to repo root |
| 19 | + ``` |
| 20 | +- Generate Python API documentation: `pydoc-markdown` -- takes 2 seconds |
| 21 | +- Fix FormFyxer case sensitivity: `rm -rf docs/components/formfyxer` (if the directory exists) |
| 22 | +- Install Node.js dependencies: `PUPPETEER_SKIP_DOWNLOAD=true npm install` -- takes 20 seconds |
| 23 | +- Build the documentation: `npm run build` -- **WILL FAIL with PDF generation error** - this is expected behavior in CI environments. The HTML build succeeds and creates usable documentation in the `build/` directory. |
| 24 | + |
| 25 | +Run the documentation website: |
| 26 | +- ALWAYS run the bootstrapping steps first. |
| 27 | +- Development server: `npm run start` -- starts on http://localhost:3000, takes 30 seconds to be ready |
| 28 | +- Production server: `npm run serve` -- serves built files on http://localhost:3000 |
| 29 | + |
| 30 | +## Critical Build Information |
| 31 | + |
| 32 | +- **NEVER CANCEL** the `npm run build` command - it takes 60 seconds and may appear to hang during webpack compilation |
| 33 | +- **ALWAYS** use `PUPPETEER_SKIP_DOWNLOAD=true npm install` due to network restrictions preventing Chrome download |
| 34 | +- **PDF generation ALWAYS FAILS** in CI environments due to Puppeteer Chrome download restrictions - this is expected behavior |
| 35 | +- FormFyxer case sensitivity: pydoc-markdown creates duplicate `FormFyxer` and `formfyxer` directories, causing build warnings. If the build fails with case sensitivity errors, run: `rm -rf docs/components/formfyxer` |
| 36 | +- The build generates warnings about broken anchors - these are expected and do not prevent successful builds |
| 37 | +- Complete build workflow: `pydoc-markdown && rm -rf docs/components/formfyxer && npm run build` |
| 38 | + |
| 39 | +## Validation |
| 40 | + |
| 41 | +- ALWAYS manually validate any new code by starting the development server and navigating to affected pages |
| 42 | +- Test both development mode (`npm run start`) and production build (`npm run build && npm run serve`) |
| 43 | +- The site should load at http://localhost:3000 with a blue-themed homepage featuring "Open-source tools for court forms, guided interviews, and e-filing" |
| 44 | +- Navigation should work between homepage, Get started, and Documentation sections |
| 45 | +- Always run `npm run clear` before building if you encounter unexpected webpack errors |
| 46 | + |
| 47 | +## Common Tasks |
| 48 | + |
| 49 | +The following are outputs from frequently run commands. Reference them instead of viewing, searching, or running bash commands to save time. |
| 50 | + |
| 51 | +### Repository root structure |
| 52 | +``` |
| 53 | +. |
| 54 | +├── .git/ |
| 55 | +├── .github/ |
| 56 | +│ └── workflows/ |
| 57 | +│ ├── deploy.yml |
| 58 | +│ └── test-deploy.yml |
| 59 | +├── .gitignore |
| 60 | +├── README.md |
| 61 | +├── babel.config.js |
| 62 | +├── docs/ |
| 63 | +├── docusaurus.config.js |
| 64 | +├── package-lock.json |
| 65 | +├── package.json |
| 66 | +├── pydoc-markdown.yml |
| 67 | +├── sidebars.js |
| 68 | +├── src/ |
| 69 | +└── static/ |
| 70 | +``` |
| 71 | + |
| 72 | +### Key configuration files |
| 73 | +- `docusaurus.config.js`: Main Docusaurus configuration including plugins, themes, and site metadata |
| 74 | +- `pydoc-markdown.yml`: Configuration for extracting Python API documentation from external repositories |
| 75 | +- `sidebars.js`: Navigation structure for documentation sections |
| 76 | +- `package.json`: Node.js dependencies and scripts |
| 77 | + |
| 78 | +### Build process sequence |
| 79 | +1. Python dependencies installation (~20 seconds) |
| 80 | +2. External repositories cloning (~5 seconds) |
| 81 | +3. Python API documentation generation via pydoc-markdown (~2 seconds) |
| 82 | +4. Node.js dependencies installation (~20 seconds) |
| 83 | +5. Docusaurus build compilation (~60 seconds) |
| 84 | + |
| 85 | +### Known working commands |
| 86 | +- `npm run clear` -- clears build cache, takes 1 second |
| 87 | +- `npm run start` -- development server, ready in 30 seconds |
| 88 | +- `npm run build` -- production build, takes 60 seconds |
| 89 | +- `npm run serve` -- serves built files |
| 90 | +- `npm run swizzle` -- customize Docusaurus components |
| 91 | +- `npm run deploy` -- deploys to GitHub Pages (requires GIT_USER and USE_SSH) |
| 92 | + |
| 93 | +### Development workflow |
| 94 | +1. Make changes to markdown files in `docs/` directory |
| 95 | +2. Test with `npm run start` for live reload during development |
| 96 | +3. Build with `npm run build` to test production build |
| 97 | +4. Check for build warnings and broken links |
| 98 | +5. Test navigation and content rendering with `npm run serve` |
| 99 | + |
| 100 | +### External dependencies |
| 101 | +The site pulls API documentation from these repositories: |
| 102 | +- `docassemble-AssemblyLine`: Main Assembly Line framework |
| 103 | +- `FormFyxer`: PDF and DOCX manipulation tools |
| 104 | +- `docassemble-ALToolbox`: Additional utility functions |
| 105 | +- `docassemble-EFSPIntegration`: E-filing integration components |
| 106 | + |
| 107 | +### Troubleshooting |
| 108 | +- If npm install fails: use `PUPPETEER_SKIP_DOWNLOAD=true npm install` |
| 109 | +- If build fails with FormFyxer case errors: `rm -rf docs/components/formfyxer` |
| 110 | +- If webpack compilation appears stuck: wait at least 60 seconds before investigating |
| 111 | +- If development server fails to start: run `npm run clear` first |
| 112 | +- **PDF generation always fails in CI** due to Chrome/Puppeteer restrictions - this is normal and expected |
| 113 | +- For local PDF generation: ensure Chrome is installed and accessible to Puppeteer, or disable `autoBuildPdfs` in `docusaurus.config.js` |
| 114 | + |
| 115 | +### CI/CD Pipeline |
| 116 | +GitHub Actions automatically: |
| 117 | +1. Installs Python 3.11 and required packages |
| 118 | +2. Clones external documentation repositories |
| 119 | +3. Runs pydoc-markdown for API documentation |
| 120 | +4. Installs Node.js 20 and npm dependencies |
| 121 | +5. Builds the site with `npm run build` |
| 122 | +6. Deploys to GitHub Pages on main branch pushes |
| 123 | + |
| 124 | +Test deployment runs the same process for pull requests without the final deploy step. |
0 commit comments