1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Backlogの課題にScrapboxでメモするためのブックマークレット

Posted at

概要

各チケットの雑多なメモをScrapboxで書いている。
タイトルや引用を毎回書くのは大変なので、ブックマークレット化したものを使い続けている。

手順

  1. 下記をブックマーク登録のURL欄に貼り、proj-nameをScrapbox側に合わせて変更
  2. 課題のページにてブックマークを実行
Backlog => Scrapbox
javascript:(function(){
    var PROJ_NAME = 'proj-name';
    var getElement = function(className) {
    var element = document.getElementsByClassName(className)[0];
        return element ? element.textContent : null;
    };
    var keyNumber = getElement("ticket__key-number");
    var titleText = getElement("title-group__title-text");
    if (!keyNumber || !titleText) return;
    var markdownBody = document.getElementsByClassName("markdown-body")[0];
    markdownBody = markdownBody ? markdownBody.innerHTML.replace(/<li>/g, "").replace(/<\/t(h|d)>\n\s*<t(h|d)>/g, " | ").replace(/<("[^"]*"|'[^']*'|[^'">])*>/g, '').replace(/\n+(\s*\n+)*/g,'\n> ') : "";
    var title = "\u{1F3AB}" + keyNumber + " " + titleText;
    var body = "#Backlog #\u{1F3AB} \n[" + keyNumber + " " + window.location.href + "]\n> " + markdownBody + "\nMEMO:";
    window.open('https://scrapbox.io/' + PROJ_NAME + '/' + encodeURIComponent(title.trim())+'?body='+encodeURIComponent(body.trim()));
 })();

title, bodyの内容はお好みで。「#🎫」のタグ付けは便利。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?