summaryrefslogtreecommitdiff
path: root/src/www/syntax-editor/README.md
blob: 1a029f9b5f9452e27c48262c39b011a2e1329c1c (plain)
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
<!DOCTYPE html>
<html>
<head>
<title>About the syntax editor</title>
<link rel=stylesheet type="text/css" href="../minibar/minibar.css">
<link rel=stylesheet type="text/css" href="editor.css">
<meta charset="UTF-8">
</head>
<body class="syntax-editor">

# GF web-based syntax editor

John J. Camilleri  
December 2012

An improved version of the [old syntax editor][1].

[1]:http://www.grammaticalframework.org/~meza/restWiki/editor.html

## Example usage

See `editor.html` and `editor_online.js`.

## Available startup options

+---------------------+--------------------------------------------------+--------+
|Options              |Description                                       |Default |
+=====================+==================================================+========+
|target               |                                                  |"editor"|
|                     |                                                  |        |
+---------------------+--------------------------------------------------+--------+
|initial.grammar      |Initial grammar URL,                              |        |
|                     |e.g. `"http://localhost:41296/grammars/Foods.pgf"`|        |
+---------------------+--------------------------------------------------+--------+
|initial.startcat     |Initial startcat                                  |(grammar|
|                     |                                                  |default)|
+---------------------+--------------------------------------------------+--------+
|initial.languages    |Initial linearisation languages,                  |(all)   |
|                     |e.g. `["Eng","Swe","Mlt"]`                        |        |
+---------------------+--------------------------------------------------+--------+
|initial.abstr        |Initial abstract tree (as string), e.g. `"Pred    |        |
|                     |(That Fish) Expensive"`                           |        |
+---------------------+--------------------------------------------------+--------+
|show_grammar_menu    |Show grammar menu?                                |True    |
|                     |                                                  |        |
+---------------------+--------------------------------------------------+--------+
|show_startcat_menu   |Show startcat menu?                               |True    |
|                     |                                                  |        |
+---------------------+--------------------------------------------------+--------+
|show_to_menu         |Show languages menu?                              |True    |
|                     |                                                  |        |
+---------------------+--------------------------------------------------+--------+
|show_random_button   |Show random button?                               |True    |
|                     |                                                  |        |
+---------------------+--------------------------------------------------+--------+
|show_import          |Show import button/panel?                         |True    |
|                     |                                                  |        |
+---------------------+--------------------------------------------------+--------+
|show_export          |Show export button?                               |True    |
|                     |                                                  |        |
+---------------------+--------------------------------------------------+--------+

## Notes

- Tested with latest Chrome and Firefox (only).

## To do/feature requests

- Compatibility with grammars with dependent category types
- Clicking on tokens to select tree node
- Clipboard of trees
- Usage of printnames
- Enter string/float/int literals
- more prominence to Disamb-linearizations
- show all resulting linearizations/variants
- undo/redo (or back/forward) navigation
- structure fridge magnets more (eg newline before the magnet whose first letter is different)

## Known bugs

- Change startcat doesn't work when given an initial startcat 

</body>
</html>