X-Git-Url: http://nitlanguage.org diff --git a/src/highlight.nit b/src/highlight.nit index 5430321..cd400bd 100644 --- a/src/highlight.nit +++ b/src/highlight.nit @@ -167,9 +167,9 @@ class HighlightVisitor return """ .nitcode a { color: inherit; cursor:pointer; } .nitcode .popupable:hover { text-decoration: underline; cursor:help; } /* underline titles */ -.nitcode .foldable { display: block } /* for block productions*/ -.nitcode .line{ display: block } /* for lines */ -.nitcode .line:hover{ background-color: #FFFFE0; } /* current line */ +pre.nitcode .foldable { display: block } /* for block productions*/ +pre.nitcode .line{ display: block } /* for lines */ +pre.nitcode .line:hover{ background-color: #FFFFE0; } /* current line */ .nitcode :target { background-color: #FFF3C2 } /* target highlight*/ /* lexical raw tokens. independent of usage or semantic: */ .nitcode .nc_c { color: gray; font-style: italic; } /* comment */ @@ -200,6 +200,22 @@ class HighlightVisitor .popover { max-width: 800px !important; } """ end + + # Additional content to inject in the tag + # Note: does not include `css_content`; handle it yourself. + fun head_content: String + do + return """\n""" + end + + # Additional content to inject just before the closing tag + fun foot_content: String + do + return """ + + +""" + end end redef class HTMLTag @@ -650,9 +666,9 @@ end redef class AVarFormExpr redef fun decorate_tag(v, res, token) do - res.add_class("nc_v") var variable = self.variable if variable == null then return null + res.add_class("nc_v") return variable.infobox(v) end end @@ -660,9 +676,9 @@ end redef class AVardeclExpr redef fun decorate_tag(v, res, token) do - res.add_class("nc_v") var variable = self.variable if variable == null then return null + res.add_class("nc_v") return variable.infobox(v) end end @@ -671,9 +687,9 @@ redef class AForExpr redef fun decorate_tag(v, res, token) do if not token isa TId then return null - res.add_class("nc_v") var vs = variables if vs == null then return null + res.add_class("nc_v") var idx = n_ids.index_of(token) var variable = vs[idx] return variable.infobox(v) @@ -683,11 +699,11 @@ end redef class AParam redef fun decorate_tag(v, res, token) do - res.add_class("nc_v") var mp = mparameter if mp == null then return null var variable = self.variable if variable == null then return null + res.add_class("nc_v") return variable.infobox(v) end end