Skip to content

Introduction & Quickstart Page Styling #457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: added quickstart page (#438)
  • Loading branch information
Prasad Bhat authored and Prasad Bhat committed Jul 16, 2025
commit 2991900608d20b30a467038fa8f792383dbf15ca
97 changes: 51 additions & 46 deletions docs/getting-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ description: See CodeRabbit in action, using a live GitHub repository.
sidebar_position: 1
---

import ListItems from "../../src/components/ListItems"
import InfoBox from "../../src/components/InfoBox"
import Note from "../../src/components/Note"
import CodeBlock from "@theme/CodeBlock"
import ChatBubble from "../../src/components/ChatBubble"
import DarkCodeBlock from "../../src/components/DarkCodeBlock"
import InfoBox from "../../src/components/InfoBox"
import ListItems from "../../src/components/ListItems"
import Note from "../../src/components/Note"

# Quickstart

Expand Down Expand Up @@ -70,14 +71,21 @@ CodeRabbit takes a moment to set up the integration. After it finishes, the Code

To add CodeRabbit to your test repository, follow these steps:

1. On the CodeRabbit dashboard, click **Add Repositories**. A GitHub repository-access dialog appears.
1. Select the **Only select repositories** radio button.
1. From the **Select repositories** menu, select the `coderabbit-test` repository that you created earlier in this Quickstart.
1. Click **Install & Authorize**.
:::note
CodeRabbit requests read and write access to your repository in order for its code review, issue management, and pull request generation features to work. CodeRabbit never stores your code. For more information, see [the CodeRabbit Trust Center](https://trust.coderabbit.ai).
:::
1. If a CodeRabbit **Complete your signup** dialog appears, then fill it out with the requested information before continuing.
<ListItems
orderedList
items={[
<>On the CodeRabbit dashboard, click <strong>Add Repositories</strong>.</>,
<>Select the <strong>Only select repositories</strong> radio button.</>,
<>From the <strong>Select repositories</strong> menu, select the <code>coderabbit-test</code> repository that you created earlier in this Quickstart.</>,
<>
Click <strong>Install & Authorize</strong>.
<Note>
CodeRabbit requests read and write access to your repository in order for its code review, issue management, and pull request generation features to work. CodeRabbit never stores your code. For more information, see <a href="https://trust.coderabbit.ai">the CodeRabbit Trust Center</a>.
</Note>
</>,
<>If a CodeRabbit <strong>Complete your signup</strong> dialog appears, then fill it out with the requested information before continuing.</>,
]}
/>

CodeRabbit is now ready to use with your test repository. The next steps demonstrate its core code-review features.

Expand All @@ -93,19 +101,18 @@ Use your usual Git workflow to perform the following steps in the `coderabbit-te
"Create a branch named `add-utils`.",
<>
In that new <code>add-utils</code> branch, create a new file called <code>simple_utils.py</code>, with the following content:
<CodeBlock language="python">{`
# simple_utils.py - A tiny utility library
<DarkCodeBlock language="python">{`# simple_utils.py - A tiny utility library

def reverse_string(text):
"""Reverses the characters in a string."""
return text[::-1]
"""Reverses the characters in a string."""
return text[::-1]

def count_words(sentence):
return len(sentence.split())
return len(sentence.split())

def celsius_to_fahrenheit(celsius):
return (celsius \* 9/5) + 32
`}</CodeBlock>
return (celsius * 9/5) + 32
`}</DarkCodeBlock>
</>,
"Commit the added file to the `add-utils`branch. Use any text you want for the commit message.",
"Create a pull request that proposes to merge the`add-utils`branch into the`main` branch. Use any text you want for the pull request message.",
Expand All @@ -116,12 +123,10 @@ After a few moments, CodeRabbit responds to the pull request using the `@coderab

<ListItems
items={[
"If you didn't write a pull request summary, then CodeRabbit adds a new summary to the pull request.",
"CodeRabbit posts a comment titled **Walkthrough** containing analysis and commentary about the content of the pull request.",
"CodeRabbit attaches a detailed code review to the pull request as another comment.",

]}

<>If you didn't write a pull request summary, then CodeRabbit adds a new summary to the pull request.</>,
<>CodeRabbit posts a comment titled <strong>Walkthrough</strong> containing analysis and commentary about the content of the pull request.</>,
<>CodeRabbit attaches a detailed code review to the pull request as another comment.</>,
]}
/>

Part of the review resembles the following screenshot:
Expand All @@ -136,33 +141,31 @@ After CodeRabbit reviews a pull request, you can converse with it about its revi

1. Post the following as a new GitHub comment attached to the pull request:

```text
@coderabbitai Why do all of these functions need docstrings? Isn't it obvious enough what they do?
```
<ChatBubble>@coderabbitai Why do all of these functions need docstrings? Isn't it obvious enough what they do?</ChatBubble>

After a few moments, CodeRabbit posts its reply, explaining its motivations for its recommendation. The reply might resemble the following:
After a few moments, CodeRabbit posts its reply, explaining its motivations for its recommendation. The reply might resemble the following:

