中文: README_zh.md
OpenLinker is a JetBrains IDE plugin that opens context-aware web or file links from customizable URL templates.
- Opens links from the top toolbar icon and
Tools > OpenLinker - Builds URLs from customizable rules with placeholders (for project, module, and file context)
- Supports project-specific URL overrides on each rule
- Lets you choose a global browser and override it for individual rules
- Handles both web links and
file://paths (revealed in your system file manager) - Lets you manage, persist, import, and export rules from
Settings > Tools > OpenLinker
This repository is currently set up as a source project. To try the plugin:
- Open the project in IntelliJ IDEA
- Run
./gradlew runIde - In the sandbox IDE, use OpenLinker directly
- Open
Settings > Tools > OpenLinker - Add, edit, import, or export rules
- Click
Tools > OpenLinker(or use the top toolbar icon)
Toolbar popup:
Settings page (rules):
- Export is available in the settings page toolbar; you can export all rules or only the selected rule
- Import is also in the settings page toolbar; imported rules are appended to the end of the current list
- Imported changes are like normal edits: click
ApplyorOKto persist them - Import/export files use JSON with this structure:
{
"version": 1,
"rules": [
{
"name": "GitHub(Example)",
"urlTemplate": "https://github.com/your_username/${PROJECT_NAME}",
"enabled": false,
"projectOverrides": [
{
"projectName": "OpenLinker",
"urlTemplate": "https://github.com/openlinker/${PROJECT_NAME}"
}
]
}
]
}When a rule has a matching projectOverrides entry for the current project name, OpenLinker uses that project URL template instead of the rule's default urlTemplate.
Browser selections are personal settings and are not included in import/export files.
PROJECT_NAME: current project nameMODULE_NAME: current module name; empty if unavailableFILE_NAME: current file name; empty if unavailableFILE_PATH: full path of the current file; empty if unavailable
- Java 17
- IntelliJ IDEA 2023.1 or later
- Open the project in IntelliJ IDEA.
- Make sure Gradle JVM is Java 17.
- Run the
runIdetask to start a sandbox IDE.
If you prefer the command line:
./gradlew runIdeThe project includes basic tests covering these core cases:
- Whether default rules exist
- Rule load results after persistence
- JSON format and validation for rule import/export
- Project-specific rule overrides
- URL template variable substitution
- Decision branches for 0 / 1 / multiple enabled rules
Run:
./gradlew test
