Skip to content

Commit 4d6ac8f

Browse files
committed
Generate html manuals with OUTGOING, copy html manuals for 3.21
1 parent e52acff commit 4d6ac8f

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

BBS-make-OUTGOING.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import os
1212
import time
1313
import shutil
14+
import subprocess
1415

1516
import bbs.fileutils
1617
import bbs.parse
@@ -119,6 +120,7 @@ def copy_outgoing_pkgs(products_in_subdir, source_node):
119120
if BBSvars.buildtype in ['workflows', 'books', 'bioc-mac-arm64']:
120121
pass
121122
elif source_node:
123+
# pdf manuals
122124
pdf_file = os.path.join(BBSvars.products_in_rdir.path,
123125
BBSutils.getSourceNode(),
124126
'checksrc',
@@ -131,6 +133,20 @@ def copy_outgoing_pkgs(products_in_subdir, source_node):
131133
os.link(pdf_file, dst) # create hard link to avoid making a copy
132134
else:
133135
print("BBS> [stage6b] SKIPPED (file %s doesn't exist)" % pdf_file)
136+
# html manuals
137+
rel_link = "../../%s/man/%s.html"
138+
hooks = f"hooks <- list(pkg_href = function(pkg) sprintf('{rel_link}', pkg, pkg));"
139+
html_file = os.path.join(BBSvars.Central_rdir.path,
140+
"OUTGOING/manuals",
141+
'%s.html' % pkg)
142+
Rexpr = hooks + f"tools::pkg2HTML('{pkg_path}',out='{html_file}',hooks=hooks)"
143+
cmd = BBSbase.Rexpr2syscmd(Rexpr)
144+
try:
145+
print(Rexpr)
146+
subprocess.run(cmd, stdout=None, stderr=subprocess.STDOUT,
147+
shell=True, check=True)
148+
except subprocess.CalledProcessError as e:
149+
print("BBS> [stage6b] SKIPPED (could not generate %s)" % html_file)
134150
print('BBS> [stage6b] END copying outgoing packages from %s.' % srcdir)
135151
return
136152

propagation/3.21/updateReposPkgs-bioc.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ echo ""
6767
MANUALS_DEST="$REPOS_ROOT/manuals"
6868
MANUALS_SRC="$BBS_OUTGOING_DIR/manuals"
6969
echo "Updating $BIOC_VERSION/bioc repo with reference manuals..."
70-
for i in `ls $MANUALS_SRC`; do
70+
for i in `ls $MANUALS_SRC/*.pdf`; do
7171
pkg=`echo $i| awk '{split($0,a,".pdf"); print(a[1])}'`
7272
mkdir -p $MANUALS_DEST/$pkg/man
73-
cp --update --verbose $MANUALS_SRC/$i $MANUALS_DEST/$pkg/man
73+
cp --update --verbose $MANUALS_SRC/$i.pdf $MANUALS_DEST/$pkg/man
74+
if [ -f $i.html ]; then
75+
cp --update --verbose $MANUALS_SRC/$i.html $MANUALS_DEST/$pkg/man
76+
fi
7477
done
7578

7679
echo "DONE."

0 commit comments

Comments
 (0)