https://github.com/onukura/gitbucket-embedding-plugin
GitBucket plugin to replace code link to snippet
https://github.com/onukura/gitbucket-embedding-plugin
gitbucket gitbucket-plugin
Last synced: 4 months ago
JSON representation
GitBucket plugin to replace code link to snippet
- Host: GitHub
- URL: https://github.com/onukura/gitbucket-embedding-plugin
- Owner: onukura
- License: apache-2.0
- Created: 2020-08-17T15:41:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-22T15:06:51.000Z (about 4 years ago)
- Last Synced: 2025-04-21T17:42:07.224Z (8 months ago)
- Topics: gitbucket, gitbucket-plugin
- Language: JavaScript
- Homepage:
- Size: 162 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitbucket-embedding-plugin
A GitBucket plugin to replace code link to embed snippet.
To achieve embed snippet, this plugin is not best way. It should be done by GitBucket itself. Until the day GitBucket get this feature, this plugin could be a one of choices.
## Screenshot

## Install
1. Download *.jar from Releases.
2. Deploy it to `GITBUCKET_HOME/plugins`.
3. Restart GitBucket.
## Build from source
```sbt
sbt clean package
```
The built package is located at
`target/scala-2.13/gitbucket-embedding-plugin_2.13-{plugin-version}.jar`.
```sbt
sbt assembly
```
This makes the assembly package
`target/scala-2.13/gitbucket-embedding-plugin-{plugin-version}.jar`
for deployment.
## Supported link type
```
Link Style 1:
http(s)://{host_with_or_without_prefix}/{owner}/{repository}/blob/{SHA}/{path/to/file}#L{StartLineNumber}-L{EndLineNumber}
Link Style 2:
/{owner}/{repository}/blob/{SHA}/{path/to/file}#L{StartLineNumber}-L{EndLineNumber}
Example-1 with style 1:
http://localhost:8080/root/gitbucket/blob/19f0431a3fb4a9c3560dbf9b1d74f2073da7708f/GitBucketCoreModuleSpec.scala#L5-L10
Example-1 with style 2:
/root/gitbucket/blob/19f0431a3fb4a9c3560dbf9b1d74f2073da7708f/GitBucketCoreModuleSpec.scala#L5-L10
Example-2 with style 1:
http://localhost/root/gitbucket/blob/19f0431a3fb4a9c3560dbf9b1d74f2073da7708f/src/main/scala/GitBucketCoreModuleSpec.scala#L5-L10
Example-2 with style 2:
/root/gitbucket/blob/19f0431a3fb4a9c3560dbf9b1d74f2073da7708f/src/main/scala/GitBucketCoreModuleSpec.scala#L5-L10
```
## Note
Please use link with sha, not branch name such as `master`. Because `master` changes by commits.
```
Good url:
http://localhost:8080/root/gitbucket/blob/19f0431a3fb4a9c3560dbf9b1d74f2073da7708f/GitBucketCoreModuleSpec.scala#L5-L10
/root/gitbucket/blob/19f0431a3fb4a9c3560dbf9b1d74f2073da7708f/GitBucketCoreModuleSpec.scala#L5-L10
Not Good url:
http://localhost:8080/root/gitbucket/blob/master/GitBucketCoreModuleSpec.scala#L5-L10
/root/gitbucket/blob/master/GitBucketCoreModuleSpec.scala#L5-L10
```
## Version
Plugin version|GitBucket version
:---|:---
1.1.x |4.34.x -
1.0.x |4.34.x -
0.1.x |4.34.x -