]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1769248: get ReadTheDocs to build the POD docs (#136)
authorDave Miller <github@justdave.net>
Mon, 4 Sep 2023 05:28:23 +0000 (01:28 -0400)
committerGitHub <noreply@github.com>
Mon, 4 Sep 2023 05:28:23 +0000 (01:28 -0400)
.readthedocs.yaml [new file with mode: 0644]
docs/en/rst/conf.py
docs/makedocs.pl

diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644 (file)
index 0000000..7eada0d
--- /dev/null
@@ -0,0 +1,12 @@
+version: 2
+build:
+  os: "ubuntu-20.04"
+  tools:
+    python: "3.10"
+  apt_packages:
+    - libfile-copy-recursive-perl
+  jobs:
+    post_build:
+      - perl docs/makedocs.pl --pod-only
+      - cp -rp docs/en/html/integrating/api/ "$READTHEDOCS_OUTPUT/html/integrating/api"
+      - cp -p docs/en/html/style.css "$READTHEDOCS_OUTPUT/html/"
index eec01c5318bdaf398323da77d99c5f01f140c210..2e37edd17e8e9f76bdfd919d00953db558dec070 100644 (file)
@@ -383,13 +383,10 @@ pdf_fit_background_mode = 'scale'
 # Temporary highlighting of TODO items
 todo_include_todos = False
 
-# The readthedocs.org website cannot access POD.
-on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
-
-if on_rtd:
-    base_api_url = 'https://www.bugzilla.org/docs/5.0/en/html/integrating/api/'
-else:
-    base_api_url = '../integrating/api/'
+# Originally, the readthedocs.org website could not access POD,
+# so we would conditionally override that here if we were building
+# on RTD, but that's no longer the case.
+base_api_url = '../integrating/api/'
 
 extlinks = {'bug': ('https://bugzilla.mozilla.org/show_bug.cgi?id=%s', 'bug  %s'),
             'api': (base_api_url + '%s', "%s")}
index 87e346e237dc0a20a97b712de2496701a0e210a6..a95954c36add935dbe8e26a87e553b3c773d1fc3 100755 (executable)
@@ -33,6 +33,7 @@ BEGIN { chdir dirname($0); }
 use lib qw(.. ../lib lib);
 
 use Cwd;
+use File::Copy qw(copy);
 use File::Copy::Recursive qw(rcopy);
 use File::Find;
 use File::Path qw(rmtree make_path);
@@ -83,12 +84,19 @@ END_HTML
 
   $converter->contents_page_start($contents_start);
   $converter->contents_page_end("</body></html>");
-  $converter->add_css('./../../../../style.css');
+  if (exists($::ENV{'READTHEDOCS'})) {
+    $converter->add_css('./../../style.css');
+  } else {
+    $converter->add_css('./../../../../style.css');
+  }
   $converter->javascript_flurry(0);
   $converter->css_flurry(0);
   make_path('html/integrating/api');
   $converter->batch_convert(['../../'], 'html/integrating/api');
 
+  if (exists($::ENV{'READTHEDOCS'})) {
+    copy('../style.css', 'html/style.css') or die "Copy failed: $!";
+  }
   print "\n";
 }