nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: intro `prompt`, basic Apache 2.0 service to display a prompt
[nit.git]
/
src
/
examples
/
nitlight_as_a_service.nit
diff --git
a/src/examples/nitlight_as_a_service.nit
b/src/examples/nitlight_as_a_service.nit
index
88e1b94
..
da179be
100644
(file)
--- a/
src/examples/nitlight_as_a_service.nit
+++ b/
src/examples/nitlight_as_a_service.nit
@@
-18,13
+18,13
@@
module nitlight_as_a_service is example
import frontend
module nitlight_as_a_service is example
import frontend
-import highlight
+import htmlight
import nitcorn
import nitcorn::log
import template
import json::serialization_write
import nitcorn
import nitcorn::log
import template
import json::serialization_write
-# Nitcorn service to hightlight code
+# Nitcorn service to highlight code
#
# It's a single stand-alone page that has to form to itself.
class HighlightAction
#
# It's a single stand-alone page that has to form to itself.
class HighlightAction
@@
-32,13
+32,13
@@
class HighlightAction
redef fun answer(http_request, turi)
do
redef fun answer(http_request, turi)
do
- var hl = new HighlightVisitor
+ var hl = new HtmlightVisitor
var page = new Template
# There is code? Process it
var code = http_request.post_args.get_or_null("code")
var hlcode = null
var page = new Template
# There is code? Process it
var code = http_request.post_args.get_or_null("code")
var hlcode = null
- if code != null then hlcode = hightlightcode(hl, code)
+ if code != null then hlcode = hl.highlightcode(code)
if http_request.post_args.get_or_null("json") == "true" and hlcode != null then
var response = new HttpResponse(200)
if http_request.post_args.get_or_null("json") == "true" and hlcode != null then
var response = new HttpResponse(200)