I have pushed through some quick changes, hopefully I haven’t broken anything.
I have been spending time on this that I really do not have to spare at present, so it is my hope that others will chip in to get this to a state where it is usable.
The code itself is very concise and not complex.
Changes:
- Disable “Make a PR” button and show an error message if the tiddler titles entered do not correspond to real tiddlers. Primary concern here is someone forgetting brackets around a title with spaces, which would create a broken PR, and having no way to correct it once the PR has been created.
- Use the PR title in slugified form as a prefix for the branch name.
- show rudimentary progress notifications
- made target repository configurable via config tiddler
- added some rudimentary error handling
- ensure that new files added get a
.tid
extension
Note that the first time you create a PR after loading the wiki, the Octokit library is loaded on demand. This is why that first PR takes longer, a second PR created without reloading the wiki is much faster. This is implemented in this manner so that wikis that have this “plugin” do not load the libraries from the CDN until and unless they need it. If we imagined an edition that was specifically for making PRs, the libraries could also be loaded when the wiki loads.