[LyX/master] Allow an 'other' type for hyperlinks. Format change.

2022-12-25 Thread Richard Kimberly Heck
commit 144cf4bb9afaa594ef61b93fdb03d34e4752f2ad
Author: Richard Kimberly Heck 
Date:   Sun Dec 25 12:42:07 2022 -0500

Allow an 'other' type for hyperlinks. Format change.

Also, perform the URL fixing magic for DocBook and XHTML.

As it was, it was impossible to enter e.g. "tel:" type links. Now
choosing the "Other" type just outputs the URL as given.

Also, the addition of "http" or "file" was not being done for
DocBook and XHTML. Now it is.
---
 development/FORMAT |3 ++
 lib/lyx2lyx/lyx_2_4.py |   39 --
 src/frontends/qt/GuiHyperlink.cpp  |   16 -
 src/frontends/qt/ui/HyperlinkUi.ui |   13 +--
 src/insets/InsetHyperlink.cpp  |   40 ++-
 src/version.h  |4 +-
 6 files changed, 90 insertions(+), 25 deletions(-)

diff --git a/development/FORMAT b/development/FORMAT
index 1003fa0..48ee924 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -7,6 +7,9 @@ changes happened in particular if possible. A good example 
would be
 
 ---
 
+2022-12-25 Richard Kimberly Heck 
+   * Format incremented to 614: New "Other" type for hyperlinks
+
 2022-12-11 Jürgen Spitzmüller  
* Format incremented to 613: Support \\fonts_default_family for non-TeX 
fonts.
 
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 520b14c..00a46e0 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -4639,7 +4639,38 @@ def revert_familydefault(document):
 
 document.header[i] = "\\font_default_family default"
 add_to_preamble(document, ["\\renewcommand{\\familydefault}{\\" + dfamily 
+ "}"])
-
+
+
+def revert_hyper_other(document):
+i = 0
+while True:
+i = find_token(document.body, "\\begin_inset CommandInset href", i)
+if i == -1:
+break
+j = find_end_of_inset(document.body, i)
+if j == -1:
+document.warning("Cannot find end of inset at line " << str(i))
+i += 1
+continue
+k = find_token(document.body, "type \"other\"", i, j)
+if k == -1:
+i = j
+continue
+# build command
+n = find_token(document.body, "name", i, j)
+t = find_token(document.body, "target", i, j)
+if n == -1 or t == -1:
+document.warning("Malformed hyperlink inset at line " + str(i))
+i = j
+continue
+name = document.body[n][6:-1]
+target = document.body[t][8:-1]
+cmd = "\href{" + target + "}{" + name + "}"
+ecmd = put_cmd_in_ert(cmd)
+document.body[i:j+1] = ecmd
+i += 1
+
+   
 ##
 # Conversion hub
 #
@@ -4714,10 +4745,12 @@ convert = [
[610, []],
[611, []],
[612, [convert_starred_refs]],
-   [613, []]
+   [613, []],
+   [614, []]
   ]
 
-revert =  [[612, [revert_familydefault]],
+revert =  [[613, [revert_hyper_other]],
+   [612, [revert_familydefault]],
[611, [revert_starred_refs]],
[610, []],
[609, [revert_index_macros]],
diff --git a/src/frontends/qt/GuiHyperlink.cpp 
b/src/frontends/qt/GuiHyperlink.cpp
index c063ca2..257a5db 100644
--- a/src/frontends/qt/GuiHyperlink.cpp
+++ b/src/frontends/qt/GuiHyperlink.cpp
@@ -17,6 +17,8 @@
 
 #include "insets/InsetHyperlink.h"
 
+#include "support/debug.h"
+
 #if defined(LYX_MERGE_FILES) && !defined(Q_CC_MSVC)
 // GCC couldn't find operator==
 namespace lyx {
@@ -48,6 +50,8 @@ GuiHyperlink::GuiHyperlink(QWidget * parent) : 
InsetParamsWidget(parent)
this, SIGNAL(changed()));
connect(fileRB, SIGNAL(clicked()),
this, SIGNAL(changed()));
+   connect(noneRB, SIGNAL(clicked()),
+   this, SIGNAL(changed()));
 
setFocusProxy(targetED);
 }
@@ -68,6 +72,10 @@ void GuiHyperlink::paramsToDialog(Inset const * inset)
emailRB->setChecked(true);
else if (type == "file:")
fileRB->setChecked(true);
+   else if (type == "other")
+   noneRB->setChecked(true);
+   else
+   LYXERR0("Unknown hyperlink type: " << type);
 }
 
 
