diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index e9899d2..0beed1f 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -158,24 +158,25 @@ jobs: xml = '''
-

Version History

-

This page provides the version history for the Bangladesh Core FHIR Implementation Guide.

+

Version History

-

For a machine-readable version history, see package-list.json.

+

This page provides the version history for the Bangladesh Core FHIR Implementation Guide.

-

Published Versions

+

For a machine-readable version history see package-list.json.

- - - - - - - - - - +

Published Versions

+ +
VersionDateStatusDescription
+ + + + + + + + + ''' def version_key(v): @@ -189,40 +190,57 @@ jobs: if e.get('version') and e.get('version') != "current" ] - # Sort versions descending (newest first) + # Sort newest version first published.sort( key=lambda e: version_key(e.get("version", "0.0.0")), reverse=True ) published_found = False + first_row = True for entry in published: published_found = True + version = escape(entry.get('version', 'Unknown')) date = escape(entry.get('date', 'N/A')) - status = escape(entry.get('status', 'unknown')) desc = escape(entry.get('desc', '')) path = escape(entry.get('path', '#')) - xml += f''' - - - - - + status_val = entry.get('status', 'unknown') + + if status_val == "trial-use": + status = 'Trial Use' + elif status_val == "normative": + status = 'Normative' + else: + status = f'{escape(status_val)}' + + badge = 'Latest ' if first_row else '' + + xml += f''' + + + + + + ''' + first_row = False + if not published_found: - xml += ''' - - + xml += ''' + + + ''' - xml += ''' -
VersionDateStatusDescription
{version}{date}{status}{desc}
{badge}{version}{date}{status}{desc}
No published versions available yet.
No published versions available yet.
+ xml += ''' + + -

Continuous Integration Build

+

Continuous Integration Build

''' current_entry = None @@ -232,15 +250,22 @@ jobs: break if current_entry: - path = escape(current_entry.get('path', 'https://fhir.dghs.gov.bd/core/')) - xml += f'''

The latest development build is available at: {path}

-

Note: This is a continuous integration build and may be unstable.

+ path = escape(current_entry.get('path', pkg_list.get('canonical', '') + '/')) + xml += f''' +

The latest development build is available at: + {path}

+ +
+ This is a continuous integration build and may be unstable. +
''' else: - xml += '''

No CI build entry found in package-list.json.

+ xml += ''' +

No CI build entry found in package-list.json.

''' - xml += '''
+ xml += ''' + ''' with open('input/pagecontent/history.xml', 'w', encoding='utf-8') as f: