+2001-10-23 José Matos <jamatos@fep.up.pt>
+
+ * LaTeXFeatures.h:
+ * LaTeXFeatures.C (getLyXSGMLEntities): new function to get the name
+ of the lyx defined sgml entities used in a docbook/linuxdoc document.
+
+ * buffer.C (makeLinuxDocFile):
+ (makeDocBookFile): reworked the preamble, more clean, and with
+ support for lyx defined entities. Changed the document declaration
+ to be more XML friendly.
+
+ * tabular.C (DocBook): removed / terminator to be more SGML friendly,
+ if we need to output XML that should be done with a filter.
+
2001-10-22 Juergen Vigna <jug@sad.it>
* sp_pspell.h (class PSpell): add alive function needed in the
}
+string const LaTeXFeatures::getLyXSGMLEntities() const
+{
+ // Definition of entities used in the document that are LyX related.
+ ostringstream entities;
+
+ if (lyxarrow) {
+ entities << "<!ENTITY lyxarrow \"->\">"
+ << '\n';
+ }
+
+ return entities.str().c_str();
+}
+
+
string const LaTeXFeatures::getIncludedFiles(string const & fname) const
{
ostringstream sgmlpreamble;
string const getMacros() const;
/// The definitions needed by the document's textclass
string const getTClassPreamble() const;
+ /// The sgml definitions needed by the document (dobook/linuxdoc)
+ string const getLyXSGMLEntities() const;
///
string const getIncludedFiles(string const & fname) const;
///
string top_element = textclasslist.LatexnameOfClass(params.textclass);
if (!body_only) {
- string sgml_includedfiles=features.getIncludedFiles(fname);
+ ofs << "<!doctype linuxdoc system";
- if (params.preamble.empty() && sgml_includedfiles.empty()) {
- ofs << "<!doctype linuxdoc system>\n\n";
- } else {
- ofs << "<!doctype linuxdoc system [ "
- << params.preamble << sgml_includedfiles << " \n]>\n\n";
+ string preamble = params.preamble;
+ preamble += features.getIncludedFiles(fname);
+ preamble += features.getLyXSGMLEntities();
+
+ if (!preamble.empty()) {
+ ofs << " [ " << preamble << " ]";
}
+ ofs << ">\n\n";
if (params.options.empty())
sgmlOpenTag(ofs, 0, top_element);
string top_element = textclasslist.LatexnameOfClass(params.textclass);
if (!only_body) {
- string sgml_includedfiles = features.getIncludedFiles(fname);
+ ofs << "<!DOCTYPE " << top_element
+ << " PUBLIC \"-//OASIS//DTD DocBook V3.1//EN\"";
- ofs << "<!doctype " << top_element
- << " public \"-//OASIS//DTD DocBook V3.1//EN\"";
+ string preamble = params.preamble;
+ preamble += features.getIncludedFiles(fname);
+ preamble += features.getLyXSGMLEntities();
- if (params.preamble.empty() && sgml_includedfiles.empty())
- ofs << ">\n\n";
- else
- ofs << "\n [ " << params.preamble
- << sgml_includedfiles << " \n]>\n\n";
+ if (!preamble.empty()) {
+ ofs << "\n [ " << preamble << " ]";
+ }
+ ofs << ">\n\n";
}
string top = top_element;
+2001-10-23 José Matos <jamatos@fep.up.pt>
+
+ * insetref.C (docbook): removed / terminator to conform SGML.
+
+ * insetspecialchar.C (linuxdoc):
+ (docbook): Added support for special chars, more than ascii export.
+
2001-10-22 Juergen Vigna <jug@sad.it>
* insettext.C (checkInsertChar): added for REALLY checking the
int InsetRef::docbook(Buffer const *, ostream & os) const
{
if (getOptions().empty()) {
- os << "<xref linkend=\"" << getContents() << "\"/>";
+ os << "<xref linkend=\"" << getContents() << "\">";
} else {
os << "<link linkend=\"" << getContents()
<< "\">" << getOptions() << "</link>";
int InsetSpecialChar::linuxdoc(Buffer const * buf, ostream & os) const
{
- return ascii(buf, os, 0);
+ switch (kind_) {
+ case HYPHENATION:
+ case LIGATURE_BREAK:
+ break;
+ case END_OF_SENTENCE:
+ os << ".";
+ break;
+ case LDOTS:
+ os << "...";
+ break;
+ case MENU_SEPARATOR:
+ os << "&lyxarrow;";
+ break;
+ case PROTECTED_SEPARATOR:
+ os << " ";
+ break;
+ }
+ return 0;
}
int InsetSpecialChar::docbook(Buffer const * buf, ostream & os) const
{
- return ascii(buf, os, 0);
+ switch (kind_) {
+ case HYPHENATION:
+ case LIGATURE_BREAK:
+ break;
+ case END_OF_SENTENCE:
+ os << ".";
+ break;
+ case LDOTS:
+ os << "...";
+ break;
+ case MENU_SEPARATOR:
+ os << "&lyxarrow;";
+ break;
+ case PROTECTED_SEPARATOR:
+ os << " ";
+ break;
+ }
+ return 0;
}
os << "center";
break;
}
- os << "\"/>\n";
+ os << "\">\n";
++ret;
}