[Lldb-commits] [lldb] [lldb][man][nfc] Don't register a markdown parser when building man packages (PR #98420)

Alan Zhao via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 11 10:23:24 PDT 2024


https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/98420

>From fab10fb2efe8265d1b403a650dbd2d3348f29b73 Mon Sep 17 00:00:00 2001
From: Alan Zhao <ayzhao at google.com>
Date: Wed, 10 Jul 2024 15:56:39 -0700
Subject: [PATCH 1/3] [lldb][man][nfc] Don't register a markdown parser when
 building man pages

This reduces Sphinx dependencies for building lldb man pages as lldb man
pages don't use markdown.
---
 lldb/docs/conf.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lldb/docs/conf.py b/lldb/docs/conf.py
index 27a1cd7c3c31a..805a6dc19ac81 100644
--- a/lldb/docs/conf.py
+++ b/lldb/docs/conf.py
@@ -89,9 +89,13 @@
 # The suffix of source filenames.
 source_suffix = {
     ".rst": "restructuredtext",
-    ".md": "markdown",
 }
 
+# Man pages do not use markdown pages, so we don't need to register a markdown
+# parser.
+if not building_man_page:
+  source_suffix[".md"] = "markdown"
+
 # The encoding of source files.
 # source_encoding = 'utf-8-sig'
 

>From f89c189303a4a22e9087b190612b7d483238b703 Mon Sep 17 00:00:00 2001
From: Alan Zhao <ayzhao at google.com>
Date: Wed, 10 Jul 2024 17:30:44 -0700
Subject: [PATCH 2/3] fix formatting

---
 lldb/docs/conf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/docs/conf.py b/lldb/docs/conf.py
index 805a6dc19ac81..233cdf7501934 100644
--- a/lldb/docs/conf.py
+++ b/lldb/docs/conf.py
@@ -94,7 +94,7 @@
 # Man pages do not use markdown pages, so we don't need to register a markdown
 # parser.
 if not building_man_page:
-  source_suffix[".md"] = "markdown"
+    source_suffix[".md"] = "markdown"
 
 # The encoding of source files.
 # source_encoding = 'utf-8-sig'

>From cdb7be745cd2f16989829cc1953c2066f37f098c Mon Sep 17 00:00:00 2001
From: Alan Zhao <ayzhao at google.com>
Date: Thu, 11 Jul 2024 10:23:06 -0700
Subject: [PATCH 3/3] move source_suffix

---
 lldb/docs/conf.py | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/lldb/docs/conf.py b/lldb/docs/conf.py
index 233cdf7501934..9b005c9537f23 100644
--- a/lldb/docs/conf.py
+++ b/lldb/docs/conf.py
@@ -64,6 +64,11 @@
 
 autodoc_default_options = {"special-members": True}
 
+# The suffix of source filenames.
+source_suffix = {
+    ".rst": "restructuredtext",
+}
+
 # Unless we only generate the basic manpage we need the plugin for generating
 # the Python API documentation.
 if not building_man_page:
@@ -83,19 +88,13 @@
     # a list of builtin themes.
     html_theme = "furo"
 
+    # Since man pages do not use markdown, we do not need to register a markdown
+    # parser.
+    source_suffix[".md"] = "markdown"
+
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ["_templates"]
 
-# The suffix of source filenames.
-source_suffix = {
-    ".rst": "restructuredtext",
-}
-
-# Man pages do not use markdown pages, so we don't need to register a markdown
-# parser.
-if not building_man_page:
-    source_suffix[".md"] = "markdown"
-
 # The encoding of source files.
 # source_encoding = 'utf-8-sig'
 



More information about the lldb-commits mailing list