You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 27, 2020. It is now read-only.
By default link label will be "Edit This Page". You can change it using plugin config `rtEditLinkLabel`.
14
+
### Step #1 - Update `book.json` file
18
15
19
-
## Sample `book.json` file
16
+
1. In you gitbook's `book.json` file, add `edit-link` to `plugins` list.
17
+
2. In `pluginsConfig`, Set `base` value which is base path to your github or gitlab or other code repo. Trailing slash is NOT required.
18
+
3. By default link label will be "Edit This Page". You can change it using plugin config `label`.
20
19
21
-
*Important*: Make sure you edit value of `rtEditLinkBase`. You can replace `edit` with `tree` if you want source file to open in read-mode, rather than edit-mode directly on github/gitlab.
**Important**: Make sure you edit value of `edit-link => base`. You can replace `edit` with `tree` if you want source file to open in read-mode, rather than edit-mode directly on github/gitlab.
32
34
33
-
Above snippet can be used as complete `book.json` file, if your book doesn't have one yet.
34
-
35
-
## Screenshot
35
+
**Note**: Above snippet can be used as complete `book.json` file, if your book doesn't have one yet.
1. Run `gitbook install`. It will automatically install `edit-link` gitbook plugin for your book. This is needed only once.
40
+
2. Build your book (`gitbook build`) or serve (`gitbook serve`) as usual.
39
41
40
42
## Troubleshooting
41
43
@@ -44,6 +46,6 @@ Above snippet can be used as complete `book.json` file, if your book doesn't hav
44
46
45
47
## How this work?
46
48
47
-
This plugin simply looks for HTML comment `<!-- Actions Right -->` in parsed page content and insert "edit link" HTML right after it (HTML comment).
49
+
This plugin simply looks for HTML comment `<!-- Actions Right -->` in parsed page content and insert "edit link" HTML just before `<!-- Actions Right -->`.
48
50
49
-
This means if that HTML comment changes, this plugin will break (I hope to fix it easily whenever that happen).
51
+
This means if that HTML comment changes, this plugin will break but I hope to fix it easily whenever that happen.
throw"ERROR: 'base' value required to generate 'Edit This Page' link. \nFor help, please refer to - https://github.com/rtCamp/gitbook-plugin-edit-link/blob/master/README.md#usage";
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "gitbook-plugin-edit-link",
3
3
"description": "GitBook Plugin to add \"Edit this page\" link on every page. Link target will be that page's source file on Github or Gitlab or any repo.",
0 commit comments