diff --git a/docs/contributing.mdx b/docs/contributing.mdx index 0acd951301..b4dbe1bdcc 100644 --- a/docs/contributing.mdx +++ b/docs/contributing.mdx @@ -3,111 +3,97 @@ sidebar_position: 1600 title: "🤝 Contributing" --- +# 🤝 Contributing -🚀 **Welcome, Contributors!** 🚀 +**Help build the AI interface everyone deserves.** -Your interest in contributing to Open WebUI is greatly appreciated. This document is here to guide you through the process, ensuring your contributions enhance the project effectively. Let's make Open WebUI even better, together! +Open WebUI is an independent project built and maintained by a small, dedicated core team. Whether you test dev builds, fix bugs, improve docs, or translate the UI, every contribution makes the project better for thousands of users. This page explains how to get involved and what to expect. -## 📜 Code of Conduct +--- + +## Code of Conduct -All contributors and community participants are expected to follow our **[Code of Conduct](https://github.com/open-webui/open-webui/blob/main/CODE_OF_CONDUCT.md)**. We operate under a **zero-tolerance policy** — disrespectful, demanding, or hostile behavior will result in immediate action without prior warning. +All contributors and community participants must follow the **[Code of Conduct](https://github.com/open-webui/open-webui/blob/main/CODE_OF_CONDUCT.md)**. We operate under a **zero-tolerance policy**: disrespectful, demanding, or hostile behavior results in immediate action without prior warning. -Our community is built on the work of volunteers who dedicate their free time to this project. Please treat every interaction with professionalism and respect. +This project is built by volunteers in their free time. Treat every interaction with professionalism and respect. -## 💡 Contributing +--- -Looking to contribute? Great! Here's how you can help: +## Ways to Contribute -### 🧪 Test the Development Branch +### Test the development branch -**One of the most valuable ways to contribute is running the dev branch.** You don't need to write code—just use it and report issues! +One of the most valuable contributions requires no code at all. Run the dev branch, use it daily, and report what breaks. ```bash docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:dev ``` -**Keep it updated regularly** — the dev branch moves fast! If Docker doesn't work for you, the [Local Development Guide](/getting-started/development) is another great option. - -By testing dev builds, you help us catch bugs before stable releases. Report issues on [GitHub](https://github.com/open-webui/open-webui/issues) with clear reproduction steps. **We cannot deliver high-quality releases without community testing.** - -### 🌟 Code Contribution Guidelines +The dev branch moves fast, so **pull updates regularly**. If Docker is not your preference, follow the [Local Development Guide](/getting-started/advanced-topics/development) instead. -We welcome pull requests. Before submitting one, please: +Report issues on [GitHub](https://github.com/open-webui/open-webui/issues) with clear reproduction steps. We cannot deliver high-quality releases without community testing. -1. Open a discussion regarding your ideas [here](https://github.com/open-webui/open-webui/discussions/new/choose). -2. Follow the project's coding standards and include tests for new features. -3. Update documentation as necessary. -4. Write clear, descriptive commit messages. +### Submit code -### 🛠 Code PR Best Practices: +We welcome pull requests. Before submitting one: -1. **Atomic PRs:** Make sure your PRs are small, focused, and deal with a single objective or task. This helps in easier code review and limits the chances of introducing unrelated issues. If the scope of changes grows too large, consider breaking them into smaller, logically independent PRs. -2. **Follow Existing Code Convention:** Ensure your code aligns with the existing coding standards and practices of the project. -3. **Avoid Additional External Dependencies:** Do not include additional external dependencies without prior discussion. -4. **Framework Agnostic Approach:** We aim to stay framework agnostic. Implement functionalities on our own whenever possible rather than relying on external frameworks or libraries. If you have doubts or suggestions regarding this approach, feel free to discuss it. +1. **Open a discussion first.** Propose your idea [here](https://github.com/open-webui/open-webui/discussions/new/choose) so the team can align on approach before you write code. +2. **Follow existing conventions.** Match the project's coding standards, naming patterns, and architecture. +3. **Keep PRs atomic.** Each pull request should address a single objective. If scope grows, split it into smaller, logically independent PRs. +4. **Avoid new external dependencies.** Do not add libraries or frameworks without prior discussion. We aim to stay framework-agnostic and implement functionality ourselves when practical. +5. **Include tests.** Cover new features with tests and update documentation as needed. +6. **Write clear commit messages.** Descriptive messages make review and history tracking easier. -Thank you for contributing! 🚀 +### Improve documentation -### 📚 Documentation & Tutorials +Help make Open WebUI more accessible by improving docs, writing tutorials, or creating setup guides. Documentation lives in the [docs repository](https://github.com/open-webui/docs). -Help us make Open WebUI more accessible by improving documentation, writing tutorials, or creating guides on setting up and optimizing the web UI. +### Translate the UI -### 🌐 Translations and Internationalization - -Help us make Open WebUI available to a wider audience. In this section, we'll guide you through the process of adding new translations to the project. - -We use JSON files to store translations. You can find the existing translation files in the `src/lib/i18n/locales` directory. Each directory corresponds to a specific language, for example, `en-US` for English (US), `fr-FR` for French (France) and so on. You can refer to [ISO 639 Language Codes](http://www.lingoes.net/en/translator/langcode.htm) to find the appropriate code for a specific language. +Open WebUI uses JSON translation files in `src/lib/i18n/locales`. Each subdirectory is named with an [ISO 639 language code](http://www.lingoes.net/en/translator/langcode.htm) (e.g., `en-US`, `fr-FR`). To add a new language: -- Create a new directory in the `src/lib/i18n/locales` path with the appropriate language code as its name. For instance, if you're adding translations for Spanish (Spain), create a new directory named `es-ES`. -- Copy the American English translation file(s) (from `en-US` directory in `src/lib/i18n/locale`) to this new directory and update the string values in JSON format according to your language. Make sure to preserve the structure of the JSON object. -- Add the language code and its respective title to languages file at `src/lib/i18n/locales/languages.json`. - -### 🌎 Accessibility Matters - -We are committed to making **Open WebUI** inclusive and usable for everyone. Accessibility is a core part of good system design. - -Here’s how you can help improve accessibility when you contribute: +1. Create a new directory under `src/lib/i18n/locales` named with the appropriate language code +2. Copy the `en-US` translation files into the new directory +3. Translate the string values in each JSON file while preserving the object structure +4. Register the language in `src/lib/i18n/locales/languages.json` -- **Semantic HTML**: Use semantic HTML elements (` + ); +} + +export default function CodeBlock({ + children: rawChildren, + ...props +}: Props): React.JSX.Element { + const isBrowser = useIsBrowser(); + + // Plain-string children → stock Prism/StringContent path + if (typeof rawChildren === "string") { + return ( + + {rawChildren} + + ); + } + + // Element children (Shiki output) + const code = extractText(rawChildren); + + return ( +
+
+
+					{rawChildren}
+				
+ {isBrowser && } +
+
+ ); +}