1919from cylc .sphinx_ext .cylc_lang .autodocumenters import (
2020 CylcAutoDirective ,
2121 CylcAutoTypeDirective ,
22- CylcMetadataDirective
22+ CylcWorkflowDirective ,
23+ CylcGlobalDirective ,
2324)
2425from cylc .sphinx_ext .cylc_lang .domains import (
2526 ParsecDomain ,
203204'''
204205
205206rawdoc2 = """
206- .. rst:directive:: cylc-metadata
207+ .. rst:directive:: .. auto-global-cylc:: source
207208
208- Get a Cylc Configuration and render metadata fields.
209+ Get a Cylc Global Configuration and render metadata fields.
209210
210- .. rst:directive:option:: source
211- :type: string
211+ If the optional source argument is give,
212+ set ``CYLC_SITE_CONF_PATH`` to this value.
212213
213- If set, renders the metadata of a workflow, otherwise the global
214- config.
214+ .. note::
215215
216- .. rst:directive:option:: global
217- :type: string
218-
219- Set CYLC_SITE_CONF_PATH to this value.
220-
221- .. note::
222-
223- If you have a user config this will still override the site
224- config!
225-
226- ----
227-
228- Workflow Config
229- ^^^^^^^^^^^^^^^
216+ If you have a user config this will still override the site
217+ config!
230218
231219 .. rst-example::
232220
233- .. cylc-metadata::
234- :source: {workflow_path}
221+ .. auto-cylc-global:: {workflow_path}
235222
236- ----
223+ .. rst:directive:: .. auto-cylc-workflow:: source
237224
238- Global Config
239- ^^^^^^^^^^^^^
225+ Get a Cylc Workflow Configuration from source and document the settings.
240226
241227 .. rst-example::
242228
243- .. cylc-metadata::
244- :global: {workflow_path}
245-
229+ .. auto-cylc-workflow:: {workflow_path}/workflow
246230"""
247231
232+
248233workflow_path = Path (__file__ ).parent .parent .parent .parent / 'etc'
249234__doc__ = (
250235 rawdoc1
@@ -271,6 +256,7 @@ def setup(app):
271256 app .add_domain (ParsecDomain )
272257 app .add_directive ('auto-cylc-conf' , CylcAutoDirective )
273258 app .add_directive ('auto-cylc-type' , CylcAutoTypeDirective )
274- app .add_directive ('cylc-metadata' , CylcMetadataDirective )
259+ app .add_directive ('auto-cylc-workflow' , CylcWorkflowDirective )
260+ app .add_directive ('auto-cylc-global' , CylcGlobalDirective )
275261 app .add_directive ('cylc-scope' , CylcScopeDirective )
276262 return {'version' : __version__ , 'parallel_read_safe' : True }
0 commit comments