forked from int2str/jssyntaxtree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtip.js
26 lines (22 loc) · 1.26 KB
/
tip.js
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
// jsSyntaxTree - A syntax tree graph generator
// (c)2019 Andre Eisenbach <[email protected]>
'use strict';
const tips = [
'Click on the syntax tree image to download a copy.',
'jsSyntaxTree works offline, instantly updates and handles unicode fonts.',
'You can right-click the image and copy & paste the graph into your document editor.',
'The graph will update automatically once a matching number of brackets is detected.',
'Add manual subscripts to nodes using an underscore character.<br />' +
'Example: <a href="?[N_s%20Dogs]">[N_s Dogs]</a>',
'Add manual superscript to nodes using the ^ character.<br />' +
'Example: <a href="?[N^s%20Cats]">[N^s Cats]</a>',
'You can add spaces to nodes by putting them inside double quotes.<br />' +
'Example: <a href="?["Main%20clause"%20[S][V][O]]">["Main clause" [S][V][O]]</a>',
'Add arrows to a node by using an ->, <- or <> arrow followed by column number.<br />' +
'Example: <a href="?[A%20[B%20C][D%20E][F%20G%20->1]]">[A [B C][D E][F G ->1]]</a>'
];
let tip_idx = Math.floor(Math.random() * tips.length);
export default function rotateTip() {
document.getElementById('tip').innerHTML =
'<strong>Tip:</strong> ' + tips[tip_idx++ % tips.length];
}