-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprov-n-textmate.html
More file actions
106 lines (99 loc) · 7.42 KB
/
Copy pathprov-n-textmate.html
File metadata and controls
106 lines (99 loc) · 7.42 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Dong Huynh">
<link rel="alternate" href="https://trungdong.github.io/feeds/all.atom.xml" type="application/atom+xml" title="Dong Huynh Full Atom Feed"/>
<title>TextMate Bundle for PROV-N // Dong Huynh</title>
<link rel="stylesheet" href="https://trungdong.github.io/theme/css/style.css">
<link rel="stylesheet" href="https://trungdong.github.io/theme/css/pygments.css">
</head>
<body>
<div id="layout">
<div class="sidebar sidebar-article">
<header class="header-article">
<h2 class="article-info"><a href="https://trungdong.github.io/author/dong-huynh.html" title="See posts by Dong Huynh">Dong Huynh</a></h2>
<h3 class="published-label">Published</h3>
<p><time datetime="2014-03-19T01:11:00+00:00">Wed 19 March 2014</time></p>
<a href="/">←Home</a>
</header>
</div>
<div class="main">
<div class="content">
<section class="post">
<header class="post-header">
<h1>TextMate Bundle for PROV-N</h1>
<p class="post-meta">
// under <a class="post-category" href="https://trungdong.github.io/tag/prov-n.html">PROV-N</a>
<a class="post-category" href="https://trungdong.github.io/tag/provenance.html">provenance</a>
<a class="post-category" href="https://trungdong.github.io/tag/syntax-highlighting.html">syntax highlighting</a>
<a class="post-category" href="https://trungdong.github.io/tag/textmate.html">TextMate</a>
</p>
</header>
</section>
<p>The Provenance Notation (<a href="https://www.w3.org/TR/prov-n/">PROV-N</a>) has been my
chosen representation when it comes to writing provenance. It has a relatively
low cognitive cost and easier for humans to read (at least to me), compared to
other provenance representations. Even so, I usually found myself making mundane
mistakes and typos and have had to repetitively rely on the <a href="https://openprovenance.org/services/view/validator">Provenance
Validator</a> to check my
provenance for syntactical errors. Hence the motivation to find a tool to help
write provenance faster with less mistakes.</p>
<p>Here comes <a href="https://macromates.com/">TextMate</a>! </p>
<p>TextMate is a powerful text editor on Mac (which I have only used it lightly, on and off). It provides support for numerous text file formats thanks to the flexible extensibility it offers. Having discovered how to <a href="https://macromates.com/manual/en/language_grammars">define a new language</a> in TextMate, I set off trying to find a way to alleviate my pains with PROV-N authoring right away. To cut the story short, here is the results. </p>
<p><img class="pure-img centered" src="https://trungdong.github.io/images/textmate-prov-n-screenshot.png" title="Screenshot of TextMate with PROV-N syntax highlighting" alt="Screenshot of TextMate with PROV-N syntax highlighting"></p>
<p>If you like what you see, grab the PROV-N TextMate bundle from my <a href="https://github.com/trungdong/provn-textmate">github repository</a>. An installation of TextMate, of course, is required. </p>
<p><img class="pure-img float-right" src="https://trungdong.github.io/images/textmate-prov-n-snippets.png" title="PROV-N Snippets" alt="PROV-N Snippets">
In addition to the PROV-N syntax highlighting, another bonus provided by the bundle is the <a href="https://macromates.com/manual/en/bundles#tab_triggers">tab-triggered snippets</a> for all PROV-N statements. For example, you can just type <span style="font-family: Courier New, Courier, monospace;">wd⇥</span> (<span style="font-family: 'Courier New', Courier, monospace;">⇥</span> is the tab key) to get <span style="font-family: Courier New, Courier, monospace;">wasDerivedFrom(, , -, -, -, [])</span>. The list of all snippets is on the right (or look them up in the Bundles > Provenance Notation menu in TextMate). Please note though that the PROV attributes snippets are available only between the square brackets (i.e. the attributes block) in a statement. </p>
<p>Disclaimer: The bundle is my very first attempt and there are many issues remained. Please don't expect it supports all possible valid PROV-N statements. </p>
<p>If you are working with PROV-N, I hope you will find this TextMate bundle useful. Contributions and suggestions are very welcome. </p>
<p><strong>For Sublime Text users</strong>: You can install the <a href="https://raw.github.com/trungdong/provn-textmate/master/prov-n.tmbundle/Syntaxes/provn.tmLanguage">PROV-N language grammar</a> in Sublime Text to get the same syntax highlighting as shown above. To do this, download and copy the file to the User package folder (Menu: Preferences > Browse Packages...) </p>
<p><strong>Update</strong>: A JavaScript code editor supporting the PROV-N syntax is now available. See <a href="https://trungdong.github.io/prov-n-javascript-editor.html">this post</a>.</p>
<div class="hr"></div>
<a href="#" class="go-top">Go Top</a>
<div class="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = "trungdong-github-io"; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div><footer class="footer">
<p>© Dong Huynh –
Built for <a href="https://getpelican.com/">Pelican</a>
</p>
</footer> </div>
</div>
</div>
<script>
// Replaces jQuery 2.0.3, which the theme loaded from a CDN to do only this.
(function () {
var top = document.querySelector('.go-top');
if (top) {
var sync = function () {
top.classList.toggle('is-visible', window.scrollY > 200);
};
sync();
window.addEventListener('scroll', sync, { passive: true });
top.addEventListener('click', function (event) {
event.preventDefault();
window.scrollTo({ top: 0, behavior: 'smooth' });
});
}
// Anchors that exist only to be styled should not jump to the top.
document.addEventListener('click', function (event) {
var anchor = event.target.closest('a[href="#"]');
if (anchor) { event.preventDefault(); }
});
}());
</script>
<script data-goatcounter="https://trungdong.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script></body>
</html>