Debian Codegraph @

docpages/makedocs-gh-single.php

raw symbols SCIP
1 <?php
2 $tag = $argv[1];
3 $orig_tag = $argv[2];
4 print "ASYNC: Generate $orig_tag docs (https://dpp.dev/$tag/)\n";
5 mkdir(sys_get_temp_dir() . "/dpp-old/" . $tag);
6 chdir(sys_get_temp_dir() . "/dpp-old/" . $tag);
7 system("git clone --recursive https://github.com/brainboxdotcc/DPP.git >/dev/null");
8 chdir("DPP");
9 system("git fetch --tags -a >/dev/null");
10 system("git checkout tags/$orig_tag >/dev/null");
11 system("git checkout tags/v$orig_tag >/dev/null");
12 /* Older versions of the docs before 9.0.7 don't have these. Force them into the tree so old versions get current styling */
13 system("cp -r /home/runner/work/DPP/DPP/docpages/images docpages");
14 system("cp -r /home/runner/work/DPP/DPP/docpages/style.css docpages/style.css");
15 system("cp -r /home/runner/work/DPP/DPP/docpages/*.html docpages/");
16 system("cp -r /home/runner/work/DPP/DPP/doxygen-awesome-css doxygen-awesome-css");
17 /* Always make sure that the version is using the latest doxygen,
18 * but rewrite version number (project number)
19 */
20 $doxy = file_get_contents("/home/runner/work/DPP/DPP/Doxyfile");
21 $doxy = str_replace("PROJECT_NUMBER =", "PROJECT_NUMBER = $tag", $doxy);
22 file_put_contents("Doxyfile", $doxy);
23 /* Rewrite selected version number so that each page has a new default selected in the drop down */
24 $hdr = file_get_contents("/home/runner/work/DPP/DPP/docpages/header.html");
25 $hdr = str_replace("option value='/$tag/'", "option selected value='/$tag/'", $hdr);
26 /* Rewrite version info in header */
27 file_put_contents("docpages/header.html", $hdr);
28 shell_exec("/usr/local/bin/doxygen >/dev/null");
29 if (!file_exists("/home/runner/dpp-web/$tag")) {
30 mkdir("/home/runner/dpp-web/$tag");
31 }
32 chdir("docs");
33 /* Add giscus inside the actual content as postprocess */
34 system('perl -p -i -e \'s/(<.div><.-- contents -->)/$1<script src="https:\/\/giscus.app\/client.js" data-repo="brainboxdotcc\/dpp-comments" ' .
35 'data-repo-id="R_kgDOHOY4xg" data-category="General" data-category-id="DIC_kwDOHOY4xs4CRYtj" data-mapping="pathname" data-strict="1" ' .
36 'data-reactions-enabled="1" data-emit-metadata="1" data-input-position="top" data-theme="preferred_color_scheme" data-lang="en" ' .
37 'data-loading="lazy" crossorigin="anonymous" async><\/script>/\' *.html');
38 system("rsync -r --include='*' '.' '/home/runner/dpp-web/".$tag."' >/dev/null");
39 chdir("/");
40 system("rm -rf " . sys_get_temp_dir() . "/dpp-old/$tag");
41 file_put_contents("/tmp/completion_$tag", $tag);
42 echo "ASYNC: Completed $tag\n";