[LyX/master] DocBook: implement svglobal.

Thibaut Cuvelier tcuvelier at lyx.org
Mon Nov 16 18:46:12 UTC 2020


commit c6fe1fbe5fbf93cfdef73d52423d61fb72047d88
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Nov 16 20:15:34 2020 +0100

    DocBook: implement svglobal.
---
 development/autotests/invertedTests  |    4 +++-
 development/autotests/suspendedTests |   10 +++++++++-
 lib/layouts/svcommon.inc             |    7 ++++++-
 lib/layouts/svglobal.layout          |   15 +++++++++++++++
 lib/layouts/svglobal3.layout         |   14 ++++++++++++++
 src/output_docbook.cpp               |    7 ++++---
 6 files changed, 51 insertions(+), 6 deletions(-)

diff --git a/development/autotests/invertedTests b/development/autotests/invertedTests
index dbed9eb..5525296 100644
--- a/development/autotests/invertedTests
+++ b/development/autotests/invertedTests
@@ -460,7 +460,7 @@ export/export/docbook/Hollywood_docbook5
 export/templates/Letters/French_Letter_%28lettre%29_docbook5
 #   - Letter, elements at the end of the document that should be in <info>.
 export/templates/Letters/Letter_%28Standard_Class%29_docbook5
-#   - G-Brief: too far from the other classes.
+#   - G-Brief: too far from the other classes, not implemented.
 export/templates/Letters/G-Brief_%28V._2%29_docbook5
 export/templates/Obsolete/G-Brief_%28V._1,_Obsolete%29/.*_docbook5
 #   - KOMA-Script Letter: too hard to output phone and fax numbers at the right place (need two levels of wrapping).
@@ -514,6 +514,8 @@ export/examples/Modules/Variable-width_Minipages_docbook5
 export/examples/(es|fr)/Modules/Linguistics_docbook5
 # - Inlines in inlines (<code> within <personname>), double sidebar.
 export/examples/ko/cjk-ko-doc_docbook5
+# - Metadata in abstract paragraph.
+export/templates/Articles/Springers_Global_Journal_Template_%28V._3%29_docbook5
 
 Sublabel: docbook poster
 # Posters cannot be properly exported, the LyX documents are too far from
diff --git a/development/autotests/suspendedTests b/development/autotests/suspendedTests
index b162a4f..6d6e619 100644
--- a/development/autotests/suspendedTests
+++ b/development/autotests/suspendedTests
@@ -1,5 +1,5 @@
 # Regular expressions for tests that are most likely "wontfix" 
-# or "sep" (someone elses problem)
+# or "sep" (someone else's problem)
 #
 # Tests matching here AND in "invertedTests" get the label "suspended"
 # and the test-feature 'inverted', i.e. they are reported as failing if 
@@ -23,3 +23,11 @@ export/examples/(|fr/)Presentations/Foils_pdf[45]_systemF
 # Files in the attic are kept for reference and conversion tests.
 # Failures are usually due to new package versions and "wontfix".
 .*/attic/(eu|id|it|pl|sk)_.*
+
+# DocBook export is still work-in-progress for many layouts: the output
+# is already viable, but not yet valid.
+export/(templates|examples)/Scripts/Hollywood_docbook5
+export/export/docbook/Hollywood_docbook5
+export/templates/Letters/French_Letter_%28lettre%29_docbook5
+export/templates/Letters/Letter_%28Standard_Class%29_docbook5
+export/templates/Articles/Springers_Global_Journal_Template_%28V._3%29_docbook5
diff --git a/lib/layouts/svcommon.inc b/lib/layouts/svcommon.inc
index c565352..7612d77 100644
--- a/lib/layouts/svcommon.inc
+++ b/lib/layouts/svcommon.inc
@@ -446,7 +446,12 @@ Style Running_Author
 	CopyStyle	Running_Title
 	LatexName	authorrunning
 	LabelString	"Running author:"