@@ -79,10 +87,12 @@ bool GuiHyperlink::initialiseParams(std::string const & 
sdata)
targetED->setText(toqstr(params["target"]));
nameED->setText(toqstr(params["name"]));
literalCB->setChecked(params["literal"] == "true");
-   if (params["type"] == from_utf8("mailto:";))
+   if (params["type"] == "mailto:";)
emailRB->setChecked(true);
-   else if (params["type"] == from_utf8("file:"))
+   else if (params["type"] == "file:")
fileRB->setChecked(true);
+   else if (params["type"] == "other")
+   noneRB->setChecked(true);
else
webRB->setChecked(true);
retur

[LyX/master] typo

2022-12-25 Thread Richard Kimberly Heck
commit 3d2bedb160765cfd6252f6a298ac5d8fabfefbfc
Author: Richard Kimberly Heck 
Date:   Sun Dec 25 12:50:54 2022 -0500

typo
---
 src/tex2lyx/TODO.txt |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt
index 7efd943..ad1afd0 100644
--- a/src/tex2lyx/TODO.txt
+++ b/src/tex2lyx/TODO.txt
@@ -4,7 +4,7 @@ current file format are listed. The table is organized in three 
columns:
 
 
 Format:First file format that supports the feature. In some cases the
-   feature may habe been revised in later file formats.
+   feature may have been revised in later file formats.
 LaTeX feature: LaTeX package, command or environment
 LyX feature:   LyX inset or document setting
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Update tex2lyx tests.

2022-12-25 Thread Richard Kimberly Heck
commit 1413b509ac744ed4f3688eec0a84773f8d167997
Author: Richard Kimberly Heck 
Date:   Sun Dec 25 12:49:42 2022 -0500

Update tex2lyx tests.
---
 src/tex2lyx/test/CJK.lyx.lyx   |2 +-
 src/tex2lyx/test/CJKutf8.lyx.lyx   |2 +-
 src/tex2lyx/test/DummyDocument.lyx.lyx |2 +-
 src/tex2lyx/test/Dummy~Document.lyx.lyx|2 +-
 src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx |2 +-
 src/tex2lyx/test/algo2e.lyx.lyx|2 +-
 src/tex2lyx/test/beamer.lyx.lyx|2 +-
 .../test/box-color-size-space-align.lyx.lyx|2 +-
 src/tex2lyx/test/listpreamble.lyx.lyx  |2 +-
 src/tex2lyx/test/tabular-x-test.lyx.lyx|2 +-
 src/tex2lyx/test/test-insets-basic.lyx.lyx |2 +-
 src/tex2lyx/test/test-insets.lyx.lyx   |2 +-
 src/tex2lyx/test/test-memoir.lyx.lyx   |2 +-
 src/tex2lyx/test/test-minted.lyx.lyx   |2 +-
 src/tex2lyx/test/test-modules.lyx.lyx  |2 +-
 src/tex2lyx/test/test-refstyle-theorems.lyx.lyx|2 +-
 src/tex2lyx/test/test-scr.lyx.lyx  |2 +-
 src/tex2lyx/test/test-structure.lyx.lyx|2 +-
 src/tex2lyx/test/test.lyx.lyx  |2 +-
 src/tex2lyx/test/verbatim.lyx.lyx  |2 +-
 20 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx
