[DOC-CVS] [phd] master: Generate full index for partial rendering to avoid out of tree xref elements being swallowed by the renderer. (#221)

[email protected] (haszi via GitHub)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: haszi (haszi)
Committer: GitHub (web-flow)
Pusher: haszi
Date: 2025-11-26T20:16:54+01:00

Commit: https://github.com/php/phd/commit/88e529bf29053ecb64b738554496611ce2b3ea31
Raw diff: https://github.com/php/phd/commit/88e529bf29053ecb64b738554496611ce2b3ea31.diff

Generate full index for partial rendering to avoid out of tree xref elements being swallowed by the renderer. (#221)

Co-authored-by: haszi <[email protected]>

Changed paths:
  M  render.php


Diff:

diff --git a/render.php b/render.php
index f7b3e3e3..dbd451fa 100644
--- a/render.php
+++ b/render.php
@@ -81,30 +81,6 @@
     exit(0);
 }
 
-function make_reader(Config $config, OutputHandler $outputHandler): Reader {
-    //Partial Rendering
-    $idlist = $config->renderIds + $config->skipIds;
-    if (!empty($idlist)) {
-        $outputHandler->v("Running partial build", VERBOSE_RENDER_STYLE);
-
-        $parents = [];
-        if ($config->indexCache) {
-            $parents = $config->indexCache->getParents($config->renderIds);
-        }
-
-        $reader = new Reader_Partial(
-            $outputHandler,
-            $config->renderIds,
-            $config->skipIds,
-            $parents,
-        );
-    } else {
-        $outputHandler->v("Running full build", VERBOSE_RENDER_STYLE);
-        $reader = new Reader($outputHandler);
-    }
-    return $reader;
-}
-
 $render = new Render();
 
 // Set reader LIBXML options
@@ -135,7 +111,8 @@ function make_reader(Config $config, OutputHandler $outputHandler): Reader {
     
     $render->attach($format);
 
-    $reader = make_reader($config, $outputHandler);
+    $outputHandler->v("Running full build", VERBOSE_RENDER_STYLE);
+    $reader = new Reader($outputHandler);
     $reader->open($config->xmlFile, NULL, $readerOpts);
     $render->execute($reader);
 
@@ -160,8 +137,28 @@ function make_reader(Config $config, OutputHandler $outputHandler): Reader {
     }
 }
 
+//Partial Rendering
+$idlist = $config->renderIds + $config->skipIds;
+if (!empty($idlist)) {
+    $outputHandler->v("Running partial build", VERBOSE_RENDER_STYLE);
+
+    $parents = [];
+    if ($config->indexCache) {
+        $parents = $config->indexCache->getParents($config->renderIds);
+    }
+
+    $reader = new Reader_Partial(
+        $outputHandler,
+        $config->renderIds,
+        $config->skipIds,
+        $parents,
+    );
+} else {
+    $outputHandler->v("Running full build", VERBOSE_RENDER_STYLE);
+    $reader = new Reader($outputHandler);
+}
+
 // Render formats
-$reader = make_reader($config, $outputHandler);
 $reader->open($config->xmlFile, NULL, $readerOpts);
 foreach($render as $format) {
     $format->notify(Render::VERBOSE, true);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.