@@ -209,16 +209,6 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
209209 if test_count and test_outputs_base_url :
210210 bblock .metadata ['testOutputs' ] = f"{ test_outputs_base_url } { bblock .subdirs } /"
211211
212- if not light and (not steps or 'transforms' in steps ) and bblock .transforms :
213- logger .info ("Running transforms" )
214- apply_transforms (bblock , outputs_path = test_outputs_path , base_url = base_url ,
215- sandbox_dir = sandbox_dir , bblocks_register = bbr ,
216- github_base_url = github_base_url ,
217- git_repository = additional_metadata .get ('gitRepository' ),
218- id_prefix = id_prefix ,
219- imported_register_urls = imported_registers ,
220- transform_plugins = transform_plugins )
221-
222212 if bblock .examples :
223213 for example in bblock .examples :
224214 for snippet in example .get ('snippets' , ()):
@@ -248,17 +238,6 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
248238 base_url , cwd if base_url else output_file_root
249239 )
250240
251- if not light and (not steps or 'doc' in steps ):
252- logger .info ("Generating documentation" )
253- doc_generator .generate_doc (bblock )
254-
255- if base_url :
256- if viewer_path :
257- bblock .metadata .setdefault ('documentation' , {})['bblocks-viewer' ] = {
258- 'mediatype' : 'text/html' ,
259- 'url' : urljoin (base_url , f"{ viewer_path } /bblock/{ bblock .identifier } " ),
260- }
261-
262241 return True
263242
264243 filter_id = None
@@ -451,9 +430,47 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
451430 else :
452431 logger .error ("%s failed postprocessing, skipping..." , building_block .identifier )
453432
433+ if not steps or 'transforms' in steps :
434+ logger .info ("Running transforms" )
435+ with log_indent ():
436+ for building_block in child_bblocks :
437+ light = filter_id is not None and building_block .identifier != filter_id
438+ if light or not building_block .transforms :
439+ continue
440+ logger .info ("%s" , building_block .identifier )
441+ with log_indent ():
442+ apply_transforms (building_block , outputs_path = test_outputs_path , base_url = base_url ,
443+ sandbox_dir = sandbox_dir , bblocks_register = bbr ,
444+ github_base_url = github_base_url ,
445+ git_repository = additional_metadata .get ('gitRepository' ),
446+ id_prefix = id_prefix ,
447+ imported_register_urls = imported_registers ,
448+ transform_plugins = transform_plugins )
449+
454450 if filter_id is None :
455451 cleanup_sandbox (sandbox_dir , child_bblocks )
456452
453+ if not steps or 'doc' in steps :
454+ logger .info ("Generating documentation" )
455+ with log_indent ():
456+ for building_block in child_bblocks :
457+ light = filter_id is not None and building_block .identifier != filter_id
458+ if not light :
459+ logger .info ("%s" , building_block .identifier )
460+ with log_indent ():
461+ doc_generator .generate_doc (building_block )
462+ if base_url and viewer_path :
463+ building_block .metadata .setdefault ('documentation' , {})['bblocks-viewer' ] = {
464+ 'mediatype' : 'text/html' ,
465+ 'url' : urljoin (base_url , f"{ viewer_path } /bblock/{ building_block .identifier } " ),
466+ }
467+ elif base_url and viewer_path :
468+ for building_block in child_bblocks :
469+ building_block .metadata .setdefault ('documentation' , {})['bblocks-viewer' ] = {
470+ 'mediatype' : 'text/html' ,
471+ 'url' : urljoin (base_url , f"{ viewer_path } /bblock/{ building_block .identifier } " ),
472+ }
473+
457474 full_validation_report_url = None
458475 full_validation_report_url_json = None
459476 if not steps or 'tests' in steps :
0 commit comments