@@ -72,6 +72,15 @@ copy_manifest_files <- function(root, metadata, dest_dir,
72
72
73
73
dest_files = file.path(dest_dir ,
74
74
if ( keep_full_path ) outputs else basename(outputs ))
75
+
76
+ # # See if we need to make extra directories in the codecheck/outputs
77
+ if (keep_full_path ) {
78
+ for (d in dest_files ) {
79
+ dir = dirname(d )
80
+ if ( ! dir.exists(dir ) )
81
+ dir.create(dir , recursive = TRUE )
82
+ }
83
+ }
75
84
file.copy(src_files , dest_files , overwrite = TRUE )
76
85
dest_files
77
86
manifest_df = data.frame (output = outputs ,
@@ -164,17 +173,30 @@ latex_summary_of_metadata <- function(metadata) {
164
173
# #' Format a latex table that summarises the main CODECHECK manifest
165
174
# #' @title Print a latex table to summarise CODECHECK metadata
166
175
# #' @param manifest_df - The manifest data frame
176
+ # #' @param root - root directory of the project
177
+ # #' @param align - alignment flags for the table.
167
178
# #' @return The latex table, suitable for including in the Rmd
168
179
# #' @author Stephen Eglen
169
180
# #' @export
170
- latex_summary_of_manifest <- function (manifest_df ) {
181
+ latex_summary_of_manifest <- function (manifest_df ,
182
+ root ,
183
+ align = c(' l' , ' p{6cm}' , ' p{6cm}' , ' p{2cm}' )
184
+ ) {
171
185
m = manifest_df [, c(" output" , " comment" , " size" )]
186
+ urls = sub(root , sprintf(' %s/blob/master' , metadata $ repository ), manifest_df $ dest )
187
+ m1 = sprintf(' \\ href{%s}{\\ path{%s}}' ,
188
+ urls ,
189
+ m [,1 ],
190
+ m [,1 ])
191
+ m [,1 ] = m1
172
192
names(m ) = c(" Output" , " Comment" , " Size (b)" )
173
193
xt = xtable(m ,
174
194
digits = 0 ,
175
195
caption = " Summary of output files generated" ,
176
- align = c(' l' , ' p{5cm}' , ' p{5cm}' , ' p{2cm}' ))
177
- print(xt , include.rownames = FALSE , comment = FALSE )
196
+ align = align )
197
+ print(xt , include.rownames = FALSE ,
198
+ sanitize.text.function = function (x ){x },
199
+ comment = FALSE )
178
200
}
179
201
180
202
# #' Print the latex code to include the CODECHECK logo
0 commit comments