index fa59b3f..05cca3e 100644
--- a/src/tex2lyx/test/CJK.lyx.lyx
+++ b/src/tex2lyx/test/CJK.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx
index 050689e..4c64650 100644
--- a/src/tex2lyx/test/CJKutf8.lyx.lyx
+++ b/src/tex2lyx/test/CJKutf8.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/DummyDocument.lyx.lyx 
b/src/tex2lyx/test/DummyDocument.lyx.lyx
index 8bb9ae2..447fb66 100644
--- a/src/tex2lyx/test/DummyDocument.lyx.lyx
+++ b/src/tex2lyx/test/DummyDocument.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/Dummy~Document.lyx.lyx 
b/src/tex2lyx/test/Dummy~Document.lyx.lyx
index 54b14cc..3de2e28 100644
--- a/src/tex2lyx/test/Dummy~Document.lyx.lyx
+++ b/src/tex2lyx/test/Dummy~Document.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx 
b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
index 0e392bf..71dfa4b 100644
--- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
+++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/algo2e.lyx.lyx b/src/tex2lyx/test/algo2e.lyx.lyx
index 843262c..0f98d8e 100644
--- a/src/tex2lyx/test/algo2e.lyx.lyx
+++ b/src/tex2lyx/test/algo2e.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/beamer.lyx.lyx b/src/tex2lyx/test/beamer.lyx.lyx
index 55f6297..37f7447 100644
--- a/src/tex2lyx/test/beamer.lyx.lyx
+++ b/src/tex2lyx/test/beamer.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx 
b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
index 5631c94..9caaa57 100644
--- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
+++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/listpreamble.lyx.lyx 
b/src/tex2lyx/test/listpreamble.lyx.lyx
index ac5850a..27869ea 100644
--- a/src/tex2lyx/test/listpreamble.lyx.lyx
+++ b/src/tex2lyx/test/listpreamble.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties true
diff --git a/src/tex2lyx/test/tabular-x-test.lyx.lyx 
b/src/tex2lyx/test/tabular-x-test.lyx.lyx
index 13ab5f4..d9bf322 100644
--- a/src/tex2lyx/test/tabular-x-test.lyx.lyx
+++ b/src/tex2lyx/test/tabular-x-test.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 613
+\lyxformat 614
 \begin_document
 \begin_header
 \save_transient_properties tru

[LyX/master] Update doc format

2022-12-25 Thread Richard Kimberly Heck
commit fadf8ca68fb93367429d598707a8b66b2642311d
Author: Richard Kimberly Heck 
Date:   Sun Dec 25 12:48:19 2022 -0500

