1
1
# Syntax Annotations
2
2
3
- [ ![ releases] ( http ://img.shields.io/github/release/jkuczm/MathematicaSyntaxAnnotations.svg)] ( https://github.com/jkuczm/MathematicaSyntaxAnnotations/releases )
4
- [ ![ SemVer 2.0 .0] ( http ://img.shields.io/badge/SemVer-2.0 .0-brightgreen.svg)] ( http://semver.org/spec/v2.0.0.html )
5
- [ ![ license MIT] ( http ://img.shields.io/badge/license-MIT-blue.svg)] ( https://github.com/jkuczm/MathematicaSyntaxAnnotations/blob/master/LICENSE )
6
- [ ![ Mathematica 8.0 - 11 .0] (http ://img.shields.io/badge/Mathematica-8.0 -- 11 .0-brightgreen.svg)] ( #compatibility )
3
+ [ ![ releases] ( https ://img.shields.io/github/release/jkuczm/MathematicaSyntaxAnnotations.svg)] ( https://github.com/jkuczm/MathematicaSyntaxAnnotations/releases )
4
+ [ ![ Mathematica 8.0 - 11 .0] ( https ://img.shields.io/badge/Mathematica-8.0_--_11 .0-brightgreen.svg)] ( #compatibility )
5
+ [ ![ license MIT] ( https ://img.shields.io/badge/license-MIT-blue.svg)] ( https://github.com/jkuczm/MathematicaSyntaxAnnotations/blob/master/LICENSE )
6
+ [ ![ SemVer 2.0 .0] ( https ://img.shields.io/badge/SemVer-2.0 .0-brightgreen.svg)] ( http://semver.org/spec/v2.0.0.html )
7
7
8
8
9
9
Annotate syntax elements at box level.
@@ -17,6 +17,7 @@ Annotate syntax elements at box level.
17
17
* [ Compatibility] ( #compatibility )
18
18
* [ Bugs and requests] ( #bugs-and-requests )
19
19
* [ Contributing] ( #contributing )
20
+ * [ Usage in other packages] ( #usage-in-other-packages )
20
21
* [ License] ( #license )
21
22
* [ Versioning] ( #versioning )
22
23
@@ -35,36 +36,51 @@ on Mathematica Stack Exchange.
35
36
36
37
### Automatic installation
37
38
38
- To install SyntaxAnnotations package evaluate:
39
+ To install newest version of SyntaxAnnotations package,
40
+ in * Mathematica* version 10 or newer, evaluate following code:
39
41
``` Mathematica
40
- Import["https ://raw.githubusercontent. com/jkuczm/MathematicaSyntaxAnnotations/master/BootstrapInstall.m"]
42
+ PacletInstall@"http ://github. com/jkuczm/MathematicaSyntaxAnnotations/releases/download/v0.2.2/SyntaxAnnotations-0.2.2.paclet"
41
43
```
42
44
43
- Note that this will also install
44
- [ ProjectInstaller] ( https://github.com/lshifr/ProjectInstaller )
45
- package, if you don't have it already installed.
45
+ Note that above requires allowing * Mathematica* to use the Internet.
46
46
47
- To load SyntaxAnnotations package evaluate: `` Needs["SyntaxAnnotations`"] `` .
47
+ To load SyntaxAnnotations package evaluate:
48
+ ``` Mathematica
49
+ Needs@"SyntaxAnnotations`"
50
+ ```
51
+
52
+ To uninstall SyntaxAnnotations package evaluate:
53
+ ``` Mathematica
54
+ PacletUninstall@"SyntaxAnnotations"
55
+ ```
48
56
49
57
50
58
### Manual installation
51
59
52
- 1 . Download latest released
53
- [ SyntaxAnnotations.zip] ( https://github.com/jkuczm/MathematicaSyntaxAnnotations/releases/download/v0.2.1/SyntaxAnnotations.zip )
54
- file.
60
+ If in your setup * Mathematica* doesn't have Internet access,
61
+ or you're using version older than 10, download
62
+ [ SyntaxAnnotations.0.2.2.paclet] ( https://github.com/jkuczm/MathematicaSyntaxAnnotations/releases/download/v0.2.2/SyntaxAnnotations-0.2.2.paclet )
63
+ file and evaluate ` PacletInstall ` with path to downloaded file:
64
+ ``` Mathematica
65
+ PacletInstall@"path/to/downloaded/SyntaxAnnotations.0.2.2.paclet"
66
+ ```
55
67
56
- 2 . Extract downloaded ` SyntaxAnnotations.zip ` to any directory which is on
57
- * Mathematica* ` $Path ` , e.g. to one obtained by evaluating
58
- ` FileNameJoin[{$UserBaseDirectory,"Applications"}] ` .
68
+ To load SyntaxAnnotations package evaluate:
69
+ ``` Mathematica
70
+ Needs@"SyntaxAnnotations`"
71
+ ```
59
72
60
- 3 . To load the package evaluate: `` Needs["SyntaxAnnotations`"] ``
73
+ To uninstall SyntaxAnnotations package evaluate:
74
+ ``` Mathematica
75
+ PacletUninstall@"SyntaxAnnotations"
76
+ ```
61
77
62
78
63
79
### No installation
64
80
65
81
To use package directly from the Web, without installation, evaluate:
66
82
``` Mathematica
67
- Import[ "https://raw.githubusercontent.com/jkuczm/MathematicaSyntaxAnnotations/master/SyntaxAnnotations/SyntaxAnnotations .m"]
83
+ Import@ "https://raw.githubusercontent.com/jkuczm/MathematicaSyntaxAnnotations/master/NoInstall .m"
68
84
```
69
85
70
86
@@ -77,8 +93,9 @@ Package is tested with all *Mathematica* major and minor versions from 8.0 to
77
93
11.0 on Linux. Since it doesn't contain any OS specific code it should work
78
94
with above versions on all operating systems.
79
95
80
- There's also no obvious reason for package not to work on earlier (6.0+)
81
- versions of * Mathematica* .
96
+ There's also no obvious reason for package not to work on older (6.0+)
97
+ and newer (11.1+) versions of * Mathematica* ,
98
+ but it was not tested with these versions.
82
99
83
100
84
101
@@ -93,13 +110,55 @@ If you find any bugs or have feature request please create an
93
110
94
111
Feel free to fork and send pull requests.
95
112
96
- If you want to use Ant scripts from this repository you will also need to
97
- install [ WWBCommon] ( https://github.com/jkuczm/WWBCommon ) project.
98
-
99
113
All contributions are welcome!
100
114
101
115
102
116
117
+ ## Usage in other packages
118
+
119
+ There are two ways to use SyntaxAnnotations with your own package.
120
+
121
+ First is to require users, of your package, to install SyntaxAnnotations
122
+ separately. Your package can then load it, as any other external package, using
123
+ `` Get@"SyntaxAnnotations`" `` . Be aware that if your package requires specific
124
+ version of SyntaxAnnotations and user wants to use other package requiring
125
+ different version of SyntaxAnnotations it may lead to a version conflict.
126
+
127
+ Second way is to include specific version of SyntaxAnnotations as sub-package
128
+ of your package. To do it, simply put ` SyntaxAnnotations.m ` file inside main
129
+ directory of your package. And load it using `` Get@"`SyntaxAnnotations`" ``
130
+ (note the grave accent character at the beginning of string) somewhere inside
131
+ main context of your package.
132
+
133
+ Directory structure of `` YourPackage` `` can, for example, look like this:
134
+
135
+ ```
136
+ YourPackage
137
+ ├── Kernel
138
+ │ └── init.m
139
+ ├── SyntaxAnnotations.m
140
+ └── YourPackage.m
141
+ ```
142
+
143
+ and ` YourPackage.m ` file:
144
+
145
+ ``` Mathematica
146
+ BeginPackage@"YourPackage`"
147
+ (* Public symbols usage *)
148
+ Get@"`SyntaxAnnotations`"
149
+ Begin@"`Private`"
150
+ (* Implementation *)
151
+ End[]
152
+ EndPackage[]
153
+ ```
154
+
155
+ This way specific version of SyntaxAnnotations package, distributed with your
156
+ package, will be loaded as `` YourPackage`SyntaxAnnotations` `` , and will be
157
+ completely independent of other versions of SyntaxAnnotations possibly used by
158
+ user of your package.
159
+
160
+
161
+
103
162
## License
104
163
105
164
This package is released under
0 commit comments