chiark / gitweb /
documentation/doxygen: some Markdown autobrief insanities gone in 1.12.
authorVladimír Vondruš <mosra@centrum.cz>
Fri, 13 Sep 2024 22:52:29 +0000 (00:52 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 14 Sep 2024 00:46:33 +0000 (02:46 +0200)
documentation/doxygen.py
documentation/test_doxygen/contents_autobrief_blockquote/File_8h-111.html [new file with mode: 0644]
documentation/test_doxygen/contents_autobrief_blockquote/File_8h.html
documentation/test_doxygen/test_contents.py

index 3faf179f9eee2baaa58bd22a77bf2b2fc159f340..c56ae60b601fd5c0f8c0a1607e46cdede1cb0c1a 100755 (executable)
@@ -1781,7 +1781,10 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
             # In 1.8.18+, if ///> is accidentally used to mark "a docblock for
             # the following symbol", it leads to a <blockquote> contained in
             # the brief. Not much to do except for ignoring the whole thing.
-            # See the contents_autobrief_blockquote test for details.
+            # See the contents_autobrief_blockquote test for details. Doesn't
+            # happen in 1.12 anymore, not sure if that changed due to
+            # https://github.com/doxygen/doxygen/issues/10902 or something
+            # else in some earlier version.
             if has_block_elements or paragraph_count > 1:
                 logging.warning("{}: ignoring brief description containing multiple paragraphs. Please modify your markup to remove any block elements from the following: {}".format(state.current, out.parsed))
                 out.parsed = ''
diff --git a/documentation/test_doxygen/contents_autobrief_blockquote/File_8h-111.html b/documentation/test_doxygen/contents_autobrief_blockquote/File_8h-111.html
new file mode 100644 (file)
index 0000000..65d2e34
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>File.h file | My Project</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          File.h <span class="m-thin">file</span>
+        </h1>
+<p>A file</p>
+        <section id="enum-members">
+          <h2><a href="#enum-members">Enums</a></h2>
+          <dl class="m-doc">
+            <dt>
+              <span class="m-doc-wrap-bumper">enum <a href="#a8150b7776c2a1749101acf22e868d091" class="m-doc">Enum</a> { </span><span class="m-doc-wrap"><a href="#a8150b7776c2a1749101acf22e868d091a050889cfb2c606473596b8f70f702769" class="m-doc">Value</a> }</span>
+            </dt>
+            <dd></dd>
+          </dl>
+        </section>
+        <section>
+          <h2>Enum documentation</h2>
+          <section class="m-doc-details" id="a8150b7776c2a1749101acf22e868d091"><div>
+            <h3>
+              enum <a href="#a8150b7776c2a1749101acf22e868d091" class="m-doc-self">Enum</a>
+            </h3>
+            <table class="m-table m-fullwidth m-flat m-doc">
+              <thead><tr><th style="width: 1%">Enumerators</th><th></th></tr></thead>
+              <tbody>
+                <tr>
+                  <td><a href="#a8150b7776c2a1749101acf22e868d091a050889cfb2c606473596b8f70f702769" class="m-doc-self" id="a8150b7776c2a1749101acf22e868d091a050889cfb2c606473596b8f70f702769">Value</a></td>
+                  <td>
+                  <p>A value on the right.</p>
+                  </td>
+                </tr>
+              </tbody>
+            </table>
+          </div></section>
+        </section>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
index 65d2e34e39102617321bf6f51bb9e89a7ce440c2..2e769c0ace295dac77de990140427f472e2c0811 100644 (file)
@@ -38,6 +38,7 @@
             <h3>
               enum <a href="#a8150b7776c2a1749101acf22e868d091" class="m-doc-self">Enum</a>
             </h3>
+<blockquote><p>An enum on the right</p></blockquote>
             <table class="m-table m-fullwidth m-flat m-doc">
               <thead><tr><th style="width: 1%">Enumerators</th><th></th></tr></thead>
               <tbody>
index 5c42767a9aac24fadf1b004363bb817e1e9ba41c..3bc42a937a3cbdabcfe4eed027cfcb1ec7243012 100644 (file)
@@ -300,13 +300,23 @@ class AutobriefCppComments(IntegrationTestCase):
 
 class AutobriefBlockquote(IntegrationTestCase):
     def test(self):
-        with self.assertLogs() as cm:
+        # ///> in a brief used to cause a multi-line brief in 1.8.18+, which
+        # caused the whole brief to be discarded with a warning. That's no
+        # longer the case in 1.12, there it's put into the detailed description
+        # instead. Not sure if that changed due to
+        # https://github.com/doxygen/doxygen/issues/10902 or something else in
+        # some earlier version.
+        if parse_version(doxygen_version()) >= (1, 12):
             self.run_doxygen(wildcard='File_8h.xml')
+            self.assertEqual(*self.actual_expected_contents('File_8h.html'))
+        else:
+            with self.assertLogs() as cm:
+                self.run_doxygen(wildcard='File_8h.xml')
 
-        self.assertEqual(*self.actual_expected_contents('File_8h.html'))
-        self.assertEqual(cm.output, [
-            "WARNING:root:File_8h.xml: ignoring brief description containing multiple paragraphs. Please modify your markup to remove any block elements from the following: <blockquote><p>An enum on the right</p></blockquote>"
-        ])
+            self.assertEqual(*self.actual_expected_contents('File_8h.html', 'File_8h-111.html'))
+            self.assertEqual(cm.output, [
+                "WARNING:root:File_8h.xml: ignoring brief description containing multiple paragraphs. Please modify your markup to remove any block elements from the following: <blockquote><p>An enum on the right</p></blockquote>"
+            ])
 
 # JAVADOC_AUTOBRIEF should be nuked from orbit. Or implemented from scratch,
 # properly.