Update doc format

 development/MacOSX/ReadMe/Leame.lyx|2 +-
 development/MacOSX/ReadMe/LiesMich.lyx |2 +-
 development/MacOSX/ReadMe/LisezMoi.lyx |2 +-
 development/MacOSX/ReadMe/ReadMe.lyx   |2 +-
 lib/doc/Additional.lyx |   30 +-
 lib/doc/Customization.lyx  |2 +-
 lib/doc/Development.lyx|2 +-
 lib/doc/DummyDocument1.lyx |2 +-
 lib/doc/DummyDocument2.lyx |2 +-
 lib/doc/EmbeddedObjects.lyx|2 +-
 lib/doc/Formula-numbering.lyx  |2 +-
 lib/doc/Intro.lyx  |2 +-
 lib/doc/LFUNs.lyx  | 2434 ++--
 lib/doc/LaTeXConfig.lyx|2 +-
 lib/doc/Math.lyx   |2 +-
 lib/doc/MergedManuals.lyx  |2 +-
 lib/doc/Shortcuts.lyx  |2 +-
 lib/doc/Tutorial.lyx   |2 +-
 lib/doc/UserGuide.lyx  |2 +-
 lib/doc/ar/Intro.lyx   |2 +-
 lib/doc/ar/Shortcuts.lyx   |2 +-
 lib/doc/ar/Tutorial.lyx|2 +-
 lib/doc/ar/UserGuide.lyx   |2 +-
 lib/doc/ca/Intro.lyx   |2 +-
 lib/doc/cs/Tutorial.lyx|2 +-
 lib/doc/da/Intro.lyx   |2 +-
 lib/doc/de/Additional.lyx  |2 +-
 lib/doc/de/Customization.lyx   |2 +-
 lib/doc/de/DummyDocument1.lyx  |2 +-
 lib/doc/de/DummyDocument2.lyx  |2 +-
 lib/doc/de/EmbeddedObjects.lyx |2 +-
 lib/doc/de/Formelnummerierung.lyx  |2 +-
 lib/doc/de/Intro.lyx   |2 +-
 lib/doc/de/Math.lyx|2 +-
 lib/doc/de/Shortcuts.lyx   |2 +-
 lib/doc/de/Tutorial.lyx|2 +-
 lib/doc/de/UserGuide.lyx   |2 +-
 lib/doc/el/Intro.lyx   |2 +-
 lib/doc/es/Additional.lyx  |2 +-
 lib/doc/es/Customization.lyx   |2 +-
 lib/doc/es/DocumentoPostizo1.lyx   |2 +-
 lib/doc/es/DocumentoPostizo2.lyx   |2 +-
 lib/doc/es/EmbeddedObjects.lyx |2 +-
 lib/doc/es/Formula-numbering.lyx   |2 +-
 lib/doc/es/Intro.lyx   |2 +-
 lib/doc/es/Math.lyx|2 +-
 lib/doc/es/Shortcuts.lyx   |2 +-
 lib/doc/es/Tutorial.lyx|2 +-
 lib/doc/es/UserGuide.lyx   |2 +-
 lib/doc/eu/Intro.lyx   |2 +-
 lib/doc/eu/Tutorial.lyx|2 +-
 lib/doc/fr/Additional.lyx  |   26 +-
 lib/doc/fr/Customization.lyx   |   84 +-
 lib/doc/fr/DocumentBidon1.lyx  |2 +-
 lib/doc/fr/DocumentBidon2.lyx  |2 +-
 lib/doc/fr/EmbeddedObjects.lyx |  184 ++-
 lib/doc/fr/Formula-numbering.lyx   |   10 +-
 lib/doc/fr/Intro.lyx   |5 +-
 lib/doc/fr/Math.lyx|  101 +-
 lib/doc/fr/Shortcuts.lyx   |2 +-
 lib/doc/fr/Tutorial.lyx|8 +-
 lib/doc/fr/UserGuide.lyx   |  250 ++-
 lib/doc/gl/Intro.lyx   |2 +-
 lib/doc/gl/Tutorial.lyx|2 +-
 lib/doc/he/Intro.lyx   |2 +-
 lib/doc/he/Tutorial.lyx|2 +-
 lib/doc/hu/Intro.lyx   |2 +-
 lib/doc/hu/Tutorial.lyx|2 +-
 lib/doc/id/Intro.lyx   |2 +-
 lib/doc/id/Shortcuts.lyx   |2 +-
 lib/doc/id/Tutorial.lyx|2 +-
 lib/doc/it/Intro.lyx   |2 +-
 lib/doc/it/Tutorial.lyx|2 +-
 lib/doc/ja/Additional.lyx  |2 +-
 lib/doc/ja/Customization.lyx   |2 +-
 lib/doc/ja/DummyDocument1.lyx  |2 +-
 lib/doc/ja/DummyDocument2.lyx  |2 +-
 lib/doc/ja/EmbeddedObjects.lyx |2 +-
 

[LyX/master] LyXHTML: add a script to validate all the generated files.

2022-12-25 Thread Thibaut Cuvelier
commit e44cef2a3c4b3206d828a3c417ad24edd1c1f2a6
Author: Thibaut Cuvelier 
Date:   Fri Dec 23 00:47:45 2022 +0100

LyXHTML: add a script to validate all the generated files.

It could be a part of the standard test suite, but it might be quite long 
to run.

This test ensures that the generated XHTML files are valid HTML5 files, 
i.e. should display fine in all browsers.
---
 .../thorough_export_tests/lyxhtml_validity.py  |   97 
 1 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/development/thorough_export_tests/lyxhtml_validity.py 
