Skip to content

Commit

Permalink
Fix viewer URL and move to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jan 11, 2024
1 parent 2f0bbb2 commit 7e9626a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ogc/bblocks/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,17 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
transform['ref'] = urljoin(bblock.metadata['sourceFiles'], transform['ref'])
bblock.metadata['transforms'].append({k: v for k, v in transform.items() if k != 'code'})

if viewer_path:
bblock.metadata.setdefault('links', []).append({
'title': 'Building Blocks Viewer',
'href': urljoin(base_url, f"{viewer_path}/bblocks/{bblock.identifier}"),
'rel': 'bblocks-viewer',
})

if not light and (not steps or 'doc' in steps):
print(f" > Generating documentation for {bblock.identifier}", file=sys.stderr)
doc_generator.generate_doc(bblock)

if base_url:
if viewer_path:
bblock.metadata.setdefault('documentation', {})['bblocks-viewer'] = {
'mediatype': 'text/html',
'url': urljoin(base_url, f"{viewer_path}/bblock/{bblock.identifier}"),
}

return True

filter_id = None
Expand Down

0 comments on commit 7e9626a

Please sign in to comment.