Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Aug 1, 2024
1 parent 0b01de3 commit 30072ac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
23 changes: 18 additions & 5 deletions cylc/sphinx_ext/metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', ''))
10 changes: 9 additions & 1 deletion etc/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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?
"""
"""
url = 'https://www.myproject.com/tasks/bar'
see also = Bar task docs.

0 comments on commit 30072ac

Please sign in to comment.