minibar: documentation fixes

This commit is contained in:
hallgren
2011-08-21 21:35:14 +00:00
parent 6c8c0cdc24
commit f19c496b83
2 changed files with 22 additions and 7 deletions

View File

@@ -19,6 +19,21 @@ dl.apiexamples>dd { white-space: pre; }
div.modtime { float: right; }
.modtime { color: #666; white-space: nowrap; }
@media projection {
div.intro { display: none; }
body {
font-size: 150%;
}
h2 { page-break-before: always; }
dl.apiexamples dd {
page-break-after: always;
/*border-style: none;*/
}
}
</style>
<body>
@@ -102,16 +117,16 @@ full API.
...
]
<dt class=js><em>// Parse a string</em>
<br>server.parse({from:"FoodEng",input:"that pizza is very boring"},callback)
<br>server.parse({from:"FoodsEng",input:"that pizza is very boring"},callback)
<dt>http://localhost:41296/grammars/Foods.pgf?command=parse&input=that+pizza+is+very+boring&from=FoodsEng
<dd>[{"from":"FoodsEng",
"brackets":{"cat":"Comment","fid":10,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"cat":"Quality","fid":9,"index":0,"children":[{"token":"very"},{"cat":"Quality","fid":8,"index":0,"children":[{"token":"boring"}]}]}]},
"trees":["Pred (That Pizza) (Very Boring)"]}]
<dt class=js><em>// Translate to all available languages</em>
<br>server.translate({from:"FoodEng",input:"that pizza is very boring"},callback)
<br>server.translate({from:"FoodsEng",input:"that pizza is very boring"},callback)
<dd>...
<dt class=js><em>// Translate to one language</em>
<br>server.translate({input:"that pizza is very boring", from:"FoodEng", to:"FoodSwe"}, callback)
<br>server.translate({input:"that pizza is very boring", from:"FoodsEng", to:"FoodsSwe"}, callback)
<dt>http://localhost:41296/grammars/Foods.pgf?command=translate&input=that+pizza+is+very+boring&from=FoodsEng&to=FoodsSwe
<dd>[{"from":"FoodsEng",
"brackets":{"cat":"Comment","fid":10,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"cat":"Quality","fid":9,"index":0,"children":[{"token":"very"},{"cat":"Quality","fid":8,"index":0,"children":[{"token":"boring"}]}]}]},
@@ -121,7 +136,7 @@ full API.
[{"to":"FoodsSwe",
"text":"den där pizzan är mycket tråkig"}]}]}]
<dt class=js><em>// Get completions (what words could come next)</em>
<br>server.complete({from:"FoodEng",input:"that pizza is very "},callback)
<br>server.complete({from:"FoodsEng",input:"that pizza is very "},callback)
<dt>http://localhost:41296/grammars/Foods.pgf?command=complete&input=that+pizza+is+very+&from=FoodsEng
<dd>[{"from":"FoodsEng",
"brackets":{"cat":"_","fid":0,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"token":"very"}]},
@@ -130,7 +145,7 @@ full API.
</dl>
<hr>
<div class=modtime><small>
<!-- hhmts start --> Last modified: Wed Aug 3 17:19:59 CEST 2011 <!-- hhmts end -->
<!-- hhmts start --> Last modified: Sun Aug 21 10:52:43 CEST 2011 <!-- hhmts end -->
</small></div>
<address><a href="http://www.cse.chalmers.se/~hallgren/">TH</a></address>

View File

@@ -140,7 +140,7 @@ HTML file, you would normally include at least the following:
<ul>
<li><code>translations.clear()</code> is called when there no entered
text.
<li><code>translations.translateFrom({from:<var>conc</var>,input:<var>string</code>})</code>
<li><code>translations.translateFrom({from:<var>conc</var>,input:<var>string</var>})</code>
is called when the user has entered some text. The <code>from</code>
property is the name of the concrete syntax and the <code>input</code>
property is the entered text.
@@ -226,7 +226,7 @@ should add to the user interface:
<hr>
<div class=modtime>
<small class=modtime>
HTML <!-- hhmts start --> Last modified: Thu Aug 11 17:14:37 CEST 2011 <!-- hhmts end -->
HTML <!-- hhmts start --> Last modified: Sun Aug 21 19:11:35 CEST 2011 <!-- hhmts end -->
</small>
</div>