æè¿Chromeæ¡å¼µæ©è½ã«ã¤ãã¦èããæ©ä¼ãå¤ããèªåãä½ãä½ã£ã¦ã¿ããã¨ã«ãããããã¦ãããèªåãChromeæ¡å¼µã®ä¸ã¤ãäºã¤ä½ããªãã¦ãªã¯ï½ããªã©ã¨èãã¦ãããã®ã®ãç¹ã«ã¢ã¤ãã¢ãããããã§ã¯ãªãã®ã§ãæ¾ç½®ãã¦ããã ãããä¸åº¦è¯ãã¢ã¤ãã¢ãèãéãã¦ããã®ã§ããã£ã¦ã¿ããã¨ã«ããã
- headingè¦ç´ ã«ãã¼ããªã³ã¯ã欲ãã
- ã§ãã
- Chrome Web Storeã«ç»é²ãã
- ææ³
- éã§ã¤ã³ã¹ãã¼ã«ãããæ¹åãæ å ±
headingè¦ç´ ã«ãã¼ããªã³ã¯ã欲ãã
å æ¥Scala 3.0.2ã®ãªãªã¼ã¹ãã¼ããèªãã§ããã¨ããè¯ããªã¨æã£ãè¨è¿°ããã£ããå ·ä½çã«ã¯æ¬¡ã®ç®æã
Scala 3.0.2 released! | The Scala Programming Language
åæ å ±ããã¨ã«ãã¡ã½ãããæ¤ç´¢ã§ããããã«ãªããããããããããHoogleã®Scalaçã¨ãã£ãã¨ãããé¢ç½ãã®ã§ããã®ãªã³ã¯ã社ã®Slackã«æ稿ãããã¨ããã
ãã®ç®æã¯h3
è¦ç´ ãçé ã«è¨è¿°ããã¦ãããh3
è¦ç´ ã«id
å±æ§ãããã®ã§ãã©ã°ã¡ã³ãè¨æ³ã使ã£ã¦https://www.scala-lang.org/blog/2021/09/07/scala-3.0.2-released.html#method-search-by-type-signature
ã¨ããURIãæ§æã§ãããããã®è¨æ³ã§ãªã³ã¯ãè²¼ãã°ãã©ã¦ã¶ã¯ããã«ãã®ç®æã表示ãã¦ãããã ããã
æè¿ã®ãµã¤ãã§ã¯ãheadingè¦ç´ ã«id
å±æ§ããããããªãã¿ã¼ã³ã§ã¯ãè¦åºãã®å³å´ã«ãªã³ã¯ðã®çµµæåã表示ãããã¯ãªãã¯ããã¨ãªã³ã¯ãã³ãã¼ã§ããã®ã ããä»åã®ãµã¤ãã«ã¯ãã®ãããªä»çµã¿ããªãã£ãã®ã§ãéçºè
ã³ã³ã½ã¼ã«ãéãã¦id
å±æ§ã®ä¸èº«ãã³ãã¼ããªããã°ãªããªãã£ãã
ãã®æ©è½ã¯Chromeæ¡å¼µæ©è½ã§å®ç¾ã§ãããã ããããã»ã©å®è£ ã«æéãããããã¨ã¯ãªãããã ã¨æã£ãã®ã§ããã£ããä½ããã¨ã«ããã
ã§ãã
æä½éã®æ©è½ãå®è£ ãã¦ä½æããã®ããã¡ãã
h2
, h3
, h4
è¦ç´ ã«id
å±æ§ãããã¨ãã¯ãèªåçã«ãã¼ããªã³ã¯ãä½æãã¦ãããããã«ãªã£ãï¼å³ã§ã¯è¦åºãã®æ«å°¾ã«#
è¨å·ãåºç¾ãã¦ããï¼ã
ãã£ããã¨ã¯ä»¥ä¸ã®éãã
- å®è£
ã¨ãªã
content_script.js
ã®å®è£ - ã¢ã¤ã³ã³å種ã®ä½æï¼PNGå½¢å¼ï¼
manifest.json
ã®ä½æ
æä½éããã ãã§ãªãã¨ããªããå®è£ ã«ã¯ä»¥ä¸ã®ãµã¤ããåèã«ããã
ãã®è¨äºã®ã¿ã¤ãã«éãããã®æ¡å¼µæ©è½ã¯ä¼ç¤¾ã®æ¼ä¼ã¿ã«ä½ãã¦ãã¾ã£ãã
content_script.js
ãã¼ã¸ãã¼ãæã«document
å
ã®h2[id],h3[id],h4[id]
ãããéãã¦ãã¦ããªã³ã¯ã¨ãªãa
è¦ç´ ãæ«å°¾ã«ãã£ã¤ãã¦ããã
window.onload = function() { const elems = [...document.querySelectorAll('h2[id], h3[id], h4[id]')]; elems.forEach((e) => { const link = document.createElement('a'); link.innerText = '#'; link.href = location.href + '#' + e.id; const small = document.createElement('small'); small.append(link) const sub = document.createElement('sub'); sub.append(small); e.append(sub); }); }
ããã ãã
ã¢ã¤ã³ã³å種
GIMPã§é©å½ã«ä½æãããid
å±æ§ãããã¨ããã«ãªã³ã¯ã追å ããã®ã§ãid
ã象徴ãã#
è¨å·ã¨ããªã³ã¯ã象徴ããã¢ã³ãã¼ã©ã¤ã³ã使ã£ããã®ã«ããã
ã¡ãªã¿ã«ããã§åçç¹ããããç¥èä¸è¶³ããå ã«32x32ãã¯ã»ã«ã®ã¢ã¤ã³ã³ãä½æãã¦ãã¾ã£ãã®ã§ã128x128ãã¯ã»ã«ã®ç»åãã¼ãããã«ãªã£ã¦ãã¾ã£ããå®éã¯32x32ãããã°è¯ãã£ã½ãï¼ã®ã ããã©ãä¸çªå ã«128x128ãããã大ãããµã¤ãºã§ã¢ã¤ã³ã³ãä½æãã¦ãé©å®ç¸®å°ããã»ããããã¨æãã
manifest.json
ã®ä½æ
æ¡å¼µæ©è½ã«ã¯manifest.json
ãå¿
é ãæå°éname
ã¨manifest_version
ãcontent_scripts
ããããåããã°ããããã ã£ãã
{ "name": "ID Heading Autolinker", "description": "Insert permalink automatically along h2, h3, h4 elements with ID attribute.", "manifest_version": 2, "version": "0.1", "author": "windymelt", "homepage_url": "https://github.com/windymelt/id-heading-autolinker-extension", "browser_action": { "default_icon": "icon_32.png" }, "icons": { "16": "icon_16.png", "48": "icon_48.png", "128": "icon_128.png" }, "content_scripts": [ { "matches": ["http://*/*", "https://*/*"], "js": ["content_scripts.js"] } ], "permissions": ["activeTab"] }
ãã¼ã¸ã§ã³çªå·ã¯ããã«ã管çæ¼ããããã§æãã
ãã®éãè¨è¿°ããã¨ããã©ã¦ã¶ãã¿ããéããã³ã«content_scripts.js
ãå®è¡ãããã
åä½ç¢ºèª
ãã¼ã«ã«ã§åä½ç¢ºèªããããã«ã¯ãæ¡å¼µæ©è½ã®ç®¡çç»é¢ãããããã±ã¼ã¸åããã¦ããªãæ¡å¼µæ©è½ãèªã¿è¾¼ãããé¸æããmanifest.json
ããããã£ã¬ã¯ããªãæå®ããã°ããã
ããã§æ¡å¼µæ©è½ãæå¹åãããã
åé ã«ç»å ´ããScala3.0.2ã®ãªãªã¼ã¹ãã¼ããè¦ãã¨ãã¡ããã¨ãªã³ã¯ãåºç¾ãã¦ãããã¨ããããã
ãã¾ã®ã¨ããã¡ããã¨åä½ãã¦ããããã§ãå°ã£ããã¨ã¯èµ·ãã£ã¦ããªããç©å¹´ã®é¢åèãã解æ¶ãããã®ã§ã¨ã¦ãããããã
Chrome Web Storeã«ç»é²ãã
ãã£ããä½ã£ã¦ã¡ããã¨åä½ããããã«ã¯ä»ã®äººã«ã使ã£ã¦ãããããã¨æã£ãã®ã§ãChrome Web Storeã¸ã®ç»é²ã«ããã£ã¬ã³ã¸ãã¦ã¿ããChrome Web Storeã¸ã®ç»é²ã«é¢ãã¦ã¯å ¬å¼ã®ããã¥ã¡ã³ããåç §ããã
ä¸æ£å©ç¨ãé²ãããããååç»é²æã«5ãã«Googleã«å¾¡å¸æ½ããªããã°ãªããªãããã¤ãã§ãã¤ã¬ãåããã¨ããããã®ãããï¼ã¦ã¼ãã§ï¼åãããè¨æ¶ãããã
åºæ¬çã«ãã©ã¼ã ãåãã¦ããã ããªã®ã§ãã¾ãé£ãããã¨ã¯ãªããæ°ãä»ããã®ã¯ä»¥ä¸ã®ç¹ã
- ãã¼ããã·ã§ã³ã®ç¯å²ãåºãï¼ä»åã¯å ¨ãµã¤ãã§æå¹åããæ¡å¼µæ©è½ãªï¼ã®ã§ããã®çç±ã1è¡æ¸ãå¿ è¦ãããã
- ZIPãã¡ã¤ã«ãã¢ãããã¼ãããå¿ è¦ããããä»åã¯Githubã®ãªãªã¼ã¹æ©è½ã使ã£ã¦ZIPãä½ããããããã®ã¾ã¾ã¢ãããã¼ãããã
- ã¹ã¯ã·ã§ãæ·»ä»ããå¿ è¦ããããGIMPã§ã¡ã¾ã¡ã¾æå®ã®ãµã¤ãºã®ã¹ã¯ã·ã§ãä½æããã
- æ¡å¼µæ©è½ã®èª¬ææãè±èªã§æ¸ããã¨ã«ãªãããã©ãæãè±èªåããã¬ããããããªãã®ã§ä¸å®ã«ãªã£ãã
ãã¼ããã·ã§ã³ã®ç¯å²ãåºãã®ã§ä»åã¯ãã°ãã審æ»å¾ ã¡ã«ãªãããã§ããããããã¼ã³ã³ã½ã¼ã«ã®ç»é¢ã¯ããããç¶æ ã«ãªã£ã¦ããã
ææ³
æå¤ã¨ç°¡åã ã£ãããã£ã¨æ©è½ãè¤éã«ãªã£ã¦ãããnpmã使ã£ããTypeScriptã使ããããªããããããã¨ä»å使ã£ããéã«Github Releaseãä½æãã¦ZIPãå¾ããæ¹å¼ãéç¨ããªããªãã®ã§ãå¥ã®ãã«ãã©ã¤ã³ãä½ããã¨ã«ãªãã®ããªããã¨æã£ãããã®æ¡å¼µæ©è½ã§å¤§å²ããããã
éã§ã¤ã³ã¹ãã¼ã«ãããæ¹åãæ å ±
Githubã®ReleaseããZIPãã¡ã¤ã«ããã¦ã³ãã¼ãã§ããã®ã§ã解åããã¨ãããã±ã¼ã¸åããã¦ããªãæ¡å¼µæ©è½ãèªã¿è¾¼ããã§å©ç¨ãããã¨ãã§ãã¾ããAt Your Own Risk.