-	DocBookTag  NONE # Still TODO
+	DocBookTag            personname
+	DocBookTagType        paragraph
+	DocBookWrapperTag     author
+	DocBookWrapperAttr    role='abbrev'
+	DocBookWrapperTagType block
+	DocBookInInfo         always
 End
 
 Style Running_Chapter
diff --git a/lib/layouts/svglobal.layout b/lib/layouts/svglobal.layout
index 9c48a99..4cc8caa 100644
--- a/lib/layouts/svglobal.layout
+++ b/lib/layouts/svglobal.layout
@@ -116,6 +116,10 @@ InsetLayout Flex:Keywords
 	  Color		green
 	  Size		Small
 	EndFont
+	DocBookTag         keyword
+	DocBookTagType     paragraph
+	DocBookWrapperTag  keywordset
+	DocBookInInfo      always
 End
 
 
@@ -141,6 +145,12 @@ Style Offprints
 	LatexName	offprints
 	LeftMargin	"Offprints:xx."
 	LabelString	"Offprints:"
+	DocBookTag            personname
+	DocBookTagType        paragraph
+	DocBookWrapperTag     author
+	DocBookWrapperAttr    role='offprint'
+	DocBookWrapperTagType inline
+	DocBookInInfo         always
 End
 
 
@@ -163,4 +173,9 @@ Style Abstract
 	LabelFont
 	  Series	Bold
 	EndFont
+	DocBookAbstract       true
+	DocBookInInfo         always
+	DocBookWrapperTag     abstract
+	DocBookWrapperMergeWithPrevious    true
+	DocBookTag            para
 End
diff --git a/lib/layouts/svglobal3.layout b/lib/layouts/svglobal3.layout
index 558ebb8..c65c2a7 100644
--- a/lib/layouts/svglobal3.layout
+++ b/lib/layouts/svglobal3.layout
@@ -62,12 +62,21 @@ InsetLayout Flex:Keywords
 	  Color		green
 	  Size		Small
 	EndFont
+	DocBookTag         keyword
+	DocBookTagType     paragraph
+	DocBookWrapperTag  keywordset
+	DocBookInInfo      always
 End
 
 InsetLayout Flex:PACS
 	CopyStyle	Flex:Keywords
 	LatexName	PACS
 	LabelString	"PACS"
+	DocBookTag          subject
+	DocBookTagType      paragraph
+	DocBookWrapperTag   subjectset
+	DocBookWrapperAttr  role='pacs'
+	DocBookInInfo       always
 End
 
 InsetLayout Flex:Subclass
@@ -80,6 +89,11 @@ InsetLayout Flex:CRSC
 	CopyStyle	Flex:PACS
 	LatexName	CRclass
 	LabelString	"CR Subject Classification"
+	DocBookTag          subject
+	DocBookTagType      paragraph
+	DocBookWrapperTag   subjectset
+	DocBookWrapperAttr  role='crsc'
+	DocBookInInfo       always
 End
 
 # this label has no dot at the end
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index ae65aed..fad0658 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -452,9 +452,10 @@ void makeParagraph(
 	size_t nInsets = std::distance(par->insetList().begin(), par->insetList().end());
 	auto parSize = (size_t) par->size();
 
-	auto isLyxCodeToIgnore = [](InsetCode x) { return x == TOC_CODE; }; // If this LyX code does not produce any output,
-	// it can be safely ignored in the following checks: if this thing is present in the paragraph, it has no impact
-	// on the definition of the special case (i.e. whether or not a <para> tag should be output).
+	// If this LyX code does not produce any output, it can be safely ignored in the following checks: if this thing
+	// is present in the paragraph, it has no impact on the definition of the special case (i.e. whether or not
+	// a <para> tag should be output).
+	auto isLyxCodeToIgnore = [](InsetCode x) { return x == TOC_CODE || x == NOTE_CODE; };
 
 	// TODO: if a paragraph *only* contains floats, listings, bibliographies, etc., should this be considered as a
 	//  special case? If so, the code could be largely simplifies (all the calls to all_of, basically) and optimised


More information about the lyx-cvs mailing list