# Gitary Companion Browser Extension [English](README.md) | [中文](README.zh-CN.md) Open GitHub, Gitee, and GitCode repositories in Gitary (`gitary.app`) with one click in your browser. ## Features - Click the extension icon on a repository page (GitHub/Gitee/GitCode) to open it in Gitary. - Right-click on repository pages or links and select "Open in Gitary". - Supports **GitHub**, **Gitee**, and **GitCode** platforms. - Enjoy **Notion-like editing**, **AI-powered diagramming (Excalidraw & Draw.io)**, **Mind Map**, and **Global AI Assistant** capabilities in Gitary for enhanced note-taking, AI-generated diagrams, mind mapping, and intelligent assistance. ## Installation **[Install Gitary Companion from Chrome Web Store →](https://chromewebstore.google.com/detail/gitary-companion/halhhaelcfghngkpkikcnlcjbmlkgjed)** Simply click "Add to Chrome" to install the extension directly. ## Directory Structure - `manifest.json`: Chrome extension manifest (MV3). - `src/`: TypeScript source code - `config.ts`: Basic configuration (e.g., Gitary URL). - `repo-parser.ts`: Pure functions for repository URL parsing (supports GitHub, Gitee, GitCode). - `gitary.ts`: Constructs Gitary jump links based on repository information. - `background.ts`: Background Service Worker that registers click events and context menus. - `extension-dist/`: Build output (JS generated by `tsc` and `manifest.json` copied). ## Local Development and Build ```bash cd browser-extension/gitary-companion pnpm install # or npm install / yarn pnpm run build # Build to extension-dist/ only pnpm run pack # Build and generate gitary-companion.zip in current directory ``` After building, the following files will be generated in the `extension-dist/` directory: - `background.js` - `manifest.json` ## Load in Chrome 1. Open `chrome://extensions/`. 2. Enable "Developer mode" in the top right. 3. Click "Load unpacked". 4. Select the `browser-extension/gitary-companion/extension-dist` directory. ## One-Click Package for Upload (Recommended) Execute from the project root: ```bash pnpm run ext:gitary:pack ``` This will: - Build the extension to `browser-extension/gitary-companion/extension-dist` - Generate `gitary-companion.zip` in `browser-extension/gitary-companion/` Upload this `gitary-companion.zip` to Chrome Web Store. ## Chrome Web Store Listing Suggestions - Extension Name: - Gitary Companion - Short Description (max 132 characters): - Open GitHub/Gitee/GitCode repos in Gitary: Notion-like editing + Professional diagramming (Excalidraw & Draw.io) + Mind Map for code & notes. - Detailed Description (multi-paragraph): > Gitary Companion lets you quickly open GitHub, Gitee, and GitCode repositories in Gitary for a more professional code reading and knowledge management experience. > > Key Features: > - One-click jump: Click the extension icon on a repository page (GitHub/Gitee/GitCode) to open it in Gitary. > - Right-click open: Right-click on repository pages or links and select "Open in Gitary". > - Multi-platform support: Supports GitHub, Gitee, and GitCode platforms. > - Notion-like editing: Enjoy powerful WYSIWYG Markdown editing with live preview, slash commands, and rich formatting. > - Professional diagramming: Create beautiful diagrams, flowcharts, UML diagrams, and sketches with Excalidraw & Draw.io directly in your Git repositories. > - Mind Map: Create and edit mind maps with node editing, drag-and-drop layout, and auto-save. > - Auto repository detection: Intelligently parses repository URLs, only works on supported pages. > > Permission Explanation: > - tabs / activeTab: Used to read the current tab URL to construct the jump link to Gitary. > - contextMenus: Used to provide the right-click "Open in Gitary" menu on pages and links. > > Privacy & Data: > - This extension does not collect or store any personal data or code content. > - All operations are performed locally, only constructing jump links based on the current page/link URL. ## Icon Files The following icon paths are reserved in `manifest.json` (please place PNG files): - `icons/icon16.png` - `icons/icon32.png` - `icons/icon48.png` - `icons/icon128.png` It is recommended to use different sizes of the same icon with transparent backgrounds for better display in the toolbar and store page. ## Adjust Gitary URL The extension currently defaults to: ```ts // src/config.ts export const DEFAULT_APP_BASE_URL = "https://gitary.app"; ``` The extension supports multiple domains, current configuration includes: - `https://gitary.app` (default) - `https://write.dimstack.com` If you are developing Gitary locally, you can modify `DEFAULT_APP_BASE_URL` to: ```ts export const DEFAULT_APP_BASE_URL = "http://localhost:5173"; ``` After modification, rebuild: ```bash pnpm run build ``` Then click "Reload" in the Chrome extensions page.