Introduction
Introduction 1
Introduction 2
Introduction 3
Introduction 3
Publican began life as an internal tool used by Red Hat's Documentation Group (now known as Engineering Content Services). On occasion, this legacy is visible.
Design
Publican is a publication system, not just a DocBook processing tool. As well as ensuring your DocBook XML is valid, Publican works to ensure your XML is up to publishable standard.
The branding functionality allows you to create your own presentation rules and look, overriding many parts of the default style to meet your publishing needs. Choices executed in code, however, are not changeable.
Entities, for example, can be validly defined in any XML file. However, to ensure the DTD declaration is present, valid and standardized, Publican rewrites the declaration in every XML file before it builds a book or article. Consequently, all entities declared in all XML files are lost. Publican, therefore, requires you define entities in the Doc_Name.ent file (refer to Section 4.1.6. Doc_Name.ent).
As publishing workflows grow, unrestrained entity definition leads to entity duplication and other practices that cause maintenance difficulties. Consolidating entity definitions in a single, predictable place alleviates these maintenance issues and helps the automation of the build process stay robust.
Entities also present an essentially insurmountable obstacle to quality translation (refer to Section 4.1.6.1. Entities and translation). Consequently, while we are not reducing the Doc_Name.ent file's functionality, we are no longer considering requests to add functionality or features associated with entity use.
Section III. This section is for testing the output and doesn't ship in the production docs
Section III.I. Testing BZ #1092351 Code Switcher
PerlC++
1: #!/usr/bin/perl
2: use strict;
3: use warnings;
4:
5: print "Hello, World!\n";
#include <iostream>
int main()
{
std::cout << "Hello World!"; &lies;
}
Section III.II. Testing BZ #1088051 Code Popper
1: $ apt-get search libxslt 2: gambas3-gb-xml-xslt - Gambas XSLT component 3: libidzebra-2.0-mod-alvis - IDZebra filter alvis (XSLT filter for XML) 4: libidzebra-2.0-mod-dom - IDZebra filter 'dom' (XML DOM internal document model with XSLT) 5: libical-parser-html-perl - generates HTML calendars from iCalendars 6: libxsltc-java - XSL Transformations (XSLT) compiler from Xalan-Java 7: libxml-filter-xslt-perl - Perl module for XSLT as a SAX Filter 8: libxml-libxslt-perl - Perl interface to the GNOME libxslt library 9: libxslt1-dbg - XSLT 1.0 processing library - debugging symbols 10: libxslt1-dev - XSLT 1.0 processing library - development kit 11: libxslt1.1 - XSLT 1.0 processing library - runtime library 12: python-libxslt1 - Python bindings for libxslt1 13: python-libxslt1-dbg - Python bindings for libxslt1 (debug extension) 14: python-lxml - pythonic binding for the libxml2 and libxslt libraries 15: python-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension) 16: python-lxml-doc - pythonic binding for the libxml2 and libxslt libraries (documentation) 17: python3-lxml - pythonic binding for the libxml2 and libxslt libraries 18: python3-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension) 19: php5-xsl - XSL module for php5 20: libsp-gxmlcpp-dev - S+P C++ wrapper for Gnome libxml2/libxslt 21: libsp-gxmlcpp1 - S+P C++ wrapper for Gnome libxml2/libxslt 22: swfmill - xml2swf and swf2xml processor 23: libxslthl-java - XSLT syntax highlighting
Section III.III. Testing BZ #1112899 Callouts and BZ #1101050 Entities in CDATA
Test a programlisting with a calloutlist
"Hello world!" in C++
#include <qpid/messaging/Connection.h>
#include <qpid/messaging/Message.h>
#include <qpid/messaging/Receiver.h>
#include <qpid/messaging/Sender.h>
#include <qpid/messaging/Session.h> &BZ1101050;
#include <iostream>
using namespace qpid::messaging;
int main(int argc, char** argv) {
std::string broker = argc > 1 ? argv[1] : "localhost:5672";
std::string address = argc > 2 ? argv[2] : "amq.topic";
Connection connection(broker);
try {
connection.open(); 1
Session session = connection.createSession(); 2
Receiver receiver = session.createReceiver(address); 3
Sender sender = session.createSender(address); 4
sender.send(Message("Hello world!"));
Message message = receiver.fetch(Duration::SECOND * 1); 5
std::cout << message.getContent() << std::endl;
session.acknowledge(); 6
connection.close(); 7
return 0;
} catch(const std::exception& error) {
std::cerr << error.what() << std::endl;
connection.close();
return 1;
}
}
- 1
-
Establishes the connection with the messaging broker.
- 2
-
Creates a session object, which maintains the state of all interactions with the messaging broker, and manages senders and receivers.
- 3
-
Creates a receiver that reads from the given address.
- 4
-
Creates a sender that sends to the given address.
- 5
-
Reads the next message. The duration is optional, if omitted, will wait indefinitely for the next message.
- 6
-
Acknowledges messages that have been read. To guarantee delivery, a message remains on the messaging broker until it is acknowledged by a client. session.acknowledge() acknowledges all unacknowledged messages for the given session—this allows acknowledgements to be batched, which is more efficient than acknowledging messages individually.
- 7
-
Closes the connection, all sessions managed by the connection, and all senders and receivers managed by each session.
And now we test a programlistingco with an areaspec
Section III.IV. Testing BZ #752021 Cross-Browser embed external video
Section III.V. Testing BZ #1110611 A line break is automatically inserted after cdata in code.
Is there a newline inserted after this CDATA?
Section III.VI. Testing BZ #1117561 CDATA tags
=, >, >=, <, <=, <>
!=
<>
Section III.VII. Testing BZ #1135827 Single line comment being highlighted in a callout.
package com.sample;
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.WorkItemManager;
public class NotificationWorkItemHandler implements WorkItemHandler {
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
String from = (String) workItem.getParameter("From");
String to = (String) workItem.getParameter("To");
String message = (String) workItem.getParameter("Message");
String priority = (String) workItem.getParameter("Priority");
// send email
EmailService service = ServiceRegistry.getInstance().getEmailService();
service.sendEmail(from, to, "Notification", message);1
// notify manager that work item has been completed
manager.completeWorkItem(workItem.getId(), null);
}2
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
// Do nothing, notifications cannot be aborted
}
}