mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
DocBook: InsetText supports items and wrappers.
This commit is contained in:
parent
2c6537ff66
commit
f426e458c4
@ -208,7 +208,7 @@ more
|
||||
|
||||
\begin_layout Standard
|
||||
Your text comes here.
|
||||
Separate text sections with
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_body
|
||||
|
@ -4,16 +4,16 @@
|
||||
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
|
||||
<info>
|
||||
<title>Title</title>
|
||||
<subjectset role='pacs'><subject>PACS code1 <!-- \and -->
|
||||
<subjectset role='pacs'><subject><subjectterm>PACS code1 <!-- \and -->
|
||||
PACS code2 <!-- \and -->
|
||||
more</subject></subjectset><subjectset role='mcs'><subject>MSC code1 <!-- \and -->
|
||||
more</subjectterm></subject></subjectset><subjectset role='mcs'><subject><subjectterm>MSC code1 <!-- \and -->
|
||||
MSC code2 <!-- \and -->
|
||||
more</subject></subjectset><keywordset><keyword>First keyword <!-- \and -->
|
||||
more</subjectterm></subject></subjectset><keywordset><keyword>First keyword <!-- \and -->
|
||||
Second keyword <!-- \and -->
|
||||
More</keyword></keywordset><abstract>
|
||||
<para>Abstract text. </para>
|
||||
</abstract>
|
||||
|
||||
</info>
|
||||
<para>Your text comes here. Separate text sections with</para>
|
||||
<para>Your text comes here. </para>
|
||||
</article>
|
@ -89,6 +89,7 @@ InsetLayout Foot
|
||||
AddToToc footnote
|
||||
IsTocCaption true
|
||||
DocBookTag footnote
|
||||
DocBookTagType inline
|
||||
End
|
||||
|
||||
InsetLayout Foot:InTitle
|
||||
|
@ -72,10 +72,14 @@ InsetLayout Flex:PACS
|
||||
CopyStyle Flex:Keywords
|
||||
LatexName PACS
|
||||
LabelString "PACS"
|
||||
DocBookTag subject
|
||||
DocBookTagType paragraph
|
||||
DocBookWrapperTag subjectset
|
||||
DocBookWrapperAttr role='pacs'
|
||||
DocBookTag subjectset
|
||||
DocBookAttr role='pacs'
|
||||
DocBookItemWrapperTag subject
|
||||
DocBookItemWrapperTagType paragraph
|
||||
DocBookItemTag subjectterm
|
||||
DocBookItemTagType inline
|
||||
DocBookWrapperTag NONE
|
||||
DocBookWrapperAttr ""
|
||||
DocBookInInfo always
|
||||
End
|
||||
|
||||
@ -83,10 +87,14 @@ InsetLayout Flex:Subclass
|
||||
CopyStyle Flex:Keywords
|
||||
LatexName subclass
|
||||
LabelString "Mathematics Subject Classification"
|
||||
DocBookTag subject
|
||||
DocBookTagType paragraph
|
||||
DocBookWrapperTag subjectset
|
||||
DocBookWrapperAttr role='mcs'
|
||||
DocBookTag subjectset
|
||||
DocBookAttr role='mcs'
|
||||
DocBookItemWrapperTag subject
|
||||
DocBookItemWrapperTagType paragraph
|
||||
DocBookItemTag subjectterm
|
||||
DocBookItemTagType inline
|
||||
DocBookWrapperTag NONE
|
||||
DocBookWrapperAttr ""
|
||||
DocBookInInfo always
|
||||
End
|
||||
|
||||
@ -94,10 +102,14 @@ InsetLayout Flex:CRSC
|
||||
CopyStyle Flex:PACS
|
||||
LatexName CRclass
|
||||
LabelString "CR Subject Classification"
|
||||
DocBookTag subject
|
||||
DocBookTagType paragraph
|
||||
DocBookWrapperTag subjectset
|
||||
DocBookWrapperAttr role='crsc'
|
||||
DocBookTag subjectset
|
||||
DocBookAttr role='crsc'
|
||||
DocBookItemWrapperTag subject
|
||||
DocBookItemWrapperTagType paragraph
|
||||
DocBookItemTag subjectterm
|
||||
DocBookItemTagType inline
|
||||
DocBookWrapperTag NONE
|
||||
DocBookWrapperAttr ""
|
||||
DocBookInInfo always
|
||||
End
|
||||
|
||||
|
@ -122,6 +122,11 @@ void InsetERT::docbook(XMLStream & xs, OutputParams const & runparams) const
|
||||
break;
|
||||
}
|
||||
|
||||
// // Implement the special case of \and: split the current item.
|
||||
// if (os.str() == "\\and" || os.str() == "\\and ") {
|
||||
// auto lay = getLayout();
|
||||
// }
|
||||
|
||||
// Output the ERT as a comment with the appropriate escaping.
|
||||
xs << XMLStream::ESCAPE_NONE << "<!-- ";
|
||||
xs << XMLStream::ESCAPE_COMMENTS << os.str();
|
||||
|
@ -98,6 +98,12 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass,
|
||||
IL_DOCBOOKWRAPPERTAG,
|
||||
IL_DOCBOOKWRAPPERTAGTYPE,
|
||||
IL_DOCBOOKWRAPPERATTR,
|
||||
IL_DOCBOOKITEMTAG,
|
||||
IL_DOCBOOKITEMTAGTYPE,
|
||||
IL_DOCBOOKITEMATTR,
|
||||
IL_DOCBOOKITEMWRAPPERTAG,
|
||||
IL_DOCBOOKITEMWRAPPERTAGTYPE,
|
||||
IL_DOCBOOKITEMWRAPPERATTR,
|
||||
IL_INTOC,
|
||||
IL_ISTOCCAPTION,
|
||||
IL_LABELFONT,
|
||||
@ -144,6 +150,12 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass,
|
||||
{ "display", IL_DISPLAY },
|
||||
{ "docbookattr", IL_DOCBOOKATTR },
|
||||
{ "docbookininfo", IL_DOCBOOKININFO },
|
||||
{ "docbookitemattr", IL_DOCBOOKITEMATTR },
|
||||
{ "docbookitemtag", IL_DOCBOOKITEMTAG },
|
||||
{ "docbookitemtagtype", IL_DOCBOOKITEMTAGTYPE },
|
||||
{ "docbookitemwrapperattr", IL_DOCBOOKITEMWRAPPERATTR },
|
||||
{ "docbookitemwrappertag", IL_DOCBOOKITEMWRAPPERTAG },
|
||||
{ "docbookitemwrappertagtype", IL_DOCBOOKITEMWRAPPERTAGTYPE },
|
||||
{ "docbooksection", IL_DOCBOOKSECTION },
|
||||
{ "docbooktag", IL_DOCBOOKTAG },
|
||||
{ "docbooktagtype", IL_DOCBOOKTAGTYPE },
|
||||
@ -505,6 +517,24 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass,
|
||||
case IL_DOCBOOKSECTION:
|
||||
lex >> docbooksection_;
|
||||
break;
|
||||
case IL_DOCBOOKITEMTAG:
|
||||
lex >> docbookitemtag_;
|
||||
break;
|
||||
case IL_DOCBOOKITEMTAGTYPE:
|
||||
lex >> docbookitemtagtype_;
|
||||
break;
|
||||
case IL_DOCBOOKITEMATTR:
|
||||
lex >> docbookitemattr_;
|
||||
break;
|
||||
case IL_DOCBOOKITEMWRAPPERTAG:
|
||||
lex >> docbookitemwrappertag_;
|
||||
break;
|
||||
case IL_DOCBOOKITEMWRAPPERTAGTYPE:
|
||||
lex >> docbookitemwrappertagtype_;
|
||||
break;
|
||||
case IL_DOCBOOKITEMWRAPPERATTR:
|
||||
lex >> docbookitemwrapperattr_;
|
||||
break;
|
||||
case IL_DOCBOOKWRAPPERTAG:
|
||||
lex >> docbookwrappertag_;
|
||||
break;
|
||||
@ -654,6 +684,38 @@ std::string const & InsetLayout::docbookininfo() const
|
||||
}
|
||||
|
||||
|
||||
std::string InsetLayout::docbooktagtype() const
|
||||
{
|
||||
if (docbooktagtype_ != "block" && docbooktagtype_ != "paragraph" && docbooktagtype_ != "inline")
|
||||
docbooktagtype_ = "block";
|
||||
return docbooktagtype_;
|
||||
}
|
||||
|
||||
|
||||
std::string InsetLayout::docbookwrappertagtype() const
|
||||
{
|
||||
if (docbookwrappertagtype_ != "block" && docbookwrappertagtype_ != "paragraph" && docbookwrappertagtype_ != "inline")
|
||||
docbookwrappertagtype_ = "block";
|
||||
return docbookwrappertagtype_;
|
||||
}
|
||||
|
||||
|
||||
std::string InsetLayout::docbookitemtagtype() const
|
||||
{
|
||||
if (docbookitemtagtype_ != "block" && docbookitemtagtype_ != "paragraph" && docbookitemtagtype_ != "inline")
|
||||
docbookitemtagtype_ = "block";
|
||||
return docbookitemtagtype_;
|
||||
}
|
||||
|
||||
|
||||
std::string InsetLayout::docbookitemwrappertagtype() const
|
||||
{
|
||||
if (docbookitemwrappertagtype_ != "block" && docbookitemwrappertagtype_ != "paragraph" && docbookitemwrappertagtype_ != "inline")
|
||||
docbookitemwrappertagtype_ = "block";
|
||||
return docbookitemwrappertagtype_;
|
||||
}
|
||||
|
||||
|
||||
void InsetLayout::readArgument(Lexer & lex)
|
||||
{
|
||||
Layout::latexarg arg;
|
||||
|
@ -150,7 +150,7 @@ public:
|
||||
///
|
||||
std::string docbooktag() const { return docbooktag_; }
|
||||
///
|
||||
std::string docbooktagtype() const { return docbooktagtype_; }
|
||||
std::string docbooktagtype() const;
|
||||
///
|
||||
std::string docbookattr() const { return docbookattr_; }
|
||||
///
|
||||
@ -160,10 +160,22 @@ public:
|
||||
///
|
||||
std::string docbookwrappertag() const { return docbookwrappertag_; }
|
||||
///
|
||||
std::string docbookwrappertagtype() const { return docbookwrappertagtype_; }
|
||||
std::string docbookwrappertagtype() const;
|
||||
///
|
||||
std::string docbookwrapperattr() const { return docbookwrapperattr_; }
|
||||
///
|
||||
std::string docbookitemwrappertag() const { return docbookitemwrappertag_; }
|
||||
///
|
||||
std::string docbookitemwrappertagtype() const;
|
||||
///
|
||||
std::string docbookitemwrapperattr() const { return docbookitemwrapperattr_; }
|
||||
///
|
||||
std::string docbookitemtag() const { return docbookitemtag_; }
|
||||
///
|
||||
std::string docbookitemtagtype() const;
|
||||
///
|
||||
std::string docbookitemattr() const { return docbookitemattr_; }
|
||||
///
|
||||
std::set<std::string> required() const { return required_; }
|
||||
///
|
||||
bool isMultiPar() const { return multipar_; }
|
||||
@ -293,7 +305,7 @@ private:
|
||||
///
|
||||
std::string docbooktag_;
|
||||
///
|
||||
std::string docbooktagtype_;
|
||||
mutable std::string docbooktagtype_;
|
||||
///
|
||||
std::string docbookattr_;
|
||||
///
|
||||
@ -303,10 +315,22 @@ private:
|
||||
///
|
||||
std::string docbookwrappertag_;
|
||||
///
|
||||
std::string docbookwrappertagtype_;
|
||||
mutable std::string docbookwrappertagtype_;
|
||||
///
|
||||
std::string docbookwrapperattr_;
|
||||
///
|
||||
std::string docbookitemtag_;
|
||||
///
|
||||
mutable std::string docbookitemtagtype_;
|
||||
///
|
||||
std::string docbookitemattr_;
|
||||
///
|
||||
std::string docbookitemwrappertag_;
|
||||
///
|
||||
mutable std::string docbookitemwrappertagtype_;
|
||||
///
|
||||
std::string docbookitemwrapperattr_;
|
||||
///
|
||||
std::set<std::string> required_;
|
||||
///
|
||||
bool multipar_ = true;
|
||||
|
@ -635,6 +635,12 @@ void InsetText::docbook(XMLStream & xs, OutputParams const & rp, XHTMLOptions op
|
||||
attrs += from_ascii(" xlink:href=\"") + text_.asString() + from_ascii("\"");
|
||||
xs << xml::StartTag(il.docbooktag(), attrs);
|
||||
}
|
||||
|
||||
if (!il.docbookitemwrappertag().empty() && il.docbookitemwrappertag() != "NONE" && il.docbookitemwrappertag() != "IGNORE")
|
||||
xs << xml::StartTag(il.docbookitemwrappertag(), il.docbookitemwrapperattr());
|
||||
|
||||
if (!il.docbookitemtag().empty() && il.docbookitemtag() != "NONE" && il.docbookitemtag() != "IGNORE")
|
||||
xs << xml::StartTag(il.docbookitemtag(), il.docbookitemattr());
|
||||
}
|
||||
|
||||
// No need for labels that are generated from counters. They should be handled by the external DocBook processor.
|
||||
@ -650,6 +656,12 @@ void InsetText::docbook(XMLStream & xs, OutputParams const & rp, XHTMLOptions op
|
||||
xs.endDivision();
|
||||
|
||||
if (opts & WriteOuterTag) {
|
||||
if (!il.docbookitemtag().empty() && il.docbookitemtag() != "NONE" && il.docbookitemtag() != "IGNORE")
|
||||
xs << xml::EndTag(il.docbookitemtag());
|
||||
|
||||
if (!il.docbookitemwrappertag().empty() && il.docbookitemwrappertag() != "NONE" && il.docbookitemwrappertag() != "IGNORE")
|
||||
xs << xml::EndTag(il.docbookitemwrappertag());
|
||||
|
||||
if (!il.docbooktag().empty() && il.docbooktag() != "NONE" && il.docbooktag() != "IGNORE")
|
||||
xs << xml::EndTag(il.docbooktag());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user