diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 441c946fd..70f5a5ba2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -154,6 +154,10 @@ The project's documentation is built using Jekyll and hosted on GitHub Pages. To ``` bundle exec jekyll build ``` +5. Preview the website while editing (optional): + ``` + bundle exec jekyll serve + ``` The built documentation will be available in the `aider/website/_site` directory. diff --git a/aider/args.py b/aider/args.py index 9be32e44a..a5b36e6dc 100644 --- a/aider/args.py +++ b/aider/args.py @@ -375,13 +375,13 @@ def get_parser(default_config_files, git_root): group.add_argument( "--completion-menu-color", metavar="COLOR", - default="default", + default=None, help="Set the color for the completion menu (default: terminal's default text color)", ) group.add_argument( "--completion-menu-bg-color", metavar="COLOR", - default="default", + default=None, help=( "Set the background color for the completion menu (default: terminal's default" " background color)" @@ -390,7 +390,7 @@ def get_parser(default_config_files, git_root): group.add_argument( "--completion-menu-current-color", metavar="COLOR", - default="default", + default=None, help=( "Set the color for the current item in the completion menu (default: terminal's default" " background color)" @@ -399,7 +399,7 @@ def get_parser(default_config_files, git_root): group.add_argument( "--completion-menu-current-bg-color", metavar="COLOR", - default="default", + default=None, help=( "Set the background color for the current item in the completion menu (default:" " terminal's default text color)" diff --git a/aider/commands.py b/aider/commands.py index e827fea24..c3745a406 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -771,7 +771,7 @@ class Commands: self.io.tool_output(f"Removed {matched_file} from the chat") def cmd_git(self, args): - "Run a git command" + "Run a git command (output excluded from chat)" combined_output = None try: args = "git " + args @@ -1076,7 +1076,7 @@ class Commands: return text def cmd_paste(self, args): - """Paste image/text from the clipboard into the chat. + """Paste image/text from the clipboard into the chat.\ Optionally provide a name for the image.""" try: # Check for image first diff --git a/aider/io.py b/aider/io.py index debfe6088..10b4a5e68 100644 --- a/aider/io.py +++ b/aider/io.py @@ -188,10 +188,10 @@ class InputOutput: tool_error_color="red", tool_warning_color="#FFA500", assistant_output_color="blue", - completion_menu_color="default", - completion_menu_bg_color="default", - completion_menu_current_color="default", - completion_menu_current_bg_color="default", + completion_menu_color=None, + completion_menu_bg_color=None, + completion_menu_current_color=None, + completion_menu_current_bg_color=None, code_theme="default", encoding="utf-8", dry_run=False, @@ -258,6 +258,41 @@ class InputOutput: else: self.console = Console(force_terminal=False, no_color=True) # non-pretty + def _get_style(self): + style_dict = {} + if not self.pretty: + return Style.from_dict(style_dict) + + if self.user_input_color: + style_dict.setdefault("", self.user_input_color) + style_dict.update( + { + "pygments.literal.string": f"bold italic {self.user_input_color}", + } + ) + + # Conditionally add 'completion-menu' style + completion_menu_style = [] + if self.completion_menu_bg_color: + completion_menu_style.append(f"bg:{self.completion_menu_bg_color}") + if self.completion_menu_color: + completion_menu_style.append(self.completion_menu_color) + if completion_menu_style: + style_dict["completion-menu"] = " ".join(completion_menu_style) + + # Conditionally add 'completion-menu.completion.current' style + completion_menu_current_style = [] + if self.completion_menu_current_bg_color: + completion_menu_current_style.append(f"bg:{self.completion_menu_current_bg_color}") + if self.completion_menu_current_color: + completion_menu_current_style.append(self.completion_menu_current_color) + if completion_menu_current_style: + style_dict["completion-menu.completion.current"] = " ".join( + completion_menu_current_style + ) + + return Style.from_dict(style_dict) + def read_image(self, filename): try: with open(str(filename), "rb") as image_file: @@ -335,22 +370,7 @@ class InputOutput: inp = "" multiline_input = False - if self.user_input_color and self.pretty: - style = Style.from_dict( - { - "": self.user_input_color, - "pygments.literal.string": f"bold italic {self.user_input_color}", - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" - ), - } - ) - else: - style = None + style = self._get_style() completer_instance = ThreadedCompleter( AutoCompleter( @@ -490,19 +510,7 @@ class InputOutput: else: self.tool_output(subject, bold=True) - if self.pretty and self.user_input_color: - style = { - "": self.user_input_color, - "completion-menu": ( - f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}" - ), - "completion-menu.completion.current": ( - f"bg:{self.completion_menu_current_bg_color} " - f"{self.completion_menu_current_color}" - ), - } - else: - style = dict() + style = self._get_style() def is_valid_response(text): if not text: @@ -521,7 +529,7 @@ class InputOutput: if self.prompt_session: res = self.prompt_session.prompt( question, - style=Style.from_dict(style), + style=style, ) else: res = input(question) @@ -565,10 +573,7 @@ class InputOutput: self.tool_output() self.tool_output(subject, bold=True) - if self.pretty and self.user_input_color: - style = Style.from_dict({"": self.user_input_color}) - else: - style = None + style = self._get_style() if self.yes is True: res = "yes" diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index 0f3d173bf..e4b47404a 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -177,16 +177,16 @@ #assistant-output-color: #0088ff ## Set the color for the completion menu (default: terminal's default text color) -#completion-menu-color: default +#completion-menu-color: xxx ## Set the background color for the completion menu (default: terminal's default background color) -#completion-menu-bg-color: default +#completion-menu-bg-color: xxx ## Set the color for the current item in the completion menu (default: terminal's default background color) -#completion-menu-current-color: default +#completion-menu-current-color: xxx ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#completion-menu-current-bg-color: default +#completion-menu-current-bg-color: xxx ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #code-theme: default diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index 12447e181..ba588eb7f 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -181,16 +181,16 @@ #AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff ## Set the color for the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_COLOR=default +#AIDER_COMPLETION_MENU_COLOR= ## Set the background color for the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_BG_COLOR=default +#AIDER_COMPLETION_MENU_BG_COLOR= ## Set the color for the current item in the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_CURRENT_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_COLOR= ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR= ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #AIDER_CODE_THEME=default diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index b11a4249a..bf828ad17 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -225,16 +225,16 @@ cog.outl("```") #assistant-output-color: #0088ff ## Set the color for the completion menu (default: terminal's default text color) -#completion-menu-color: default +#completion-menu-color: xxx ## Set the background color for the completion menu (default: terminal's default background color) -#completion-menu-bg-color: default +#completion-menu-bg-color: xxx ## Set the color for the current item in the completion menu (default: terminal's default background color) -#completion-menu-current-color: default +#completion-menu-current-color: xxx ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#completion-menu-current-bg-color: default +#completion-menu-current-bg-color: xxx ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #code-theme: default diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index 6f55ced83..f654c3b77 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -223,16 +223,16 @@ cog.outl("```") #AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff ## Set the color for the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_COLOR=default +#AIDER_COMPLETION_MENU_COLOR= ## Set the background color for the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_BG_COLOR=default +#AIDER_COMPLETION_MENU_BG_COLOR= ## Set the color for the current item in the completion menu (default: terminal's default background color) -#AIDER_COMPLETION_MENU_CURRENT_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_COLOR= ## Set the background color for the current item in the completion menu (default: terminal's default text color) -#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=default +#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR= ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #AIDER_CODE_THEME=default diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index bef493a3d..b22caef25 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -338,22 +338,18 @@ Environment variable: `AIDER_ASSISTANT_OUTPUT_COLOR` ### `--completion-menu-color COLOR` Set the color for the completion menu (default: terminal's default text color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_COLOR` ### `--completion-menu-bg-color COLOR` Set the background color for the completion menu (default: terminal's default background color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_BG_COLOR` ### `--completion-menu-current-color COLOR` Set the color for the current item in the completion menu (default: terminal's default background color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_CURRENT_COLOR` ### `--completion-menu-current-bg-color COLOR` Set the background color for the current item in the completion menu (default: terminal's default text color) -Default: default Environment variable: `AIDER_COMPLETION_MENU_CURRENT_BG_COLOR` ### `--code-theme VALUE` diff --git a/aider/website/docs/faq.md b/aider/website/docs/faq.md index 4cd95de74..c120d2ddd 100644 --- a/aider/website/docs/faq.md +++ b/aider/website/docs/faq.md @@ -124,6 +124,9 @@ When starting a fresh aider session, you can include recent git history in the c Remember, the chat history already includes recent changes made during the current session, so this tip is most useful when starting a new aider session and you want to provide context about recent work. +{: .tip } +The `/git` command will not work for this purpose, as its output is not included in the chat. + ## How can I run aider locally from source code? To run the project locally, follow these steps: @@ -194,12 +197,18 @@ Yes, you can now share aider chat logs in a pretty way. 1. Copy the markdown logs you want to share from `.aider.chat.history.md` and make a github gist. Or publish the raw markdown logs on the web any way you'd like. -https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0 + ``` + https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0 + ``` 2. Take the gist URL and append it to: -https://aider.chat/share/?mdurl= + ``` + https://aider.chat/share/?mdurl= + ``` This will give you a URL like this, which shows the chat history like you'd see in a terminal: +``` https://aider.chat/share/?mdurl=https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0 +``` diff --git a/aider/website/docs/usage/commands.md b/aider/website/docs/usage/commands.md index cbdfc4f7c..4700d77f0 100644 --- a/aider/website/docs/usage/commands.md +++ b/aider/website/docs/usage/commands.md @@ -25,7 +25,7 @@ cog.out(get_help_md()) | **/diff** | Display the diff of changes since the last message | | **/drop** | Remove files from the chat session to free up context space | | **/exit** | Exit the application | -| **/git** | Run a git command | +| **/git** | Run a git command (output excluded from chat) | | **/help** | Ask questions about aider | | **/lint** | Lint and fix in-chat files or all dirty files if none in chat | | **/ls** | List all known files and indicate which are included in the chat session | @@ -33,8 +33,7 @@ cog.out(get_help_md()) | **/map-refresh** | Force a refresh of the repository map | | **/model** | Switch to a new LLM | | **/models** | Search the list of available models | -| **/paste** | Paste image/text from the clipboard into the chat. - Optionally provide a name for the image. | +| **/paste** | Paste image/text from the clipboard into the chat. Optionally provide a name for the image. | | **/quit** | Exit the application | | **/read-only** | Add files to the chat that are for reference, not to be edited | | **/report** | Report a problem by opening a GitHub Issue |