b/development/thorough_export_tests/lyxhtml_validity.py
new file mode 100644
index 000..12c0cbd
--- /dev/null
+++ b/development/thorough_export_tests/lyxhtml_validity.py
@@ -0,0 +1,97 @@
+# Stricter version of the export tests: validate the XHTML code produced by
+# LyX' lyxhtml output as HTML5. It also validates the CSS and MathML parts.
+# Validation errors usually are mistakes in the generator.
+#
+# Call:
+# python lyxhtml_validity.py PATH_TO_LYX/lyx
+#
+# Written with Python 3.8.8.
+# Requirements:
+# - Python package: html5validator: at least v0.4.2
+# - Java runtime engine (JRE): at least v8 (depending on html5validator)
+# Run:
+# pip install html5validator>=0.4.2
+
+import collections
+import glob
+import sys
+import tempfile
+import os
+
+import html5validator
+
+
+if len(sys.argv) != 2:
+print('Expecting one argument, the path to the LyX binary to test')
+if not os.path.exists(sys.argv[1]):
+print('The given path does not point to an existing file')
+if not os.access(sys.argv[1], os.X_OK):
+print('The given path does not point to an executable file')
+
+
+PATH_SCRIPT = os.path.dirname(os.path.realpath(__file__))
+PATH_EXPORT_TESTS = os.path.realpath(PATH_SCRIPT + '/../../autotests/export/')
+PATH_LYX = sys.argv[1]
+
+
+TestFile = collections.namedtuple(
+"TestFile", ["lyx_path", "lyx_file_name", "xhtml_path", "xhtml_file_name"]
+)
+
+validator = html5validator.Validator(format='text')
+
+
+with tempfile.TemporaryDirectory() as out_dir_name:
+all_lyx_files = glob.glob(PATH_EXPORT_TESTS + '/**/*.lyx', recursive=True)
+all_files = [
+TestFile(
+lyx_path=path,
+lyx_file_name=os.path.basename(path),
+xhtml_path = os.path.join(out_dir_name, os.path.basename(path)),
+xhtml_file_name=os.path.basename(path).replace('.lyx', '.html')
+) for path in all_lyx_files
+]
+
+# Generate XHTML files.
+print(
+f'Exporting {len(all_lyx_files)} LyX files to LyXHTML format in the ' +
+f'directory {out_dir_name}'
+)
+
+for file in all_files:
+print(f'* Generating {file.lyx_file_name}...')
+os.system(f'{PATH_LYX} --export-to xhtml "{file.xhtml_path}" 
"{file.lyx_path}"')
+print(f'> Done generating {file.lyx_path} to {file.xhtml_path}')
+
+# print()
+# print(open(file.xhtml_path, 'r').read())
+
+print(f'Exported successfully all {len(all_lyx_files)} files!')
+
+# Validate the XHTML files.
+print(f'Validating {len(all_lyx_files)} XHTML files...')
+
+n_valid = 0
+n_invalid = 0
+for file in all_files:
+print(f'* Validating {file.xhtml_file_name}...')
+error_count = validator.validate([file.xhtml_file_name])
+# Caution: this call outputs all validation errors to stdout!
+# This line is equivalent to running vnu on the corresponding file.
+# https://github.com/validator/validator
+
+if error_count == 0:
+n_valid += 1
+print(f'> Found no validation error!')
+else:
+n_invalid += 1
+print(f'> Found {error_count} validation error{"" if error_count 
== 1 else "s"}!')
+
+print(f'Validated all {len(all_lyx_files)} files! Among them:')
+print(f'> {n_valid} were valid ({100.0 * n_valid / len(all_files)}%)')
+print(f'> {n_invalid} were invalid ({100.0 * n_invalid / 
len(all_files)}%)')
+
+if n_invalid == 0:
+print("That's excellent! Give yourself a pat on the back!")
+elif 100.0 * n_invalid / len(all_files) <= 5.0:
+print("That's a pretty good job!")
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Add a TODO file for the latest tests

2022-12-25 Thread Thibaut Cuvelier
commit 33cc71636ffeaae0eae890b08ca6d5eaed7293f3
Author: Thibaut Cuvelier 
Date:   Sun Dec 25 20:39:14 2022 +0100

Add a TODO file for the latest tests
---
 development/thorough_export_tests/TODO |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/development/thorough_export_tests/TODO 
b/development/thorough_export_tests/TODO
new file mode 100644
index 000..084e4c9
--- /dev/null
+++ b/development/thorough_export_tests/TODO
@@ -0,0 +1,5 @@
+Integrate this part of the tests into CTest.
+Target: after the release of 2.4.
+
+Remove extraneous from LyX when it encounters unknown document classes
+(nothing LaTeX in this folder for now) when exporting from CLI.
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Cleanup following the removal of HTML entities

2022-12-25 Thread Thibaut Cuvelier
commit c77872f3145eb6ea0d42b5b1c7d9572814428ba9
Author: Thibaut Cuvelier 
Date:   Fri Dec 23 03:26:25 2022 +0100

Cleanup following the removal of HTML entities

