diff --git a/cylc/sphinx_ext/metadata/__init__.py b/cylc/sphinx_ext/metadata/__init__.py index b65f4aa..f83f74d 100644 --- a/cylc/sphinx_ext/metadata/__init__.py +++ b/cylc/sphinx_ext/metadata/__init__.py @@ -272,14 +272,27 @@ def convert_workflow_to_rst(meta): rst = Doc() # Handle the workflow config metadata: - workflow = meta.get('workflow', {}) - rst.append(workflow.get('title', ''), '#') - rst.append(workflow.get('description', 'No description given')) + CylcMetadata.write_section(rst, meta.get('workflow', {}), '#') # Handle the runtime config metadata: rst.append('Runtime', '=') for taskmeta in meta['runtime'].values(): - rst.append(taskmeta.get('title', ''), '^') - rst.append(taskmeta.get('description', '')) + CylcMetadata.write_section(rst, taskmeta) return rst + + @staticmethod + def write_section(rst, section, title_level='^'): + # Title + title = section.get('title', '') + if not title: + return + rst.append(title, title_level) + + # Url + url = section.get('url', '') + if url: + rst.append(url) + + # Description + rst.append(section.get('description', '')) diff --git a/etc/flow.cylc b/etc/flow.cylc index e95ccc9..08f226c 100644 --- a/etc/flow.cylc +++ b/etc/flow.cylc @@ -4,6 +4,11 @@ description = """ This flow.cylc file is placed here to allow the testing of the metadata config extension. """ +url = 'https://www.myproject.com' +custom key yan = "Perhaps it's relevent?" +custom key tan = "Perhaps it's also relevent?" +custom key tethera = "Or perhaps not?" + [scheduling] [[graph]] @@ -19,10 +24,13 @@ testing of the metadata config extension. All about my task for a P12M + P1D """ + url = 'https://www.myproject.com/tasks/foo' [[bar]] [[[meta]]] description = """ What should happen if I forget the title? Should I process RST? - """ \ No newline at end of file + """ + url = 'https://www.myproject.com/tasks/bar' + see also = Bar task docs. \ No newline at end of file