This directory contains the scripts and configuration used to generate the human-readable documentation site from the machine-readable FRMR JSON source files.
This content is only relevant to the FedRAMP team.
Install dependencies using Bun:
bun installInstall zensical using pip:
pip install zensicalThe package.json includes several scripts to assist with development and building the site:
Starts a development watcher using nodemon. It watches for changes in:
../FRMR*.json(The source data)templates/zensical-template.hbs(The markdown template)site/content/**/*(Manual content)
When a change is detected, it automatically re-runs the markdown generation script (scripts/build-markdown.ts).
Performs a full production build of the documentation site. The steps include:
- Clean: Removes previously generated markdown files.
- Generate: Runs
scripts/build-markdown.tsto create markdown from JSON. - Build Site: Runs
zensical build --cleaninside thesitedirectory. - Post-process: Runs
python postprocess.pyfor any final adjustments.
Removes all generated markdown files located in site/static/markdown/.
The documentation site is structured to separate manual content from generated content:
site/content: This directory contains permanent, manually written content. These files are maintained directly by contributors.site/static: This directory contains static assets. During the build process, generated markdown files are placed intosite/static/markdown.
The core of the documentation generation lies in the transformation of the FRMR JSON data into readable Markdown files.
This TypeScript script is responsible for reading the FRMR.documentation.json (and other matching JSON files) from the project root. It parses the JSON structure and maps the data to the Handlebars template.
This is the Handlebars template used by the build script. It defines the layout and formatting of the generated Markdown files. The script iterates through the JSON data, applying this template to create consistent, formatted documentation pages for the static site generator.
To do basic development stuff, such as make changes to the prepared content or mess with the main JSON, markdown formatting, etc., you'll basically want to have the following active.
Terminal 1:
Open a shell session in docs/tools and:
bun run watch
Terminal 2:
Open a shell session in docs/tools/site and:
zensical serve
Browser 1:
Go to https://localhost:8000 and watch the magic happen as you make changes.
To integrate with the fedramp.gov site you will need to build the latest and copy it over to that repo for now. Build steps include:
cd tools
bun run build
# check out the fedramp.gov repo, sync develop, create new branch
cd static/docs
/bin/rm -rf *
cp -pr ~/github/docs/tools/site/static/html/* ./
# commit, push, PR into develop, wait for develop to be deployed
Then copy everything from docs/tools/static/html/ to fedramp.gov/static/docs/ in the fedramp.gov repo and PR as normal.