[LyX/master] DocBook: start implementing LilyPond.

Thibaut Cuvelier tcuvelier at lyx.org
Mon Sep 20 23:00:20 UTC 2021


commit 14ed5b205021f57140dcfb603c4869edc352b60a
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Sep 20 03:19:20 2021 +0200

    DocBook: start implementing LilyPond.
    
    All the changes that can be achieved without C++ code changes.
---
 lib/examples/Modules/LilyPond_Book.lyx |   10 +++++++---
 lib/layouts/lilypond.module            |    5 +++++
 src/output_docbook.cpp                 |    2 +-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lib/examples/Modules/LilyPond_Book.lyx b/lib/examples/Modules/LilyPond_Book.lyx
index 05ee970..9e65968 100644
--- a/lib/examples/Modules/LilyPond_Book.lyx
+++ b/lib/examples/Modules/LilyPond_Book.lyx
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 600
+\lyxformat 608
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -21,9 +21,9 @@ lilypond
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
+\font_roman_osf false
 \font_sans_osf false
 \font_typewriter_osf false
-\font_roman_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
 \use_microtype false
@@ -90,12 +90,16 @@ lilypond
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
+\tablestyle default
 \tracking_changes false
-\postpone_fragile_content false
 \output_changes false
+\change_bars false
+\postpone_fragile_content false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
+\docbook_table_output 0
+\docbook_mathml_prefix 1
 \end_header
 
 \begin_body
diff --git a/lib/layouts/lilypond.module b/lib/layouts/lilypond.module
index 5df45f6..b4978bd 100644
--- a/lib/layouts/lilypond.module
+++ b/lib/layouts/lilypond.module
@@ -46,4 +46,9 @@ InsetLayout "Flex:LilyPond"
 	    Color             foreground
 	  EndFont
 	EndArgument
+    DocBookNotInPara      true
+    DocBookWrapperTag     mediaobject
+    DocBookTag            textobject
+    DocBookInnerTag       programlisting
+    DocBookInnerAttr      "language='lilypond' role='fragment verbatim staffsize=16 ragged-right relative=2'"
 End
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 582fab0..114c258 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -343,7 +343,7 @@ void makeParagraph(
 	// We do not really want to wrap that whole thing in a <div>...</div>.
 	bool special_case = false;
 	Inset const *specinset = par->size() == 1 ? par->getInset(0) : nullptr;
-	if (specinset && !specinset->getLayout().htmlisblock()) { // TODO: Convert htmlisblock to a DocBook parameter?
+	if (specinset && !specinset->getLayout().htmlisblock()) { // TODO: Convert htmlisblock to a DocBook parameter? docbooknotinpara should be enough in most cases.
 		Layout const &style = par->layout();
 		FontInfo const first_font = style.labeltype == LABEL_MANUAL ?
 									style.labelfont : style.font;


More information about the lyx-cvs mailing list