Docus Introduction
Docus Overview
Docus is a fully integrated documentation solution built with Nuxt Framework. Modules used on this site:
Installing Modules
Create your docs directory
Project will be named as my-docs
npx create-docus my-docs
We recommend using the npm package manager.
Install Modules
Nuxi is a CLI tool that helps you to manage your Nuxt project. npx nuxt@latest is an alias for npx nuxi@latest.
npx nuxi@latest module add supabase
npx nuxi info
npx nuxi cleanup
npx nuxi prepare
Start your docs server in development
cd my-docs
npm run dev
A local preview of your documentation will be available at http://localhost:3000
Write your documentation
Visit Docus Documentation to learn more about the details.
My Cloud Setup
Testing
Before pushing for deployment, run test locally. Playwright test is chosen for testing to host a browser and validate step-by-step. The tests are located in the tests/ directory. The test will detect CI at cloud and behave differently if run by cloud. We can test locally with these steps:
npm run build
npm run test
npx playwright show-report
Start AWS Amplify
Create an app and use this configuration.
nitro: {
preset: 'aws-amplify',
externals: {
external: ['secure-exec'],
},
},
Store Images on S3
Avoid pushing large media files to GitHub. Create a S3 bucket and run this command to push update.
aws s3 sync public/images s3://mynote-storage/public/images/
and override image render to use S3 address on production.
if (props.src.startsWith('/images/')) {
return `${S3_BASE}${props.src}`
}
Studio Module
Developing on Docus
CSS Structure
Docus use the engine Unocss to style the UI. It use TailwindCSS syntax. The MDC tags can be used on md files {width="80" class="w-20 mb-4"}. Custom CSS can be configured at app/assets/css/main.css
Custom Rendering
Add new functionality under app/ folder. Override existing components by adding components to app/components/content/<ProseName>.vue. Add new component app/components/content/CustomMdc.vue. Then render at markdown as:
::custom-mdc
content
::
Theming
Docus uses Pinceau for its design tokens using the file token.config.ts.