The remaining part that was not handled in the previous commit. It focuses 
on lib/symbols.

 lib/symbols| 1670 ++--
 src/mathed/MathFactory.cpp |6 +-
 2 files changed, 837 insertions(+), 839 deletions(-)
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] LyXHTML: give the language in the root tag.

2022-12-25 Thread Thibaut Cuvelier
commit d85969b8b870c6b81c515b4885588e99da1110aa
Author: Thibaut Cuvelier 
Date:   Fri Dec 23 02:12:05 2022 +0100

LyXHTML: give the language in the root tag.
---
 src/Buffer.cpp |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 94f4dd4..c7e479a 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2173,8 +2173,7 @@ Buffer::ExportStatus 
Buffer::writeDocBookSource(odocstream & os,
}
 
// Directly output the root tag, based on the current type of 
document.
-   string languageCode = params().language->code();
-   string params = "xml:lang=\"" + languageCode + '"'
+   string params = "xml:lang=\"" + params().language->code() + '"'
+ " 
xmlns=\"http://docbook.org/ns/docbook\"";
+ " 
xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
+ mathmlNamespace
@@ -2241,8 +2240,7 @@ Buffer::ExportStatus 
Buffer::writeLyXHTMLSource(odocstream & os,
if (output_preamble) {
os << "\n"
   << "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd\";>\n"
-  // FIXME Language should be set properly.
-  << "http://www.w3.org/1999/xhtml\";>\n"
+  << "http://www.w3.org/1999/xhtml\"; lang=\"" << 
from_ascii(params().language->code()) << "\">\n"
   << "\n"
   << "\n"
   // FIXME Presumably need to set this right
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] DocBook: add a comment about the need for DocBook 5.2.

2022-12-25 Thread Thibaut Cuvelier
commit ff2a2b2a8a3be323346ad4f5e660fbc1b7a65a04
Author: Thibaut Cuvelier 
Date:   Fri Dec 23 02:22:55 2022 +0100

DocBook: add a comment about the need for DocBook 5.2.
---
 src/Buffer.cpp |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index b1d14d2..0728722 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2179,6 +2179,7 @@ Buffer::ExportStatus 
Buffer::writeDocBookSource(odocstream & os,
+ mathmlNamespace
+ " 
xmlns:xi=\"http://www.w3.org/2001/XInclude\"";
+ " version=\"5.2\"";
+   // Version 5.2 is required for formalgroup.
 
os << "<" << from_ascii(tclass.docbookroot()) << " " << 
from_ascii(attributes) << ">\n";
}
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] LyXHTML: switch the doctype to (X)HTML5 and only output XML entities.

2022-12-25 Thread Thibaut Cuvelier
commit bc73a85778ffb1432bdc510d9a710e7394f42163
Author: Thibaut Cuvelier 
Date:   Fri Dec 23 02:16:08 2022 +0100

LyXHTML: switch the doctype to (X)HTML5 and only output XML entities.

This is a new take on c8e2c17a that was reverted at da67bde61af due to 
entities no more recognised by the browsers. Corresponding thread on the 
mailing list: 
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg213179.html

This patch is a huge cleanup overall, by removing the distinction between 
HTML and XML entities (the latter arrived due to the DocBook support).

