_stream.printf ("</h%d>", element.level);
}
- public override void visit_highlighted (Highlighted element) {
- string tag = null;
- switch (element.style) {
- case Highlighted.Style.BOLD:
- tag = "b";
- break;
- case Highlighted.Style.ITALIC:
- tag = "i";
- break;
- case Highlighted.Style.UNDERLINED:
- tag = "u";
- break;
- case Highlighted.Style.MONOSPACED:
- tag = "code";
- break;
- case Highlighted.Style.STROKE:
- tag = "stroke";
- break;
- }
- if (tag != null) {
- _stream.printf ("<%s>", tag);
- }
- element.accept_children (this);
- if (tag != null) {
- _stream.printf ("</%s>", tag);
- }
- }
-
public override void visit_link (Link element) {
var label = element.label;
_stream.printf ("<a href=\"%s\">%s</a>",
_stream.printf ("</p>");
}
+ public override void visit_run (Run element) {
+ string tag = null;
+ switch (element.style) {
+ case Run.Style.BOLD:
+ tag = "b";
+ break;
+ case Run.Style.ITALIC:
+ tag = "i";
+ break;
+ case Run.Style.UNDERLINED:
+ tag = "u";
+ break;
+ case Run.Style.MONOSPACED:
+ tag = "code";
+ break;
+ case Run.Style.STROKE:
+ tag = "stroke";
+ break;
+ }
+ if (tag != null) {
+ _stream.printf ("<%s>", tag);
+ }
+ element.accept_children (this);
+ if (tag != null) {
+ _stream.printf ("</%s>", tag);
+ }
+ }
+
public override void visit_source_code (SourceCode element) {
_stream.printf ("<pre>");
_stream.printf (element.code);
content/contentvisitor.vala \
content/embedded.vala \
content/headline.vala \
- content/highlighted.vala \
content/inline.vala \
content/inlinetaglet.vala \
content/inlinecontent.vala \
content/page.vala \
content/paragraph.vala \
content/resourcelocator.vala \
+ content/run.vala \
content/sourcecode.vala \
content/styleattributes.vala \
content/symbollink.vala \
return (Headline) configure (new Headline ());
}
- public Highlighted create_highlighted (Highlighted.Style style) {
- return (Highlighted) configure (new Highlighted (style));
- }
-
public Link create_link () {
return (Link) configure (new Link ());
}
return (Paragraph) configure (new Paragraph ());
}
+ public Run create_run (Run.Style style) {
+ return (Run) configure (new Run (style));
+ }
+
public SourceCode create_source_code () {
return (SourceCode) configure (new SourceCode ());
}
public virtual void visit_headline (Headline element) {
}
- public virtual void visit_highlighted (Highlighted element) {
- }
-
public virtual void visit_link (Link element) {
}
public virtual void visit_page (Page element) {
}
+ public virtual void visit_run (Run element) {
+ }
+
public virtual void visit_source_code (SourceCode element) {
}
-/* highlighted.vala
+/* run.vala
*
* Valadoc - a documentation tool for vala.
* Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois
using GLib;
using Gee;
-public class Valadoc.Content.Highlighted : InlineContent, Inline {
+public class Valadoc.Content.Run : InlineContent, Inline {
public enum Style {
NONE,
BOLD,
ITALIC,
UNDERLINED,
MONOSPACED,
- STROKE
+ STROKE,
+ LANG_KEYWORD,
+ LANG_LITERAL,
+ LANG_TYPE
}
public Style style { get; set; }
- internal Highlighted (Style style) {
+ internal Run (Style style) {
base ();
_style = style;
}
}
public override void accept (ContentVisitor visitor) {
- visitor.visit_highlighted (this);
+ visitor.visit_run (this);
}
}
Rule bold =
Rule.seq ({ TokenType.SINGLE_QUOTE_2, run, TokenType.SINGLE_QUOTE_2 })
.set_name ("Bold")
- .set_start (() => { push (_factory.create_highlighted (Highlighted.Style.BOLD)); });
+ .set_start (() => { push (_factory.create_run (Run.Style.BOLD)); });
Rule italic =
Rule.seq ({ TokenType.SLASH_2, run, TokenType.SLASH_2 })
.set_name ("Italic")
- .set_start (() => { push (_factory.create_highlighted (Highlighted.Style.ITALIC)); });
+ .set_start (() => { push (_factory.create_run (Run.Style.ITALIC)); });
Rule underlined =
Rule.seq ({ TokenType.UNDERSCORE_2, run, TokenType.UNDERSCORE_2 })
.set_name ("Underlined")
- .set_start (() => { push (_factory.create_highlighted (Highlighted.Style.UNDERLINED)); });
+ .set_start (() => { push (_factory.create_run (Run.Style.UNDERLINED)); });
Rule monospace =
Rule.seq ({ TokenType.BACK_QUOTE, run, TokenType.BACK_QUOTE })
.set_name ("Monospace")
- .set_start (() => { push (_factory.create_highlighted (Highlighted.Style.MONOSPACED)); });
+ .set_start (() => { push (_factory.create_run (Run.Style.MONOSPACED)); });
Rule embedded =
Rule.seq ({
if (_inherited != null) {
Paragraph inherited_paragraph = _inherited.documentation.content.get (0) as Paragraph;
- Highlighted paragraph = new Highlighted (Highlighted.Style.NONE);
+ Run paragraph = new Run (Run.Style.NONE);
foreach (var element in inherited_paragraph.content) {
paragraph.content.add (element);
}