diff --git a/README.md b/README.md index 61b3a62..5b4ec6d 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,26 @@ For private repositories, set this flag. } ``` +- `label`: button label (optional, default is `Bug Report`) + +Set button label if you want to use other than default. + +```json +{ + "gitbook": ">=3.0.0", + "title": "Example", + "plugins": [ + "github-issue-feedback" + ], + "pluginsConfig": { + "github-issue-feedback": { + "repo": "your/private_repo", + "label": "Report Issue on GitHub" + } + } +} +``` + ## Changelog See [Releases page](https://github.com/azu/gitbook-plugin-github-issue-feedback/releases). diff --git a/src/plugin.js b/src/plugin.js index 87f9d3e..7d58bea 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -62,7 +62,7 @@ window.require(["gitbook"], function(gitbook) { gitbook.events.bind("start", function(e, pluginConfig) { var config = pluginConfig["github-issue-feedback"]; var reportElement = document.createElement("button"); - reportElement.textContent = "Bug Report"; + reportElement.textContent = config["label"] || "Bug Report"; reportElement.className = "gitbook-plugin-github-issue-feedback"; reportElement.setAttribute("style", "position:fixed; right:0;bottom:0;"); var clickEvent = ("ontouchstart" in window) ? "touchend" : "click";