Skip to content

Commit 5a37277

Browse files
committed
fixed basics
1 parent c3d271c commit 5a37277

File tree

4 files changed

+289
-303
lines changed

4 files changed

+289
-303
lines changed

cylc/sphinx_ext/cylc_lang/__init__.py

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
from cylc.sphinx_ext.cylc_lang.autodocumenters import (
2020
CylcAutoDirective,
2121
CylcAutoTypeDirective,
22-
CylcMetadataDirective
22+
CylcWorkflowDirective,
23+
CylcGlobalDirective,
2324
)
2425
from cylc.sphinx_ext.cylc_lang.domains import (
2526
ParsecDomain,
@@ -203,48 +204,32 @@
203204
'''
204205

205206
rawdoc2 = """
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+
248233
workflow_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

Comments
 (0)