- This repository contains the source code for the Firebolt documentation (https://docs.firebolt.io/).
- Pages are in MDX format.
- Pages are hosted on Mintlify platform. It offers AI tooling, internal search and AI bot.
- Main branch is
gh-pages
. It is automatically published to https://docs.firebolt.io/. - Main discussion channel is #documentation.
- Important: To improve the search and AI bot, set great keywords and description as it influences search and AI bot functionality.
- Add a new page.
- Run local checks using
make check-all
. - Preview the documentation locally using
make start-local
. - Preview the documentation remotely on Mintlify.
- Release changes.
- Make AI work for you.
- How to use AI tools to edit documentation
- Guides for tooling
- Guides for editing
- Repository structure
- GitHub PR Workflow
- About MDX format and Mintlify platform
@Devin is an autonomous AI agent that can handle simple tasks such as documentation changes.
- Tag @devin in the App section of Slack or in a channel where it's added and give it a task.
- Ask @devin for changes and improvements in PR comments or in the Slack thread.
OpenAI Codex is an autonomous AI agent that can handle simple tasks such as documentation changes.
- Go to https://chatgpt.com/codex
- Pick the "firebolt-analytics/firebolt-docs-staging" environment.
- Describe the task.
- When the task is ready, click it.
- Choose the best variant and create a PR.
- Use the chat box in OpenAI Codex interface (the link to the task can be found in the PR description) to ask it for changes and improvements.
- Run
make start-local
. - Open http://localhost:3000/ in your browser to preview the documentation.
- Open a pull request in the repository.
- Wait for the CI/CD pipeline to run.
- Go to the preview by the link found in the build. The preview links are formed the following way:
https://firebolt-[your-branch-name-with-dashes].mintlify.app/
(e.g.my_feature/new-page
has preview athttps://firebolt-my_feature-new-page.mintlify.app/
).
Use make check-all
or just make
to run all checks.
make check-markers
scans all files for Git merge conflict markers (<<<<<<<
, =======
, >>>>>>>
).
make check-navigation-regenerate
checks the navigation structure and adds all new pages known_pages.json.
It runs the following subchecks:
make check-group-structure
checks that the pages in docs-mdx/docs.json are organized into consistent groups and directory structure mirrors the navigational structure.make check-lost-pages
checks that all MDX files are referenced in docs-mdx/docs.json unless they are explicitly listed in hidden_pages.json.make check-redirect-loops
checks that there are no circular redirects in the documentation.make check-lost-redirects-regenerate
checks that all known URLs (listed in known_pages.json) either have a corresponding page in docs-mdx/ or a proper redirect in docs-mdx/docs.json. It also updates known_pages.json with new URLs.
make check-links
verifies that no links in the documentation result in 404.
It runs the following subchecks:
make check-internal-links
runs Mintlify's built-in broken link checker and validate internal links in the documentation.make check-links-using-crawler
to bring up a local site instance usingmint dev
and run muffet link crawler against it.
This checks that all <QueryWindow/>
components in the documentation have pre-generated results that match the live Firebolt staging API results. See here on how to add a new interactive SQL example.
make check-sql
to check that all<QueryWindow/>
components when run against live Firebolt staging API produce expected results.make package-docs
to regenerate all results for all<QueryWindow/>
components in the documentation.make package-missing-docs
to generate results for all<QueryWindow/>
components that don't have pre-generated results.
- Before you start
- Read the MDX and Mintlify guide below.
- See example at function-template.mdx or here.
- Create the MDX file in the appropriate directory under docs-mdx/. Place images in docs-mdx/assets/images. No whitespace or upper case is allowed in the path.
- Choose keywords and write great description to help Mintlify's search and AI bot to find the page.
- Add the file to the navigation structure in docs-mdx/docs.json. The navigation structure must reflect the directory structure.
- Run the checks (
make check-all
ormake
) to ensure everything is correct and automatically update the known_pages.json file with the new URL. - Preview the page locally using
make start-local
. - Push the changes to the repository and open the PR. See here for how to release the changes.
- Preview the results remotely (see how here).
NB: mint rename
does a terrible job, do not use it.
- Move the MDX file to the new location in docs-mdx/. No whitespace or upper case is allowed in the path.
- Update all cross-references to the page in other MDX files.
- Update the navigation structure in docs-mdx/docs.json with the new location. The navigation structure must reflect the directory structure.
- Run
make check-links
andmake check-links-using-crawler
to find missed links. - Add a redirect from the old URL to the new URL in docs-mdx/docs.json.
- Run the checks (
make check-all
ormake
) to ensure everything is correct and automatically update the known_pages.json file with the new URL. - Preview the page locally using
make start-local
. - Further steps as similar to adding a new page.
The interactive examples run against a dedicated Firebolt documentation server. See an example here and its sources here and here.
- Add
import {QueryWindow} from '/snippets/query-window.mdx';
at the top of the page if its not yet there. Don't add it more than once. - Add
<QueryWindow content={{"sql": "..(your SQL here)..", "result": ..(your result here)..}} />
where you want an interactive example on the page. For example:import {QueryWindow} from '/snippets/query-window.mdx'; <QueryWindow content={{ "sql": "SELECT ABS(-200.50) AS result;", "result": { "data": [[200.5]], "meta": [{"name": "result", "type": "double"}], "query": { ... }, "rows": 1, "statistics": { ... } } }} />
- You can leave the
result
part empty and generate it usingmake package-missing-docs
. - Preview the page locally using
make start-local
to ensure the example works as expected. - Further steps as similar to adding a new page.
- Open a pull request with the changes:
- Use
gh-pages
branch if the changes should be published right away. - Use
release/packdb-X.YZ
branch (e.g.release/packdb-4.24
) if the changes should be released with the next PackDB release.
- Use
- Wait for the CI/CD pipleline to run and the Mintlify preview deployment to complete.
- The PR will appear in the #documentation-prs. Ask the owner team to review it.
- Merge the PR when it's approved. The changes will be automatically published either to https://docs.firebolt.io (for
gh-pages
branch) or to https://firebolt-release-packdb-X-YZ.mintlify.app (forrelease/packdb-X.YZ
branch).
- docs-mdx/ contains all the MDX files for the documentation:
- docs-mdx/docs.json defines the navigation structure of the documentation.
- docs-mdx/assets/ contains static assets like images, styles and scripts used in the documentation. All styles and scripts are embedded in the MDX files by mintlify. See here. Note: there's no control over their order on the page.
- docs-mdx/snippets/ contains reusable snippets and components.
- scripts/ contains checking scripts and utilities:
- scripts/check_group_structure.py checks that the pages in docs-mdx/docs.json are organized into consistent groups and directory structure mirrors the navigational structure.
- scripts/check_lost_pages.py checks that all MDX files are referenced in docs-mdx/docs.json unless they are listed in hidden_pages.json.
- scripts/check_redirect_loops.py checks that there are no circular redirects in the documentation.
- scripts/check_lost_redirects.py checks that all known URLs (listed in known_pages.json) either have a corresponding page in docs-mdx/ or a proper redirect in docs-mdx/docs.json.
- scripts/check_sql_examples.py checks that pre-generated results in
<QueryWindow/>
components are the same as the real results. - scripts/check_merge_conflict_markers.sh checks that there are no Git merge conflict markers in the documentation files.
- hidden_pages.json contains all pages that are intentionally not included in the navigation. This is to prevent accidental hiding of pages by forgeting to add them to docs-mdx/docs.json.
- known_pages.json contains all URLs that have ever existed in the documentation. This is used to check for lost redirects.
- function-template.mdx is an example page.
- images/ contains images used in README.md.
The .github/workflows/pr-check.yml workflow runs four parallel jobs on every pull request:
- check-basic-errors: Merge conflict markers, legacy directory checks, navigation validation
- check-broken-links: Internal link validation using Mintlify
- check-links-using-crawler: External link validation (informational, doesn't block merge)
- check-sql-examples: SQL example validation (informational, doesn't block merge)
- Mintlify: This job runs the Mintlify deployment workflow to build and deploy the documentation to a remote preview.
- MDX is JSX-based, meaning:
- All pages, custom tags and HTML tags are React components. Some HTML tags are not supported.
- HTML tags need to be closed and lowercase (
<p></p>
instead of<p>
,<br/>
instead of<BR>
). - Tag attributes are camel case (
className
instead ofclass
,frameBorder
instead offrame-border
etc). style
HTML attributes are JSON objects and need to be wrapped in{}
, e.g.<span style={{"color": "red"}}></span>
.
{: ... }
and{% ... %}
expressions are not supported. Use components or HTML tags instead.
- The navigation structure is defined in docs-mdx/docs.json and not in the MDX files themselves.
- Pages can be hidden by not including them in docs-mdx/docs.json and adding
noindex: true
to the frontmatter.make check-lost-pages
build check requires that all pages are either included in docs-mdx/docs.json or listed in hidden_pages.json.
- There's section ToC in the left sidebar and page ToC in the right sidebar. Avoid adding ToC manually.
- Reusable snippets and components are defined in
docs-mdx/snippets/
and can be imported into MDX files. - All styles and scripts found within docs-mdx/ are embedded into all pages, resulting in page bloat. Do not add script and style files unless absolutely necessary. See here. There's no control over the order in which they end up on the page.
For AI Mintlify platform generates .md files and hosts MCP server.
- Mintlify platform documentation:
- MDX format documentation
- JSX format documentation (it's under the hood of MDX)