<ChatBubble>
{`> You're right that these functions are quite self-explanatory from their names alone. Docstrings aren't strictly necessary for every function, especially in smaller projects with clear function names.
>
> While docstrings do provide benefits (IDE tooltips, documentation generation, help for future developers), they can sometimes feel redundant for very straightforward functions. It's ultimately a matter of coding style and project requirements.
>
> If you prefer to skip docstrings for obvious utility functions in this project, that's perfectly reasonable. Would you like me to adjust my review approach regarding documentation for this repository?`}
{`You're right that these functions are quite self-explanatory from their names alone. Docstrings aren't strictly necessary for every function, especially in smaller projects with clear function names.

While docstrings do provide benefits (IDE tooltips, documentation generation, help for future developers), they can sometimes feel redundant for very straightforward functions. It's ultimately a matter of coding style and project requirements.

If you prefer to skip docstrings for obvious utility functions in this project, that's perfectly reasonable. Would you like me to adjust my review approach regarding documentation for this repository?`}
</ChatBubble>

In this case, CodeRabbit is offering to adjust its future behavior when reviewing changes to this repository. Instead, follow the next step to ask CodeRabbit to implement part of its suggestions.

1. Post the following as another new comment:
2. Post the following as another new comment:

```text
@coderabbitai generate docstrings
```
<ChatBubble>@coderabbitai generate docstrings</ChatBubble>

After a few moments, CodeRabbit does the following:
After a few moments, CodeRabbit does the following:

- CodeRabbit creates a new branch, based on `add-utils`.
- CodeRabbit commits changes to the branch that adds suggested docstrings to `add-utils`.
- CodeRabbit opens a new pull request between the new branch and `add-utils`.
<ListItems items={[
<>CodeRabbit creates a new branch, based on `add-utils`.</>,
<>CodeRabbit commits changes to the branch that adds suggested docstrings to `add-utils`.</>,
<>CodeRabbit opens a new pull request between the new branch and `add-utils`.</>,
]} />

## Clean up

Expand All @@ -172,8 +175,10 @@ You are now ready to add CodeRabbit to other repositories that you own, and let

## What's next

- [Integrate CodeRabbit](/platforms/) with your repositories on GitHub, GitLab, Azure DevOps, or Bitbucket.
- [Configure CodeRabbit](/getting-started/configure-coderabbit) beyond its default settings.
- [Add custom review instructions](/guides/review-instructions).
- [Get support for CodeRabbit](/getting-started/support).
- [Learn more about how CodeRabbit works](/overview/why-coderabbit).
<ListItems items={[
<><a href="/platforms/">Integrate CodeRabbit</a> with your repositories on GitHub, GitLab, Azure DevOps, or Bitbucket.</>,
<><a href="/getting-started/configure-coderabbit">Configure CodeRabbit</a> beyond its default settings.</>,
<><a href="/guides/review-instructions">Add custom review instructions</a>.</>,
<><a href="/getting-started/support">Get support for CodeRabbit</a>.</>,
<><a href="/overview/why-coderabbit">Learn more about how CodeRabbit works</a>.</>,
]} />
131 changes: 131 additions & 0 deletions src/components/DarkCodeBlock/DarkCodeBlock.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
.codeBlock {
margin: 1rem 0;
border-radius: 8px;
overflow: hidden;
background-color: #1a1a1a;
border: none;
font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
position: relative;
}

.codeHeader {
background-color: #1a1a1a;
padding: 0.75rem 1rem;
border-bottom: 1px solid #333;
color: #888;
font-size: 0.875rem;
font-weight: 400;
font-style: italic;
}

.codeTitle {
color: #888;
font-style: italic;
}

.codeContainer {
position: relative;
background-color: #1a1a1a;
}

.codeContent {
margin: 0;
padding: 1rem;
padding-bottom: 2rem;
background-color: transparent;
color: #e6e6e6;
font-size: 0.875rem;
line-height: 1.6;
overflow-x: auto;
white-space: pre;
}

.codeLine {
display: block;
min-height: 1.6rem;
}

.copyButtonContainer {
background-color: #1a1a1a;
padding: 0.75rem 1rem;
display: flex;
justify-content: flex-end;
cursor: pointer;
}

.copyButton {
background-color: #333;
color: #fff;
border: 1px solid #333;
border-radius: 4px;
padding: 0.5rem 0.75rem;
font-size: 0.75rem;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
transition: all 0.2s ease;
font-family: inherit;
width: 100%;
justify-content: flex-end;
}

.copyButton:hover {
background-color: #333;
color: #fff;
border-color: #666;
}

.copyButton:active {
transform: scale(0.98);
}

.copyButton svg {
width: 14px;
height: 14px;
}

.codeContent :global(.keyword) {
color: #4fc1ff;
font-weight: 400;
}

.codeContent :global(.comment) {
color: #6a9955;
font-style: italic;
}

.codeContent :global(.string) {
color: #ff6b9d;
}

.codeContent :global(.function) {
color: #ffab70;
font-weight: 400;
}

.codeContent :global(.number) {
color: #53FFE8;
}

.codeContent :global(.header) {
color: #e6e6e6;
font-style: italic;
}

@media (max-width: 768px) {
.codeContent {
font-size: 0.8rem;
padding: 0.75rem;
padding-bottom: 3rem;
}

.copyButton {
font-size: 0.7rem;
padding: 0.4rem 0.6rem;
}

.copyButtonContainer {
padding: 0.5rem 0.75rem;
}
}
Loading