We are always grateful to receive contribution!
The following guidelines help you on how to start with the codebase and how to submit your work.
You need to have npm
installed.
git clone [email protected]:grafana/plugin-tools.git
cd plugin-tools
npm install
Docusaurus
- the documentation website is built with docusaurus
/docusaurus
consists of the following folder structure:
docusaurus/
├── docs/ // the website documentation files
│ ├── get-started/
│ │ ├── _category_.json // category item metadata
│ │ ├── folder-structure.md // documentation file
│ │ └── get-started.mdx // documentation file using react components
│ ├── shared/ // special directory for sharing text
│ └── snippets/ // special directory for command snippets
└── website/ // website source code
├── plugins/ // location of docusaurus custom plugins
├── src/ // react / js source code for website
│ ├── components
│ ├── css
│ ├── pages
│ └── theme
├── static/ // folder for static assets
│ ├── font
│ └── img
├── docusaurus.config.js
└── package.json
For futher information on working with docusaurus please consult the official docs.
There are a collection of commands to assist with developing the website. Please read the main contributing guide before contributing any code or documentation changes to the project.
Below are the main commands used for developing the website. They can be run by either npx nx run website:<name_of_command>
, npm run <name_of_command> -w website
or navigating to docusaurus/website
and running the command directly as detailed below.
npm run start # starts a local development server to preview changes as files are edited.
npm run build # creates a production build of the website.
npm run serve # use this command to run the production build locally (requires the build command to be run first).
npm run clear # clears the docusaurus cache
During development branches can be manually deployed to the development website by doing the following:
- Navigate to this actions page.
- Click
Run workflow
dropdown found above the recent workflow runs table. - In the dropdown replace
Which branch to use?
with the name of the branch you'd like to deploy. - Click
Run workflow
button.
To deploy changes to production simply merge a PR to main and wait for the developer portal production workflow to run.
Please refer to the Grafana Writers' Toolkit.