Commit Graph

137 Commits

Author SHA1 Message Date
Thibaut Cuvelier
d1b9af3b1d DocBook: fix file inclusion.
Previously, nothing was output. Special care was needed for when new paragraphs should be open (this work is probably not finished yet).
2020-10-20 02:34:02 +02:00
Thibaut Cuvelier
7be7026386 DocBook: generalise detection of "special cases" to check all insets of a paragraph.
This will catch cases where there are multiple listings in a single paragraph, for instance.

The new code is also less brittle (checks on lyxCode instead of generated LaTeX or names).
2020-10-18 08:23:37 +02:00
Thibaut Cuvelier
739735ab73 DocBook: output inline equations in their own paragraph if they are the only inset of the paragraph.
It's invalid to have an <inlineequation> outside a paragraph. Another solution would have been to change InsetMathHull::docbook to generate an <informalequation>, but that function would have required more knowledge about its context than now.

Need more tests to determine if <inlineequation> should only be output for hullSimple or in more cases like:

		const static std::set<HullType> inlineHulls = {
				hullUnknown,
				hullNone,
				hullSimple,
				hullEquation,
				hullMultline,
				hullGather,
				hullRegexp
		};
2020-10-18 08:23:36 +02:00
Thibaut Cuvelier
0ba9b7c0c8 DocBook: fix an assertion/crash. 2020-10-16 17:02:24 +02:00
Thibaut Cuvelier
170866986c Amend 82ea3d6
Test was done on the wrong data structure: the title is almost the only element ending up in shouldBeInInfo, it is never inmustBeInInfo.
2020-10-16 04:30:41 +02:00
Thibaut Cuvelier
82ea3d67ec DocBook: documents must have a title. 2020-10-12 19:26:37 +02:00
Thibaut Cuvelier
0bd2978ac9 DocBook: add DocBookInnerTag and family.
This allows old DocBook documents to be valid when output.
2020-10-07 06:05:22 +02:00
Thibaut Cuvelier
bfeb3b66b1 DocBook: slight code simplification. 2020-09-19 20:43:41 +02:00
Thibaut Cuvelier
50f011e062 DocBook: implement InsetBox titles. 2020-09-19 20:43:41 +02:00
Thibaut Cuvelier
3711a38b9c DocBook: fix a crash in bibliography paragraphs. 2020-09-19 20:43:41 +02:00
Scott Kostyshak
a632a9ae3c DocBook: remove useless functions. 2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
1a76fb9658 DocBook: avoid using isspace in StartTag::writeTag.
This is the cause of crashes (on both Windows and Linux).
2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
08a58242c1 DocBook: better output with the Linguistics module.
One issue left: <table> output within an <informaltable>, that does not make sense... I'm debugging it.
2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
abed1f3e6e DocBook: fix crash with Linguistics example.
This was due to Floating::docbookTag not returning anything with the floattype_ tableau. Another issue that happened with that document is that the standard library's isspace crashed for some characters. I therefore implemented a more efficient version of the part that required it, and inlined the definition of isspace (even though that part becomes irrespective of locale, but was that feature ever used?).
2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
594a4763b7 Fix a few warnings. 2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
e3da8b65f6 DocBook: several missing features for Additional.lyx.
Includes: semantic markup (sorry about noun: Additional.lyx uses it to mark menus; there is something better in DocBook, but it looks like the LaTeX equivalent is really for person names), boxes, info layouts.
2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
19734ea454 DocBook: implement LyX-Code.
This is quite ugly.
2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
bc9d3ec262 DocBook: <person> is not valid per se, rather use <personname>.
The cleanest solution would still be <person><personname>, but this ought to be enough. Otherwise, that would imply having two tags for some fonts...
2020-09-19 20:43:40 +02:00
Thibaut Cuvelier
e995414917 DocBook: avoid generating fonts for "special cases" like equations. 2020-09-19 20:43:39 +02:00
Thibaut Cuvelier
654559feb8 DocBook: fix line issues around programlisting. 2020-09-19 20:43:39 +02:00
Thibaut Cuvelier
6688b076cc DocBook: fixes in lists.
Actually output something when list item is empty. XMLStream discarded the sequence StartTag/EndTag (nothing in between).

New-line behaviour around term in description lists.
2020-09-19 20:43:39 +02:00
Thibaut Cuvelier
5b01c80635 DocBook: fix titles in KOMA Script. 2020-09-19 20:43:39 +02:00
Thibaut Cuvelier
976bd91fc2 DocBook: bug fixing with wrapper merging. 2020-09-19 20:43:39 +02:00
Thibaut Cuvelier
ec0f4885a7 DocBook: fix bibliographies (end of <bibliography> and sections). 2020-09-19 20:43:39 +02:00
Thibaut Cuvelier
642b18aad0 DocBook: generate <partintro> when required. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
17b06f5336 DocBook: streamline code to handle sections. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
f219fe1cd7 DocBook: streamline code to handle abstracts. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
39ad6e84f0 DocBook: improve equation formatting (new lines for block equations). 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
fc2c36289b DocBook: rewrite makeListEnvironment. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
8656fbd520 DocBook: start splitting environment handling in two, to have proper things for lists. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
1bd49f9c39 DocBook: make all make* functions have the same argument order. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
fc0999a422 DocBook: partially remove use of bpit/epit in docbookParagraphs and docbookSimpleAllParagraphs.
This will help with the next refactoring to be much cleaner (only work with iterators, don't maintain twice the same information).
2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
52b2d3f683 DocBook: make Paragraph::simpleDocBookOnePar return a list of paragraphs.
Before, it directly wrote to the XMLStream, but it made implementation of new lines tricky. Now, it returns the XML for each sub-paragraph (delimited by new lines) as a string, so that the caller can adopt a more precise behaviour (such as in lists).
2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
faaf780bed DocBook: fix compilation issues. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
3d348818e0 DocBook: Coverity potential problem for precooked bibliographies. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
ac46456b28 DocBook: simplify precooked bibliography code. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
6a4d3dbef7 DocBook: remove useless includes. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
d8651cc60b More functions in anonymous namespace. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
25f72d392c DocBook: fine tuning of new lines. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
9393ca74ba DocBook: new logic to handle the new lines, only used in output_docbook for now. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
87dae26e4a Simplify code to generate only one paragraph at a time. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
dab71087cf DocBook: add a layout tag to tell whether an item is the abstract or not. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
7b0f9d9524 DocBook: simplify code to handle abstracts. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
0f145c3ef0 DocBook: use DocBookWrapperMergeWithPrevious in the code. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
72c304a629 DocBook: make openParTag/closeTag use paragraphs instead of layouts.
Not useful per se, but will be next with checking whether the wrapper tags should be opened/closed.
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
c417253d0b DocBook: use DocBookItemTag within paragraphs.
This is at least helpful for AAS, even though it slightly resembles a repurposition of that parameter.
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
1a09086ec2 Merge findLastParagraph and findLastBibliographyParagraph to lower code duplication.
Maybe these functions should move to ParagraphList.h/cpp?
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
4d78fe5957 Slight code-consistency improvements. 2020-09-19 20:43:36 +02:00
Thibaut Cuvelier
a852706bf0 DocBook: allow empty paragraphs before the <info> section. 2020-09-19 20:43:36 +02:00
Thibaut Cuvelier
348297520f Revert "DocBook: allow empty paragraphs before the <info> section."
This reverts commit c6937cece9.
2020-08-03 22:58:15 +02:00