use of org.eclipse.mylyn.wikitext.util.XmlStreamWriter in project mylyn.docs by eclipse.
the class MarkupToEclipseToc method createToc.
public String createToc(OutlineItem root) {
StringWriter out = new StringWriter(8096);
XmlStreamWriter writer = createXmlStreamWriter(out);
// $NON-NLS-1$ //$NON-NLS-2$
writer.writeStartDocument("utf-8", "1.0");
if (copyrightNotice != null) {
writer.writeComment(copyrightNotice);
}
// $NON-NLS-1$
writer.writeStartElement("toc");
// $NON-NLS-1$
writer.writeAttribute("topic", adjustForPrefix(getHtmlFile()));
// $NON-NLS-1$
writer.writeAttribute("label", getBookTitle());
emitToc(writer, root.getChildren());
if (anchorLevel >= 0) {
// $NON-NLS-1$
writer.writeEmptyElement("anchor");
// $NON-NLS-1$ //$NON-NLS-2$
writer.writeAttribute("id", "additions");
}
// toc
writer.writeEndElement();
writer.writeEndDocument();
writer.close();
return out.toString();
}
use of org.eclipse.mylyn.wikitext.util.XmlStreamWriter in project statecharts by Yakindu.
the class HubspotDocumentBuilder method endHeading.
@Override
public void endHeading() {
if (!isEarlySeparator) {
headings.add(currentHeading);
isProcessingHeading = false;
/* Write the permalink: */
final XmlStreamWriter w = super.getWriter();
w.writeStartElement("a");
w.writeAttribute("href", '#' + currentHeading.getId());
w.writeAttribute("class", "permalink");
w.writeAttribute("title", "Permalink to \"" + currentHeading.getTitle() + "\"");
w.writeAttribute("onclick", "copyPermalinkToClipboard(event, this);");
w.writeStartElement("span");
w.writeAttribute("class", "tooltip");
w.writeCharacters("Copy link to clipboard");
// span
w.writeEndElement();
// a
w.writeEndElement();
super.endHeading();
}
}
Aggregations