In InsetListingParams, I also changed the mechanism that relied on " 
to use an XML entity to be consistent with the rest of the code, mostly in case 
someone looks for HTML entities and wonders why they are still there.
---
 lib/RELEASE-NOTES  |6 ++-
 src/Buffer.cpp |   20 +++---
 src/LaTeXFeatures.cpp  |   31 -
 src/LaTeXFeatures.h|4 -
 src/Layout.cpp |4 +-
 src/Paragraph.cpp  |2 +-
 src/insets/InsetLayout.cpp |2 +-
 src/insets/InsetListingsParams.cpp |   12 ++--
 src/insets/InsetQuotes.cpp |   82 +---
 src/insets/InsetQuotes.h   |4 +-
 src/insets/InsetSpace.cpp  |6 +-
 src/insets/InsetSpecialChar.cpp|  119 
 src/mathed/InsetMathBig.cpp|4 +-
 src/mathed/InsetMathChar.cpp   |7 +--
 src/mathed/InsetMathDecoration.cpp |   67 ++--
 src/mathed/InsetMathDelim.cpp  |8 +-
 src/mathed/InsetMathDots.cpp   |   68 ++--
 src/mathed/InsetMathHull.cpp   |4 +-
 src/mathed/InsetMathMacro.cpp  |4 +-
 src/mathed/InsetMathMatrix.cpp |4 +-
 src/mathed/InsetMathRoot.cpp   |2 +-
 src/mathed/InsetMathSpace.cpp  |6 +-
 src/mathed/InsetMathSqrt.cpp   |2 +-
 src/mathed/InsetMathSymbol.cpp |   12 ++--
 src/mathed/InsetMathXArrow.cpp |   34 ++-
 src/mathed/MacroTable.cpp  |8 ---
 src/mathed/MacroTable.h|2 -
 src/mathed/MathFactory.cpp |   12 ++--
 src/mathed/MathParser.h|2 -
 src/mathed/MathStream.cpp  |   10 +--
 src/mathed/MathStream.h|8 +--
 31 files changed, 167 insertions(+), 389 deletions(-)

diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index 2c6f80e..39d5e8f 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -64,11 +64,15 @@
 * Documents that use TeX fonts can only be compiled with XeTeX if the input
   encoding is set to "utf8-plain" or "ascii".
 
-* With LyXHTML output, there are now different CSS classees generated for
+* With LyXHTML output, there are now different CSS classes generated for
   different depths: enumi, enumii, enumiii, and enumiv, and similarly for
   itemize: lyxitemi, etc. There is also a new HTMLClass tag, which makes it
   easier to provide specific classes for paragraphs.
 
+* HTML support has been updated to output XHTML5 files. A major change is the
+  use of XML entities instead of HTML ones (e.g., LyX now outputs -
+  instead of ").
+
 * DocBook support has been revamped and now targets DocBook 5 (i.e.
   only XML, SGML is gone). Some supporting files for the previous
   implementation have been removed: all examples (lib/examples),
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index c7e479a..b1d14d2 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2173,14 +2173,14 @@ Buffer::ExportStatus 
Buffer::writeDocBookSource(odocstream & os,
}
 
// Directly output the root tag, based on the current type of 
document.
-   string params = "xml:lang=\"" + params().language->code() + '"'
-   + " 
xmlns=\"http://docbook.org/ns/docbook\"";
-   + " 
xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
-   + mathmlNamespace
-   + " 
xmlns:xi=\"http://www.w3.org/2001/XInclude\"";
-   + " version=\"5.2\"";
+   string attributes = "xml:lang=\"" + params().language->code() + 
'"'
+   + " 
xmlns=\"http://docbook.org/ns/docbook\"";
+   + " 
xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
+   + mathmlNamespace
+   + " 
xmlns:xi=\"http://www.w3.org/2001/XInclude\"";
+   + " version=\"5.2\"";
 
-   os << "<" << from_ascii(tclass.docbookroot()) << " " << 
from_ascii(params) << ">\n";
+   os << "<" << from_ascii(tclass.docbookroot()) << " " << 
from_ascii(attributes) << ">\n";
   

[LyX/master] Amend bc73a85778ffb1432bdc510d9a710e7394f42163

2022-12-25 Thread Thibaut Cuvelier
commit 2592a36dae5d18a16586b14b4d17948c8b53a382
Author: Thibaut Cuvelier 
Date:   Mon Dec 26 00:18:47 2022 +0100

Amend bc73a85778ffb1432bdc510d9a710e7394f42163

Missing return in `specialCharKindToXMLEntity`. Previously, the
functions that were merged into `specialCharKindToXMLEntity` did not
return any kind of error in case an unknown special character is met
(enumerated value). This behaviour is preserved.
---
 src/insets/InsetSpecialChar.cpp |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp
index 1dcc3da..bebf61a 100644
--- a/src/insets/InsetSpecialChar.cpp
+++ b/src/insets/InsetSpecialChar.cpp
@@ -565,6 +565,8 @@ string specialCharKindToXMLEntity(InsetSpecialChar::Kind 
kind) {
return "LaTeX2ε";
case InsetSpecialChar::Kind::PHRASE_LATEX:
return "LaTeX";
+   default:
+   return "";
}
 }
 }
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] CommandDepth is no longer used, remove it from the documentation.

