-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathREADME.pod6
64 lines (42 loc) · 2.51 KB
/
README.pod6
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
=begin pod
=TITLE Raku Language Definition for Highlight.js library
This is the language definition fileset to describe L<Raku|https://raku.org> for C<highlight.js>.
It is composed of four language definition files, one for the main language, and one each
for the braids, namely C<Pod>, C<Quoting>, and C<Regex>.
=head1 Packaging
Simply include the C<highlight.js> script package in your webpage or Node app, load up this module, and apply it to C<hljs>.
If you're not using a build system and just want to embed this in your webpage:
<script src="https://cdn.jsdelivr.net/npm/highlightjs"></script>
<script src="https://cdn.jsdelivr.net/npm/highlightjs-raku"></script>
<script>
hljs.registerLanguage("raku", window.hljsDefineRaku);
hljs.initHighlightingOnLoad();
</script>
If you're using webpack / rollup / browserify / node:
var hljs = require("highlightjs");
var hljsDefineRaku = require("highlightjs-raku");
hljsDefineRaku(hljs);
hljs.initHighlightingOnLoad();
=head1 LICENSE
This software is provided under Artistic 2.0, the same license as L<Raku license|https://raku.org/LICENSE>
=head1 Credits
The language definition fileset was initiated by Richard Hainsworth, aka finanalyst.
Other contributors:
=head1 Contributing
All contributions are welcome. Please create a PR.
Highlighting a complex language such as B<Raku> involves decisions about
which items are important and should be styled differently. Two existing
highlighting systems for B<Raku> existed before this language definition was
created, namely a highlighter written for B<Atom> by Samanatha McVie, and the
highlighting for the B<Comma IDE> managed by Jonathan Worthington. The essential
choices can be found in the repo as C<Comma_RakuHighlighting.txt> and C<perl6fe.cson>.
B<Highlightjs> already has numerous styles, which colour various C<modes>. Most style
definitions target the C<modes>. So the mode names were chosen to match as closely the
semantic names, but where B<Raku> is different, another almost random mode-name was chosen.
B<Raku> has three separate braids for C<Pod>, C<Quoting>, and C<Regex>. In nearly all other
languages these three categories are treated as C<Strings> or C<Documentation>. In B<Raku> they
are far more important and complex. Consequently, they have been separated into sublanguages.
Their C<modes> are styled using different mode names.
If there is a need, then another style sheet can be established for B<Raku>, so that the braids
can be distinguished in a more consistent manner.
=end pod