We appreciate your interest in improving NAHPU documentation. Several ways you can help:
- Update existing docs: Fix errors or add new information to current pages
- Create new content: Write new pages or sections on topics we haven't covered yet
- Translate docs: Help us reach more people by translating into other languages (coming soon)
Updating Existing Docs
Section titled “Updating Existing Docs”Team Members
Section titled “Team Members”At the bottom of each page on the website, you will find an Edit page link. Click on this link to open the page in GitHub. Here's the step to do it:
Check if you have been added as a collaborator.
Go to GitHub repository and navigate to Settings → Collaborators. If you do not see your username listed, reach out to a NAHPU team member to request access.
Click the
Edit pagelink at the bottom of the page.This will open the file directly in the GitHub web editor.
Start by making small changes.
If you are new to the project, begin with minor fixes such as typos, grammar corrections, or broken links before tackling larger edits.
Commit your changes.
GitHub will prompt you to write a commit message. Keep it concise, descriptive, and start with an active verb. Example of a good message:
Fix typos in the mammalian measurements.Select a commit option.
- Commit directly to the
releasebranch — preferred if you have collaborator access and the change is minor. - Create a new branch and open a pull request — use this if direct commit fails or if your change is significant and needs review.
- Commit directly to the
Check your changes.
After committing, navigate to the Actions tab in the GitHub repository to monitor the build. Wait for the workflow to complete. A green checkmark indicates a successful deployment. Once the build is done, visit the page where you made your changes on the live site to verify everything looks correct.
Make more changes.
Repeat steps 2–5 for any additional edits. For larger contributions involving multiple pages or new sections, consider cloning the repository locally for a more efficient workflow.
We use Markdoc format for our documentation. This format is similar to markdown but with additional features for documentation. It is designed to be easy for non-technical contributors to contribute while providing flexibility to style the writing.
Consider the following when making changes:
- Any text enclosed with
{% text %}is a Starlight component. It is sensitive to spaces. - You can use the component to style your writing. Learn more below.
- Any text enclosed with
Continue with step 4 and 5.
External Contributors
Section titled “External Contributors”If you are not a team member, you can still contribute to the project. Here's how:
Fork the documentation repository on GitHub, then clone it to your local machine.
Terminal window git clone https://github.com/nahpu/nahpu-docs.gitTerminal window gh repo clone nahpu/nahpu-docsNavigate into the project directory.
Terminal window cd nahpu-docsCreate a new branch for your changes.
Terminal window git checkout -b your-branch-nameMake your changes to the documentation.
Files are located in
src/content/docs/[language].Commit and push your changes.
Terminal window git add .git commit -m "Your commit message"git push origin your-branch-nameSubmit a pull request.
Go to the GitHub repository and open a pull request from your branch. A maintainer will review and merge your changes before the site is deployed.
Create New Content
Section titled “Create New Content”For create one or two pages, you can add a new file in the GitHub repository. The documentation files are inside src/content/docs/[language]. We need to add the English content first, then write translations for the other languages. We prefer the documentation in markdoc .mdoc format. However, you can start with plain Markdown and let the documentation maintainer do the rest.
For a more complex scenario with complex pages and rooting, see the Deep Dive section for more details.
Adding a New Language Translation
Section titled “Adding a New Language Translation”We're always looking for speakers of languages we don't currently support. To facilitate the addition of new languages, we use AI to assist with translations. If you're interested in contributing, please reach out to one of our team members. Our workflow for adding a new language involves:
- Creating a new language directory in the
src/content/docsfolder. The folder name follows the language code (e.g.,en,es,fr). - Using a large language model to translate the English documentation.
- Add the sidebar translations in the
astro.config.mjsfile. - Reviewing and revising the AI translation for accuracy by a team member.
Deep Dive
Section titled “Deep Dive”This section explains the advanced method to develop the NAHPU documentation.
Technologies
Section titled “Technologies”NAHPU documentation is built with the following technologies:
- Astro — Static site generator
- Starlight — Documentation theme for Astro
- Markdoc — Documentation format
- Tailwind CSS — Utility-first CSS framework
- Bun — JavaScript runtime and package manager
Why These Technologies?
Section titled “Why These Technologies?”Astro generates static HTML pages at build time, meaning the documentation site ships zero JavaScript by default. This results in fast page loads, low bandwidth usage, and a smaller carbon footprint. They are important values for the NAHPU project.
Starlight is Astro's official documentation theme. It provides out-of-the-box features essential for technical documentation, including full-text search, sidebar navigation, internationalization, and accessibility, without requiring us to build them from scratch.
Markdoc extends standard Markdown with a powerful, structured tag system. Unlike MDX, Markdoc keeps content and logic cleanly separated, making it easier for non-technical contributors to write and edit documentation without worrying about breaking component code. It also validates content at build time, catching errors early.
Tailwind CSS allows us to style custom pages and components using utility classes directly in markup, without writing separate CSS files. Its design token system ensures visual consistency across pages, and its built-in purging keeps the final stylesheet small.
Bun is a fast JavaScript runtime and package manager that replaces Node.js and npm in our development workflow. It is less finicky than Node.js and npm, and it installs dependencies significantly faster. It also runs build scripts with lower overhead, making local development and CI builds quicker for contributors.
Local Development
Section titled “Local Development”Prerequisites
Section titled “Prerequisites”Before setting up the documentation locally, make sure you have the following installed:
- Git
- Bun
- GitHub CLI (optional, but recommended)
- A code editor (e.g., VS Code)
Install Git.
Git comes pre-installed on macOS. Verify with:
Terminal window git --versionIf not installed, install it via Homebrew:
Terminal window brew install gitTerminal window # Debian/Ubuntusudo apt install git# Fedorasudo dnf install gitDownload and install Git from git-scm.com. During installation, keep the default options. Verify with:
Terminal window git --versionInstall GitHub CLI (optional, but recommended).
Terminal window brew install ghTerminal window # Debian/Ubuntusudo apt install gh# Fedorasudo dnf install ghTerminal window winget install --id GitHub.cliVerify the installation:
Terminal window gh --versionAuthenticate GitHub CLI with your GitHub account.
Terminal window gh auth loginFollow the prompts: select GitHub.com as the host, HTTPS as the protocol, and confirm when asked to authenticate via browser. Verify once complete:
Terminal window gh auth statusConfigure Git with your name and email.
Terminal window git config --global user.name "Your Name"git config --global user.email "your@email.com"Use the same email address associated with your GitHub account.
Install Bun.
Terminal window curl -fsSL https://bun.com/install | bashTerminal window powershell -c "irm bun.sh/install.ps1 | iex"Verify the installation:
Terminal window bun --versionClone the documentation repository.
Terminal window git clone https://github.com/nahpu/nahpu-docs.gitTerminal window gh repo clone nahpu/nahpu-docsNavigate into the repository.
Terminal window cd nahpu-docsTerminal window # PowerShell 7+cd nahpu-docs# Alternatively, use the full cmdletSet-Location nahpu-docsIf you are using VS Code, you can open it directly in the editor.
Terminal window code nahpu-docsInstall all dependencies.
Terminal window bun installMake your changes.
Documentation files are in
src/content/docs/[language]. Other pages are insrc/pages.
Directory structure
Section titled “Directory structure”Here's the directory structure and short description of each file/directory.
- astro.config.mjs Configuration for Astro site
- markdoc.config.mjs Configuration for Markdoc documentation
- package.json Project dependencies and scripts
- README.md Overview and instructions for the project
- tsconfig.json TypeScript configuration
Directorypublic/ Static assets served directly
- …
Directorysrc/ Main source code directory
- content.config.ts Content management configurationS
Directoryassets/ Media files like images
- …
Directorycomponents/ Reusable UI components
- …
Directorycontent/ Documentation files organized by language
- …
Directorylayouts/ Layout components for reusable page template
- …
Directorypages/ Main pages of the site
- …
Directorystyles/ Global CSS stylesheets
- …
For more details about the directory structure, follow Astro guidelines and Starlight documentation.
Code Conventions
Section titled “Code Conventions”Markdoc Documentation Files
Section titled “Markdoc Documentation Files”Most contributors will work on .mdoc files inside src/content/docs/[language]. Follow these conventions when editing or creating documentation pages:
Use Markdoc syntax for all documentation files. Prefer
.mdocover plain.mdto take full advantage of custom tags and components.Use built-in Starlight components for common UI patterns such as asides, steps, tabs, and file trees. See Writing with Starlight Components for examples.
Keep frontmatter minimal. Only include fields required by the schema, such as
titleandsidebar:---title: "Page Title"sidebar:order: 1---
Astro and General Pages
Section titled “Astro and General Pages”These conventions apply to .astro files in src/components/, src/layouts/, and src/pages/:
If the same code snippet appears in multiple places, use a shared component to avoid duplication. Place shared components in
src/components/using PascalCase filenames, e.g.,SharedComponent.astro.Use layouts for reusable UI templates. Follow the same PascalCase naming convention and place them in
src/layouts/.Avoid vanilla CSS for styling whenever possible. Use Tailwind CSS instead. We use Tailwind v4.
Avoid writing many classes inline on elements. Instead, use a
cntlconst variable to store classes. Seesrc/pages/index.astrofor an example.
Writing with Starlight Components
Section titled “Writing with Starlight Components”When writing documentation, keep the following in mind:
- Use Starlight components for repeated documentation patterns.
- Use the
codecomponent whenever you need to show Markdoc component syntax as text. - Keep examples short and easy to copy.
- Prefer examples that match the NAHPU documentation workflow.
Built-in Components
Section titled “Built-in Components”You can include a tip box in your documentation using the aside component:
{% aside type='tip' %}This is a tip!{% /aside %}It will render as:
For showing numbered steps, you can use the steps component:
{% steps %}1. Step one2. Step two{% /steps %}It will render as:
- Step one
- Step two
You can find the full list of Starlight components in the Starlight documentation.
Adding New Components
Section titled “Adding New Components”Create a new component in
src/components/. Use PascalCase for the filename, e.g.,MyComponent.astro.src/components/MyComponent.astro <div>Your component content here</div>Register it as a Markdoc tag in
markdoc.config.mjs.import { defineMarkdocConfig, component } from "@astrojs/markdoc/config";import starlightMarkdoc from "@astrojs/starlight-markdoc";export default defineMarkdocConfig({extends: [starlightMarkdoc()],tags: {mycomponent: {render: component("./src/components/MyComponent.astro"),selfClosing: true,},},});Use it in any
.mdocfile.{% mycomponent / %}
Running the website locally
Section titled “Running the website locally”Run astro in dev mode
Terminal window bun run devOpen your browser and navigate to
http://localhost:4321/to view the documentation website.