update "how to contribute" doc and md indentation

This commit is contained in:
mauwii 2023-02-19 01:42:52 +01:00
parent 2aa5688d90
commit 2f25363d76
No known key found for this signature in database
GPG Key ID: D923DB04ADB3F5AB
3 changed files with 79 additions and 26 deletions

View File

@ -21,3 +21,9 @@ indent_size = 4
# flake8
[.flake8]
indent_size = 4
# Markdown MkDocs
[docs/**/*.md]
max_line_length = 80
indent_size = 4
indent_style = unset

View File

@ -2,7 +2,6 @@ embeddedLanguageFormatting: auto
endOfLine: lf
singleQuote: true
semi: true
tabWidth: 2
trailingComma: es5
useTabs: false
overrides:
@ -12,6 +11,9 @@ overrides:
printWidth: 80
parser: markdown
cursorOffset: -1
- files: docs/**/*.md
options:
tabWidth: 4
- files: 'invokeai/frontend/public/locales/*.json'
options:
tabWidth: 4

View File

@ -2,52 +2,62 @@
title: How to Contribute
---
## pre-requirements
There are different ways how you can contribute to
[InvokeAI](https://github.com/invoke-ai/InvokeAI), like Translations, opening
Issues for Bugs or ideas how to improve.
To follow the steps in this tutorial you will need the following:
## Pull Requests
- [git](https://git-scm.com/downloads)
- [GitHub](https://github.com) account
- A Code Editor (personally I use Visual Studio Code)
### pre-requirements
## Fork Repository
To follow the steps in this tutorial you will need:
- [GitHub](https://github.com) account
- [git](https://git-scm.com/downloads) source controll
- Text / Code Editor (personally I preffer
[Visual Studio Code](https://code.visualstudio.com/Download))
- Terminal:
- If you are on Linux/MacOS you can use bash or zsh
- for Windows Users the commands are written for PowerShell
### Fork Repository
The first step to be done if you want to contribute to InvokeAI, is to fork the
rpeository.
The easiest way to do so is by clicking
[here](https://github.com/invoke-ai/InvokeAI/fork). It is also possible by
opening [InvokeAI](https://github.com/invoke-ai/InvoekAI) and click on the
"Fork" Button in the top right.
Since you are already reading this doc, the easiest way to do so is by clicking
[here](https://github.com/invoke-ai/InvokeAI/fork). You could also open
[InvokeAI](https://github.com/invoke-ai/InvoekAI) and click on the "Fork" Button
in the top right.
## Clone your fork
### Clone your fork
After you forked the Repository, you should clone it to your dev machine:
=== "Linux/MacOS"
=== "Linux:fontawesome-brands-linux: / MacOS:simple-apple:"
```sh
``` sh
git clone https://github.com/<github username>/InvokeAI \
&& cd InvokeAI
```
=== "Windows"
=== "Windows:fontawesome-brands-windows:"
```powershell
``` powershell
git clone https://github.com/<github username>/InvokeAI `
&& cd InvokeAI
```
## Install in Editable Mode
### Install in Editable Mode
To install InvokeAI in editable mode, (as always) we recommend to create and
activate a venv first. Afterwards you can install the InvokeAI Package,
including dev and docs extras in editable mode, follwed by the installation of
the pre-commit hook:
=== "Linux/MacOS"
=== "Linux:fontawesome-brands-linux: / MacOS:simple-apple:"
```sh
``` sh
python -m venv .venv \
--prompt InvokeAI \
--upgrade-deps \
@ -59,9 +69,9 @@ the pre-commit hook:
&& pre-commit install
```
=== "Windows"
=== "Windows:fontawesome-brands-windows:"
```powershell
``` powershell
python -m venv .venv `
--prompt InvokeAI `
--upgrade-deps `
@ -73,22 +83,57 @@ the pre-commit hook:
&& pre-commit install
```
## Create a branch
### Create a branch
Make sure you are on main branch, from there create your feature branch:
=== "Linux/MacOS"
=== "Linux:fontawesome-brands-linux: / MacOS:simple-apple:"
```sh
``` sh
git checkout main \
&& git pull \
&& git checkout -B <branch name>
```
=== "Windows"
=== "Windows:fontawesome-brands-windows:"
```powershell
``` powershell
git checkout main `
&& git pull `
&& git checkout -B <branch name>
```
### Commit your changes
When you are done with adding / updating content, you need to commit those
changes to your repository before you can actually open an PR:
```{ .sh .annotate }
git add <files you have changed> # (1)!
git commit -m "A commit message which describes your change"
git push
```
1. Replace this with a space seperated list of the files you changed, like:
`README.md foo.sh bar.json baz`
### Create a Pull Request
After pushing your changes, you are ready to create a Pull Request. just head
over to your fork on [GitHub](https://github.com), which should already show you
a message that there have been recent changes on your feature branch and a green
button which you could use to create the PR.
The default target for your PRs would be the main branch of
[invoke-ai/InvokeAI](https://github.com/invoke-ai/InvokeAI)
Another way would be to create it in VS-Code or via the GitHub CLI (or even via
the GitHub CLI in a VS-Code Terminal Window 🤭):
```sh
gh pr create
```
The CLI will inform you if there are still unpushed commits on your branch. It
will also prompt you for things like the the Title and the Body (Description) if
you did not already pass them as arguments.