Skip to content

Commit ebf1f7a

Browse files
authored
Add a link to report an issue (#106)
* Add a link to report an issue * Config constants
1 parent 71516bc commit ebf1f7a

File tree

5 files changed

+111
-14
lines changed

5 files changed

+111
-14
lines changed

docusaurus.config.ts

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
import {themes as prismThemes} from 'prism-react-renderer';
22
import type {Config} from '@docusaurus/types';
33
import type * as Preset from '@docusaurus/preset-classic';
4+
import {
5+
DISCORD_URL,
6+
REDDIT_URL,
7+
TWITTER_URL,
8+
GITHUB_MAIN_REPO_URL,
9+
GITHUB_ISSUES_MAIN_URL,
10+
GITHUB_FEATURES_URL,
11+
VSCODE_MARKETPLACE_URL,
12+
OPEN_VSX_URL,
13+
CONTACT_EMAIL,
14+
CAREERS_URL,
15+
WEBSITE_PRIVACY_URL,
16+
EXTENSION_PRIVACY_URL,
17+
GITHUB_REPO_URL
18+
} from './src/constants';
419

520
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
621

@@ -38,7 +53,7 @@ const config: Config = {
3853
docs: {
3954
sidebarPath: './sidebars.ts',
4055
routeBasePath: '/',
41-
editUrl: 'https://github.com/RooVetGit/Roo-Code-Docs/edit/main/',
56+
editUrl: `${GITHUB_REPO_URL}/edit/main/`,
4257
showLastUpdateTime: true,
4358
},
4459
blog: false, // Disable blog feature
@@ -156,12 +171,12 @@ const config: Config = {
156171
},
157172
items: [
158173
{
159-
href: 'https://github.com/RooVetGit/Roo-Code',
174+
href: GITHUB_MAIN_REPO_URL,
160175
label: 'GitHub',
161176
position: 'right',
162177
},
163178
{
164-
href: 'https://marketplace.visualstudio.com/items?itemName=RooVeterinaryInc.roo-cline',
179+
href: VSCODE_MARKETPLACE_URL,
165180
label: 'Install Extension',
166181
position: 'right',
167182
},
@@ -175,15 +190,15 @@ const config: Config = {
175190
items: [
176191
{
177192
label: 'Discord',
178-
href: 'https://discord.gg/roocode',
193+
href: DISCORD_URL,
179194
},
180195
{
181196
label: 'Reddit',
182-
href: 'https://www.reddit.com/r/RooCode/',
197+
href: REDDIT_URL,
183198
},
184199
{
185200
label: 'Twitter',
186-
href: 'https://x.com/roo_code',
201+
href: TWITTER_URL,
187202
},
188203
],
189204
},
@@ -192,11 +207,11 @@ const config: Config = {
192207
items: [
193208
{
194209
label: 'Issues',
195-
href: 'https://github.com/RooVetGit/Roo-Code/issues',
210+
href: GITHUB_ISSUES_MAIN_URL,
196211
},
197212
{
198213
label: 'Feature Requests',
199-
href: 'https://github.com/RooVetGit/Roo-Code/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop',
214+
href: GITHUB_FEATURES_URL,
200215
},
201216
],
202217
},
@@ -205,11 +220,11 @@ const config: Config = {
205220
items: [
206221
{
207222
label: 'VS Code Marketplace',
208-
href: 'https://marketplace.visualstudio.com/items?itemName=RooVeterinaryInc.roo-cline',
223+
href: VSCODE_MARKETPLACE_URL,
209224
},
210225
{
211226
label: 'Open VSX Registry',
212-
href: 'https://open-vsx.org/extension/RooVeterinaryInc/roo-cline',
227+
href: OPEN_VSX_URL,
213228
},
214229
],
215230
},
@@ -218,20 +233,20 @@ const config: Config = {
218233
items: [
219234
{
220235
label: 'Contact',
221-
href: 'mailto:[email protected]',
236+
href: CONTACT_EMAIL,
222237
target: '_self',
223238
},
224239
{
225240
label: 'Careers',
226-
href: 'https://careers.roocode.com',
241+
href: CAREERS_URL,
227242
},
228243
{
229244
label: 'Website Privacy Policy',
230-
href: 'https://roocode.com/privacy',
245+
href: WEBSITE_PRIVACY_URL,
231246
},
232247
{
233248
label: 'Extension Privacy Policy',
234-
href: 'https://github.com/RooVetGit/Roo-Code/blob/main/PRIVACY.md',
249+
href: EXTENSION_PRIVACY_URL,
235250
},
236251
],
237252
},
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import {useLocation} from '@docusaurus/router';
3+
import {GITHUB_NEW_ISSUE_URL} from '@site/src/constants';
4+
import styles from './styles.module.css';
5+
6+
export default function ReportIssue() {
7+
const {pathname} = useLocation();
8+
9+
const issueUrl = `${GITHUB_NEW_ISSUE_URL}?title=Documentation%20Issue:%20${encodeURIComponent(pathname)}`;
10+
11+
return (
12+
<div className={styles.reportContainer}>
13+
<hr className={styles.separator} />
14+
<div className={styles.reportLink}>
15+
<span>Is this documentation incorrect or incomplete? </span>
16+
<a href={issueUrl} target="_blank" rel="noopener noreferrer">
17+
Report an issue on GitHub
18+
</a>
19+
</div>
20+
</div>
21+
);
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.reportContainer {
2+
margin-top: 3rem;
3+
margin-bottom: 1rem;
4+
}
5+
6+
.separator {
7+
margin-top: 2rem;
8+
margin-bottom: 1rem;
9+
border: 0;
10+
border-top: 1px solid var(--ifm-color-emphasis-300);
11+
}
12+
13+
.reportLink {
14+
font-size: 0.875rem;
15+
color: var(--ifm-color-emphasis-700);
16+
}
17+
18+
.reportLink a {
19+
font-weight: 500;
20+
}

src/constants.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Application-wide constants for use in TypeScript environments
3+
*/
4+
5+
// GitHub repository information
6+
export const GITHUB_REPO_URL = 'https://github.com/RooVetGit/Roo-Code-Docs';
7+
export const GITHUB_ISSUES_URL = `${GITHUB_REPO_URL}/issues`;
8+
export const GITHUB_NEW_ISSUE_URL = `${GITHUB_ISSUES_URL}/new`;
9+
10+
// Community links
11+
export const DISCORD_URL = 'https://discord.gg/roocode';
12+
export const REDDIT_URL = 'https://www.reddit.com/r/RooCode/';
13+
export const TWITTER_URL = 'https://x.com/roo_code';
14+
15+
// GitHub links
16+
export const GITHUB_MAIN_REPO_URL = 'https://github.com/RooVetGit/Roo-Code';
17+
export const GITHUB_ISSUES_MAIN_URL = `${GITHUB_MAIN_REPO_URL}/issues`;
18+
export const GITHUB_FEATURES_URL = `${GITHUB_MAIN_REPO_URL}/discussions/categories/feature-requests?discussions_q=is%3Aopen+category%3A%22Feature+Requests%22+sort%3Atop`;
19+
20+
// Download links
21+
export const VSCODE_MARKETPLACE_URL = 'https://marketplace.visualstudio.com/items?itemName=RooVeterinaryInc.roo-cline';
22+
export const OPEN_VSX_URL = 'https://open-vsx.org/extension/RooVeterinaryInc/roo-cline';
23+
24+
// Company links
25+
export const CONTACT_EMAIL = 'mailto:[email protected]';
26+
export const CAREERS_URL = 'https://careers.roocode.com';
27+
export const WEBSITE_PRIVACY_URL = 'https://roocode.com/privacy';
28+
export const EXTENSION_PRIVACY_URL = `${GITHUB_MAIN_REPO_URL}/blob/main/PRIVACY.md`;

src/theme/DocItem/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import DocItem from '@theme-original/DocItem';
3+
import ReportIssue from '@site/src/components/ReportIssue';
4+
5+
export default function DocItemWrapper(props) {
6+
return (
7+
<>
8+
<DocItem {...props} />
9+
<ReportIssue />
10+
</>
11+
);
12+
}

0 commit comments

Comments
 (0)