-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
51 lines (51 loc) · 3.39 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title>RDFa-Lab</title>
<style>
.bmlet {
font-weight: bold;
text-decoration: none;
}
:target {
outline: 1px dotted #aaa;
}
</style>
</head>
<body vocab="http://schema.org/" typeof="WebPage">
<h1 property="name dc:title">RDFa-Lab</h1>
<section>
<h2>Bookmarklets</h2>
<p>Save these as bookmarks, then activate when on an appropriate page to trigger their effect:</p>
<ul>
<li>
<p>
[<a class="bmlet" id="bmlet-rdfa-to-jsonld" href='javascript: void((function () { if(!document.getElementById("rdfa-json-boot")){ var s=document.createElement("script"); s.type="text/javascript"; s.id="rdfa-json-boot"; s.src="http://niklasl.github.com/rdfa-lab/js/rdfa-json.js"; s.onload = function () { var json = JSON.stringify(RDFaJSON.extract().data, null, 2).replace(/{\s+(\S+: "[^"]+")\s+}/gm, "{$1}").replace(/\[\s+(.+)\s+\]/gm, "[$1]"); window.location = "data:application/json," + encodeURIComponent(json); }; document.getElementsByTagName("head")[0].appendChild(s); } })());'
>RDFa to JSON-LD</a>]
<span>Extracts RDFa from the current page and displays it as a JSON-LD serialization (uses <a href="https://github.com/niklasl/rdfa-lab/wiki/RDFa-to-JSON-LD">RDFa to JSON-LD</a>).</span>
</p>
</li>
<li>
<p>
[<a class="bmlet" id="bmlet-use-rdfa-css" href='javascript: void((function () {var d=document, links=d.getElementsByTagName("link"); for(var i=0, l; l=links[i++];) { if(l.rel.indexOf("stylesheet") != -1) l.disabled = !l.disabled; } if (d.getElementById("rdfa-css")) return; var l = d.createElement("link"); l.rel = "stylesheet"; l.id = "rdfa-css"; l.href = "http://niklasl.github.com/rdfa-lab/css/rdfa.css"; d.getElementsByTagName("head")[0].appendChild(l); })());'>Toggle RDFa.CSS</a>]
<span>Toggles the <a href="https://github.com/niklasl/rdfa-lab/wiki/RDFa-CSS">RDFa.CSS</a> for a page (applies a special style which highlights elements using RDFa attributes).</span>
</p>
</li>
<li>
<p>
[<a class="bmlet" id="bmlet-sdo-md-to-rdfa" href='javascript: void((function () { if(!document.getElementById("md2rdfa")){ var s=document.createElement("script"); s.type="text/javascript"; s.id="md2rdfa"; s.src="http://niklasl.github.com/rdfa-lab/js/misc/md2rdfa.js"; s.onload = function () { md2rdfa.convertSdoMdExamplesToRdfa(); }; document.getElementsByTagName("head")[0].appendChild(s); } })());'>Convert Schema.org microdata examples to RDFa</a>]
<span>If you like <a href="http://schema.org/">schema.org</a>, but prefer RDFa over microdata, use this bookmarklet on the schema.org pages.</span>
</p>
</li>
</ul>
<h3>How To Save a Bookmarklet</h3>
<p>Depending on what your browser supports, either:</p>
<p>A) right-click and add as bookmark; or</p>
<p>B) drag the link to e.g. a bookmark toolbar; or</p>
<p>C) right-click, copy the link address, then create a new bookmark and paste the link there (it should begin with "javascript:").</p>
</section>
<footer vocab="">
<a href="https://github.com/niklasl/rdfa-lab"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
</footer>
</body>
</html>