2022-12-25 Thread Thibaut Cuvelier
commit 7556fc42ff9b1a7916473c889fd0d53af8bb75e4
Author: Thibaut Cuvelier 
Date:   Mon Dec 26 01:36:38 2022 +0100

CommandDepth is no longer used, remove it from the documentation.
---
 lib/doc/Customization.lyx |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index c590e0f..8a11dcf 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -14628,6 +14628,8 @@ string
 \end_layout
 
 \begin_layout Description
+
+\change_deleted 1075283030 1672014981
 \begin_inset Flex Code
 status collapsed
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Cleanup documentation about old XML support.

2022-12-25 Thread Thibaut Cuvelier
commit 4c8cfae7761ddcb372b63dae44f60a368633
Author: Thibaut Cuvelier 
Date:   Mon Dec 26 01:32:00 2022 +0100

Cleanup documentation about old XML support.
---
 lib/doc/Customization.lyx |  100 -
 1 files changed, 99 insertions(+), 1 deletions(-)

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 362fbf2..c590e0f 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -14662,7 +14662,91 @@ string
 \end_inset
 
 ] Copies all the features of an existing style into the current one.
- 
+
+\change_deleted 1075283030 1671679775
+
+\change_inserted 1075283030 1671679774
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1672014806
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1671679781
+DocBookGenerateTitle
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1672014763
+bool=false
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+] Generates a
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1672014789
+title
+\end_layout
+
+\end_inset
+
+ tag after the wrapper tag.
+ This parameter should only be used with
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1671679828
+DocBookWrapperTag
+\end_layout
+
+\end_inset
+
+,
+ otherwise the title will be output
+\emph on
+ before
+\emph default
+ the contents of the environment.
+ The generated title is the same as the LyXHTML label:
+ a combination of the environment type and its number.
+ A major use is when DocBook has no close mapping for LaTeX environments and 
users must fallback to using a generic container such as
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1672014801
+figure
+\end_layout
+
+\end_inset
+
+,
+ which requires a title although there is none in LaTeX.
+ This feature is heavily used for theorem-like environments.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
@@ -15162,6 +15246,8 @@ nolink "false"
 \end_layout
 
 \begin_layout Description
+
+\change_deleted 1075283030 1672014684
 \begin_inset Flex Code
 status collapsed
 
@@ -15172,6 +15258,8 @@ InnerTag
 \end_inset
 
  [FIXME] (Used only with XML-type formats.)
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
@@ -15511,6 +15599,8 @@ ItemSep
 \end_layout
 
 \begin_layout Description
+
+\change_deleted 1075283030 1672014680
 \begin_inset Flex Code
 status collapsed
 
@@ -15521,6 +15611,8 @@ ItemTag
 \end_inset
 
  [FIXME] (Used only with XML-type formats.)
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
@@ -15979,9 +16071,13 @@ LabelStringAppendix
 \end_inset
 
  too.
+\change_deleted 1075283030 1672015070
+
 \end_layout
 
 \begin_layout Description
+
+\change_deleted 1075283030 1672015070
 \begin_inset Flex Code
 status collapsed
 
@@ -15992,6 +16088,8 @@ LabelTag
 \end_inset
 
  [FIXME] (Used only with XML-type formats.)
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Cleanup documentation about old XML support.

2022-12-25 Thread Thibaut Cuvelier
commit b9b0ac1b6ccded5c39480665744caf7eef9c522a
Author: Thibaut Cuvelier 
Date:   Mon Dec 26 01:32:00 2022 +0100

Cleanup documentation about old XML support.
---
 lib/doc/Customization.lyx |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 8a11dcf..e36cb2a 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -14664,9 +14664,6 @@ string
 \end_inset
 
 ] Copies all the features of an existing style into the current one.
-
-\change_deleted 1075283030 1671679775
-
 \change_inserted 1075283030 1671679774
 
 \end_layout
@@ -14681,6 +14678,8 @@ status collapsed
 
 \change_inserted 1075283030 1671679781
 DocBookGenerateTitle
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -14720,6 +14719,8 @@ status collapsed
 
 \change_inserted 1075283030 1671679828
 DocBookWrapperTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs