Forked from anonymous/section_numbers_for_real_world_haskell.user.js
Created
August 25, 2011 09:50
-
-
Save yuya-takeyama/1170348 to your computer and use it in GitHub Desktop.
Real World Haskell の HTML 中に節番号振るグリモン
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name section_numbers_for_real_world_haskell.user.js | |
// @namespace http://yuyat.jp/ | |
// @description Gives section numbers for Real World Haskell book online. | |
// @include http://book.realworldhaskell.org/read/* | |
// ==/UserScript== | |
(function (elements) { | |
var n = 1; | |
for (var i in elements) { | |
var element = elements[i]; | |
if (i > 0 && element.tagName === 'H2') { | |
element.innerHTML = n + ". " + element.innerHTML; | |
n += 1; | |
} | |
} | |
})(document.getElementsByClassName('title')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment