11
11
import os
12
12
import time
13
13
import shutil
14
+ import subprocess
14
15
15
16
import bbs .fileutils
16
17
import bbs .parse
@@ -119,6 +120,7 @@ def copy_outgoing_pkgs(products_in_subdir, source_node):
119
120
if BBSvars .buildtype in ['workflows' , 'books' , 'bioc-mac-arm64' ]:
120
121
pass
121
122
elif source_node :
123
+ # pdf manuals
122
124
pdf_file = os .path .join (BBSvars .products_in_rdir .path ,
123
125
BBSutils .getSourceNode (),
124
126
'checksrc' ,
@@ -131,6 +133,20 @@ def copy_outgoing_pkgs(products_in_subdir, source_node):
131
133
os .link (pdf_file , dst ) # create hard link to avoid making a copy
132
134
else :
133
135
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 )
134
150
print ('BBS> [stage6b] END copying outgoing packages from %s.' % srcdir )
135
151
return
136
152
0 commit comments