This is the documentation website for the LogStruct gem, built with Next.js and shadcn/ui. It showcases the gem's features and provides comprehensive documentation for users.
- Interactive examples of LogStruct's JSON logging capabilities
- Comprehensive documentation of all gem features
- Mobile-responsive design with shadcn/ui components
- Dark mode support
- Node.js 22.18 or later in the 22.x series and pnpm 10.18.3 (CI uses Node.js 22)
- The repository's Ruby version, Bundler and Task, with
bundle installcompleted at the repository root
- Generate the log types, test coverage and API documentation from the repository root:
task generate
task test
task yard:generateThe homepage reads public/coverage/coverage.json, and the navigation links to public/yard/. These are generated artifacts, so a clean checkout needs them before serving or building the site.
- Install the docs dependencies from this directory:
pnpm install- Start the development server:
pnpm dev- Open http://localhost:3001 to view the docs in your browser.
To build the static docs for production:
pnpm buildThis will generate static HTML files in the out directory that can be deployed to any static web hosting service.
This site deploys to GitHub Pages through GitHub Actions after CI passes on main, using that CI run's coverage report.
To manually deploy:
- Build the docs:
pnpm build- The static files will be in the
outdirectory, which can be deployed to any static hosting service.
app/- The Next.js applicationapp/page.tsx- The homepageapp/docs/- Documentation pages
components/- Reusable React componentspublic/- Static assets (images, etc.)
To add or update documentation:
- Create or edit files in the
app/docsdirectory - Each page should be a React component that exports a default function
- For new sections, update the sidebar in
app/docs/layout.tsx - Keep Ruby examples in
test/code_examples/and display them withRubyCodeExample, so the Ruby suite checks them - Run
task cifrom the repository root andpnpm checkhere (types, lint, static build, integration tests and browser tests)