Skip to content

Commit

Permalink
fixed basics
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Aug 21, 2024
1 parent c3d271c commit 5a37277
Show file tree
Hide file tree
Showing 4 changed files with 289 additions and 303 deletions.
46 changes: 16 additions & 30 deletions cylc/sphinx_ext/cylc_lang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
from cylc.sphinx_ext.cylc_lang.autodocumenters import (
CylcAutoDirective,
CylcAutoTypeDirective,
CylcMetadataDirective
CylcWorkflowDirective,
CylcGlobalDirective,
)
from cylc.sphinx_ext.cylc_lang.domains import (
ParsecDomain,
Expand Down Expand Up @@ -203,48 +204,32 @@
'''

rawdoc2 = """
.. rst:directive:: cylc-metadata
.. rst:directive:: .. auto-global-cylc:: source
Get a Cylc Configuration and render metadata fields.
Get a Cylc Global Configuration and render metadata fields.
.. rst:directive:option:: source
:type: string
If the optional source argument is give,
set ``CYLC_SITE_CONF_PATH`` to this value.
If set, renders the metadata of a workflow, otherwise the global
config.
.. note::
.. rst:directive:option:: global
:type: string
Set CYLC_SITE_CONF_PATH to this value.
.. note::
If you have a user config this will still override the site
config!
----
Workflow Config
^^^^^^^^^^^^^^^
If you have a user config this will still override the site
config!
.. rst-example::
.. cylc-metadata::
:source: {workflow_path}
.. auto-cylc-global:: {workflow_path}
----
.. rst:directive:: .. auto-cylc-workflow:: source
Global Config
^^^^^^^^^^^^^
Get a Cylc Workflow Configuration from source and document the settings.
.. rst-example::
.. cylc-metadata::
:global: {workflow_path}
.. auto-cylc-workflow:: {workflow_path}/workflow
"""


workflow_path = Path(__file__).parent.parent.parent.parent / 'etc'
__doc__ = (
rawdoc1
Expand All @@ -271,6 +256,7 @@ def setup(app):
app.add_domain(ParsecDomain)
app.add_directive('auto-cylc-conf', CylcAutoDirective)
app.add_directive('auto-cylc-type', CylcAutoTypeDirective)
app.add_directive('cylc-metadata', CylcMetadataDirective)
app.add_directive('auto-cylc-workflow', CylcWorkflowDirective)
app.add_directive('auto-cylc-global', CylcGlobalDirective)
app.add_directive('cylc-scope', CylcScopeDirective)
return {'version': __version__, 'parallel_read_safe': True}
Loading

0 comments on commit 5a37277

Please sign in to comment.