mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
rename docs/help/contributing
`
- update vs-code.md - update 30_DOCS.md
This commit is contained in:
parent
774230f7b9
commit
f5aadbc200
@ -10,34 +10,111 @@ higher priorized than your user settings.
|
|||||||
This helps to have different settings for different projects, while the user
|
This helps to have different settings for different projects, while the user
|
||||||
settings get used as a default value if no workspace settings are provided.
|
settings get used as a default value if no workspace settings are provided.
|
||||||
|
|
||||||
## launch.json
|
## tasks.json
|
||||||
|
|
||||||
It is asumed that you have created a virtual environment as `.venv`:
|
First we will create a task configuration which will create a virtual
|
||||||
|
environment and update the deps (pip, setuptools and wheel).
|
||||||
|
|
||||||
```sh
|
Into this venv we will then install the pyproject.toml in editable mode with
|
||||||
python -m venv .venv --prompt="InvokeAI" --upgrade-deps
|
dev, docs and test dependencies.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Create virtual environment",
|
||||||
|
"detail": "Create .venv and upgrade pip, setuptools and wheel",
|
||||||
|
"command": "python3",
|
||||||
|
"args": [
|
||||||
|
"-m",
|
||||||
|
"venv",
|
||||||
|
".venv",
|
||||||
|
"--prompt",
|
||||||
|
"InvokeAI",
|
||||||
|
"--upgrade-deps"
|
||||||
|
],
|
||||||
|
"runOptions": {
|
||||||
|
"instanceLimit": 1,
|
||||||
|
"reevaluateOnRerun": true
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"kind": "build"
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"echo": true,
|
||||||
|
"reveal": "always",
|
||||||
|
"focus": false,
|
||||||
|
"panel": "shared",
|
||||||
|
"showReuseMessage": true,
|
||||||
|
"clear": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "build InvokeAI",
|
||||||
|
"detail": "Build pyproject.toml with extras dev, docs and test",
|
||||||
|
"command": "${workspaceFolder}/.venv/bin/python",
|
||||||
|
"args": ["-m", "pip", "install", "-e", ".[dev,docs,test]"],
|
||||||
|
"dependsOn": "Create venv",
|
||||||
|
"dependsOrder": "sequence",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"echo": true,
|
||||||
|
"reveal": "always",
|
||||||
|
"focus": false,
|
||||||
|
"panel": "shared",
|
||||||
|
"showReuseMessage": true,
|
||||||
|
"clear": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This is the most simplified version of launching `invokeai --web` with the
|
## launch.json
|
||||||
debugger attached:
|
|
||||||
|
This file is used to define debugger configurations, so that you can one-click
|
||||||
|
launch and monitor the application, set halt points to inspect specific states,
|
||||||
|
...
|
||||||
|
|
||||||
```json title=".vscode/launch.json"
|
```json title=".vscode/launch.json"
|
||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "invokeai --web",
|
"name": "invokeai web",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": ".venv/bin/invokeai",
|
"program": ".venv/bin/invokeai",
|
||||||
"args": ["--web"],
|
"justMyCode": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "invokeai cli",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": ".venv/bin/invokeai",
|
||||||
|
"justMyCode": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mkdocs serve",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": ".venv/bin/mkdocs",
|
||||||
|
"args": ["serve"],
|
||||||
"justMyCode": true
|
"justMyCode": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you only need to hit ++F5++ and the fun begins :nerd:
|
Then you only need to hit ++f5++ and the fun begins :nerd: (It is asumed that
|
||||||
|
you have created a virtual environment via the [tasks](#tasksjson) from the
|
||||||
|
previous step.)
|
||||||
|
|
||||||
## extensions.json
|
## extensions.json
|
||||||
|
|
||||||
@ -70,21 +147,29 @@ A list of recommended vscode-extensions to make your life easier:
|
|||||||
|
|
||||||
## settings.json
|
## settings.json
|
||||||
|
|
||||||
With those settings your files already get formated when you save them, which
|
With bellow settings your files already get formated when you save them (only
|
||||||
will help you to not run into trouble with the pre-commit hooks, which will
|
your modifications if available), which will help you to not run into trouble
|
||||||
prevent you from commiting if the formaters are failing
|
with the pre-commit hooks. If the hooks fail, they will prevent you from
|
||||||
|
commiting, but most hooks directly add a fixed version, so that you just need to
|
||||||
|
stage and commit them:
|
||||||
|
|
||||||
```json title=".vscode/settings.json"
|
```json title=".vscode/settings.json"
|
||||||
{
|
{
|
||||||
"[json]": {
|
"[json]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.quickSuggestions": {
|
"editor.quickSuggestions": {
|
||||||
"strings": true
|
"comments": false,
|
||||||
|
"strings": true,
|
||||||
|
"other": true
|
||||||
},
|
},
|
||||||
"editor.suggest.insertMode": "replace",
|
"editor.suggest.insertMode": "replace",
|
||||||
"files.insertFinalNewline": true,
|
|
||||||
"gitlens.codeLens.scopes": ["document"]
|
"gitlens.codeLens.scopes": ["document"]
|
||||||
},
|
},
|
||||||
|
"[jsonc]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnSaveMode": "modificationsIfAvailable"
|
||||||
|
},
|
||||||
"[python]": {
|
"[python]": {
|
||||||
"editor.defaultFormatter": "ms-python.black-formatter",
|
"editor.defaultFormatter": "ms-python.black-formatter",
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
@ -96,7 +181,7 @@ prevent you from commiting if the formaters are failing
|
|||||||
"editor.formatOnSaveMode": "modificationsIfAvailable"
|
"editor.formatOnSaveMode": "modificationsIfAvailable"
|
||||||
},
|
},
|
||||||
"[yaml]": {
|
"[yaml]": {
|
||||||
"editor.defaultFormatter": "redhat.vscode-yaml",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.formatOnSaveMode": "modificationsIfAvailable"
|
"editor.formatOnSaveMode": "modificationsIfAvailable"
|
||||||
},
|
},
|
||||||
@ -111,10 +196,17 @@ prevent you from commiting if the formaters are failing
|
|||||||
"comments": "off",
|
"comments": "off",
|
||||||
"strings": "off",
|
"strings": "off",
|
||||||
"other": "off"
|
"other": "off"
|
||||||
}
|
},
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnSaveMode": "modificationsIfAvailable"
|
||||||
|
},
|
||||||
|
"[shellscript]": {
|
||||||
|
"editor.defaultFormatter": "foxundermoon.shell-format"
|
||||||
|
},
|
||||||
|
"[ignore]": {
|
||||||
|
"editor.defaultFormatter": "foxundermoon.shell-format"
|
||||||
},
|
},
|
||||||
"editor.rulers": [88],
|
"editor.rulers": [88],
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
||||||
"evenBetterToml.formatter.alignEntries": false,
|
"evenBetterToml.formatter.alignEntries": false,
|
||||||
"evenBetterToml.formatter.allowedBlankLines": 1,
|
"evenBetterToml.formatter.allowedBlankLines": 1,
|
||||||
"evenBetterToml.formatter.arrayAutoExpand": true,
|
"evenBetterToml.formatter.arrayAutoExpand": true,
|
||||||
@ -143,7 +235,7 @@ prevent you from commiting if the formaters are failing
|
|||||||
"--cov-report=term:skip-covered"
|
"--cov-report=term:skip-covered"
|
||||||
],
|
],
|
||||||
"yaml.schemas": {
|
"yaml.schemas": {
|
||||||
"https://json.schemastore.org/prettierrc.json": "${workspaceFolder}/.prettierrc"
|
"https://json.schemastore.org/prettierrc.json": "${workspaceFolder}/.prettierrc.yaml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -22,3 +22,11 @@ browser, without the needs of restarting the `mkdocs serve`.
|
|||||||
|
|
||||||
More information about the "mkdocs flavored markdown syntax" can be found
|
More information about the "mkdocs flavored markdown syntax" can be found
|
||||||
[here](https://squidfunk.github.io/mkdocs-material/reference/).
|
[here](https://squidfunk.github.io/mkdocs-material/reference/).
|
||||||
|
|
||||||
|
## :material-microsoft-visual-studio-code:VS-Code
|
||||||
|
|
||||||
|
We also provide a
|
||||||
|
[launch configuration for VS-Code](../IDE-Settings/vs-code.md#launchjson) which
|
||||||
|
includes a `mkdocs serve` entrypoint as well. You also don't have to worry about
|
||||||
|
the formatting since this is automated via prettier, but this is of course not
|
||||||
|
limited to VS-Code.
|
Loading…
x
Reference in New Issue
Block a user