Skip to content

Commit b11460c

Browse files
authored
docs: various documentation fixes (#3052)
<!--Add a description of your PR here--> I initially wanted to fix only the Mambaforge mentions in the Setup tutorial, but then noticed several warnings when building the docs so I tried tackling those as well. Here is a list: - Replace Mambaforge by Miniforge in the Setup tutorial - Remove deprecated `sphinxawesome_theme.highlighting` extension - Fix broken links in the docs (internal links and links to API docs) - Fix headings that the did not show up in HTML (Bash examples) - Fix warnings about duplicate external links (e.g. links named "here") by making them anonymous with a double underscore. - Replace sub-worfklows by modules in Additional Features tutorial about modularization Let me know if these are too unrelated for a single PR and you want me to split it. Thank you! ### QC <!-- Make sure that you can tick the boxes below. --> * [x] The PR contains a test case for the changes or the changes are already covered by an existing test case. (N.A., I think) * [x] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation Updates** - Removed outdated highlighting extension from documentation configuration. - Updated references in cloud execution documentation for clarity. - Enhanced hyperlink formatting throughout various documentation files for consistency. - Clarified terminology related to modularization and workflow management. - Revised tutorial content to reflect the transition from "Mambaforge" to "Miniforge" for Python installation instructions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 666cf62 commit b11460c

File tree

16 files changed

+59
-56
lines changed

16 files changed

+59
-56
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"sphinxarg.ext",
4040
"sphinx.ext.autosectionlabel",
4141
"myst_parser",
42-
"sphinxawesome_theme.highlighting",
4342
]
4443

4544
html_css_files = ["custom.css"]

docs/executing/caching.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For example,
2222
2323
would instruct Snakemake to cache and reuse the results of the rules ``download_data`` and ``create_index``.
2424
The environment variable definition that happens in the first line (defining the location of the cache) should of course be done only once and system wide in reality.
25-
When Snakemake is executed without a shared filesystem (e.g., in the cloud, see :ref:`cloud`), the environment variable has to point to a location compatible with the given remote provider (e.g. an S3 or Google Storage bucket).
25+
When Snakemake is executed without a shared filesystem (e.g., in the cloud, see :ref:`tutorial-cloud`), the environment variable has to point to a location compatible with the given remote provider (e.g. an S3 or Google Storage bucket).
2626
In any case, the provided location should be shared between all workflows of your group, institute or computing environment, in order to benefit from the reuse of previously obtained intermediate results.
2727

2828
Alternatively, rules can be marked as eligible for caching via the ``cache`` directive:

docs/executing/cli.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Similarly, it is possible to overwrite other resource definitions in rules, via
6868
Both mechanisms can be particularly handy when used in combination with :ref:`non-local execution <non-local-exec>`.
6969

7070
.. _non-local-exec:
71+
7172
Non-local execution
7273
^^^^^^^^^^^^^^^^^^^
7374

docs/getting_started/migration.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Snakemake 8 removes the support for three syntactical elements, which are all of
2525

2626
In addition, we have moved the former remote provider functionality into so called :ref:`storage plugins <storage-support>`.
2727
Most of the old remote providers have been migrated into the new storage plugins
28-
(see the `Snakemake plugin catalog <https://snakemake.github.io/snakemake-plugin-catalog>`_.).
28+
(see the `Snakemake plugin catalog <https://snakemake.github.io/snakemake-plugin-catalog>`__.).
2929
Two former remote providers have been migrated into Snakemake wrappers instead, namely
3030
the NCBI and EGA remote providers, which are now replaced by the
3131
`entrez/efetch <https://snakemake-wrappers.readthedocs.io/en/stable/wrappers/entrez/efetch.html>`_ and
3232
the `ega <https://snakemake-wrappers.readthedocs.io/en/stable/wrappers/ega/fetch.html>`_ wrappers.
33-
As of writing, the Snakemake storage plugin for xrootd (see `here <https://github.com/snakemake/snakemake-storage-plugin-xrootd>`_) does not yet pass the CI tests. Any help would be greatly appreciated.
33+
As of writing, the Snakemake storage plugin for xrootd (see `here <https://github.com/snakemake/snakemake-storage-plugin-xrootd>`__) does not yet pass the CI tests. Any help would be greatly appreciated.
3434

3535

3636
Command line interface
@@ -42,14 +42,14 @@ The command line interface of Snakemake 8 has a lot of new options which are bes
4242

4343
Moreover, some options have been renamed:
4444

45-
* All the execution backends have been moved into plugins. When you used e.g. ``--kubernetes`` and corresponding options before, you should now use ``--executor kubernetes`` and check the `Snakemake plugin catalog <https://snakemake.github.io/snakemake-plugin-catalog/plugins/executor/kubernetes.html>`_ for the new options. The same holds for all other execution backends, see `here <https://snakemake.github.io/snakemake-plugin-catalog/index.html>`_.
45+
* All the execution backends have been moved into plugins. When you used e.g. ``--kubernetes`` and corresponding options before, you should now use ``--executor kubernetes`` and check the `Snakemake plugin catalog <https://snakemake.github.io/snakemake-plugin-catalog/plugins/executor/kubernetes.html>`_ for the new options. The same holds for all other execution backends, see `here <https://snakemake.github.io/snakemake-plugin-catalog/index.html>`__.
4646
* The ``--use-conda`` and ``--use-singularity`` options are deprecated. Instead you should now use ``--software-deployment-method conda`` or ``--software-deployment-method apptainer`` or ``--software-deployment-method conda apptainer`` if you need both.
4747
* There is a new executor plugin for `Google Cloud Batch <https://cloud.google.com/batch/docs/get-started>`_.
4848
This is meant as a replacement for the old Google Life Sciences executor.
4949
The new executor is called ``googlebatch`` and can be used with ``--executor googlebatch``.
50-
Please check out the documentation of the plugin in the `Snakemake plugin catalog <https://snakemake.github.io/snakemake-plugin-catalog/plugins/executor/googlebatch.html>`_.
50+
Please check out the documentation of the plugin in the `Snakemake plugin catalog <https://snakemake.github.io/snakemake-plugin-catalog/plugins/executor/googlebatch.html>`__.
5151
Note that in principle it is fine to re-add google-lifesciences support as a plugin as well.
52-
We even have skeleton code for this `here <https://github.com/snakemake/snakemake-executor-plugin-google-lifesciences>`_.
52+
We even have skeleton code for this `here <https://github.com/snakemake/snakemake-executor-plugin-google-lifesciences>`__.
5353
Any help with getting this tested and released despite the fact that google lifesciences will be shut down this year would still be valued.
5454

5555
.. list-table:: Interface comparison
@@ -578,4 +578,4 @@ API
578578

579579
The Snakemake API has been completely rewritten into a modern `dataclass <https://docs.python.org/3/library/dataclasses.html>`_ based approach.
580580
The traditional central ``snakemake()`` function is gone.
581-
For an example how to use the new API, check out the Snakemake CLI implementation `here <https://github.com/snakemake/snakemake/blob/04ec2c0262b2cb96cbcd7edbbb2596979c1703ae/snakemake/cli.py#L1767>`_.
581+
For an example how to use the new API, check out the Snakemake CLI implementation `here <https://github.com/snakemake/snakemake/blob/04ec2c0262b2cb96cbcd7edbbb2596979c1703ae/snakemake/cli.py#L1767>`__.

docs/project_info/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ From the base snakemake folder you call :code:`pytest` to run all the tests, or
118118
119119
If you introduce a new feature you should add a new test to the tests directory. See the folder for examples.
120120

121-
.. project_info-doc_guidelines:
121+
.. _project_info-doc_guidelines:
122122

123123
------------------------
124124
Documentation Guidelines

docs/project_info/faq.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The quick fix for virtualenv is to temporarily deactivate the check for unbound
6464
6565
set +u; source /path/to/venv/bin/activate; set -u
6666
67-
For more details on bash strict mode, see the `here <http://redsymbol.net/articles/unofficial-bash-strict-mode/>`_.
67+
For more details on bash strict mode, see the `here <http://redsymbol.net/articles/unofficial-bash-strict-mode/>`__.
6868

6969

7070
My shell command fails with exit code != 0 from within a pipe, what's wrong?
@@ -293,11 +293,11 @@ How do I enable syntax highlighting in Vim for Snakefiles?
293293
----------------------------------------------------------
294294

295295
Instructions for doing this are located `here
296-
<https://github.com/snakemake/snakemake/tree/main/misc/vim>`_.
296+
<https://github.com/snakemake/snakemake/tree/main/misc/vim>`__.
297297

298298
Note that you can also format Snakefiles in Vim using :ref:`snakefmt
299299
<How should Snakefiles be formatted?>`, with instructions located `here
300-
<https://github.com/snakemake/snakefmt/blob/master/docs/editor_integration.md#vim>`_!
300+
<https://github.com/snakemake/snakefmt/blob/master/docs/editor_integration.md#vim>`__!
301301

302302
I want to import some helper functions from another python file. Is that possible?
303303
----------------------------------------------------------------------------------
@@ -354,7 +354,7 @@ On unix, you can make use of the commonly pre-installed `mail` command:
354354
snakemake 2> snakemake.log
355355
mail -s "snakemake finished" [email protected] < snakemake.log
356356
357-
In case your administrator does not provide you with a proper configuration of the sendmail framework, you can configure `mail` to work e.g. via Gmail (see `here <https://www.cyberciti.biz/tips/linux-use-gmail-as-a-smarthost.html>`_).
357+
In case your administrator does not provide you with a proper configuration of the sendmail framework, you can configure `mail` to work e.g. via Gmail (see `here <https://www.cyberciti.biz/tips/linux-use-gmail-as-a-smarthost.html>`__).
358358

359359
I want to pass Python variables between rules. Is that possible?
360360
----------------------------------------------------------------
@@ -440,6 +440,7 @@ How do I make my rule fail if an output file is empty?
440440
Snakemake expects shell commands to behave properly, meaning that failures should cause an exit status other than zero. If a command does not exit with a status other than zero, Snakemake assumes everything worked fine, even if output files are empty. This is because empty output files are also a reasonable tool to indicate progress where no real output was produced. However, sometimes you will have to deal with tools that do not properly report their failure with an exit status. Here, you can use the :ref:`ensure function <snakefiles_ensure>` to mark output files that should not be empty, e.g.:
441441

442442
.. code-block:: python
443+
443444
rule NAME:
444445
input: ...
445446
output:
@@ -532,7 +533,7 @@ One solution is to add the following lines to your ``.bashrc`` (or similar):
532533
done
533534
}
534535
535-
(inspired by the answer `here <https://stackoverflow.com/questions/2458042/restore-files-modification-time-in-git/22638823#22638823>`_).
536+
(inspired by the answer `here <https://stackoverflow.com/questions/2458042/restore-files-modification-time-in-git/22638823#22638823>`__).
536537
You can then run ``gitmodtimes`` to update the modification times of all tracked files on the current branch to their last commit time in git; BE CAREFUL--this does not account for local changes that have not been committed.
537538

538539
How do I exit a running Snakemake workflow?
@@ -664,7 +665,7 @@ Say you have forgotten how to use the various options starting ``force``, just t
664665
665666
To activate this autocompletion permanently, put this line in ``~/.zshrc``.
666667

667-
`Here <https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org>`_ is some further reading.
668+
`Here <https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org>`__ is some further reading.
668669

669670
How can I avoid system /tmp to be used when combining apptainer and conda?
670671
--------------------------------------------------------------------------

docs/snakefiles/best_practices.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Best practices
1515
It is **highly recommended** to run the linter before publishing any workflow, asking questions on Stack Overflow or filing issues on Github.
1616
* There is an automatic formatter for Snakemake workflows, called `Snakefmt <https://github.com/snakemake/snakefmt>`_, which should be applied to any Snakemake workflow before publishing it.
1717
* When publishing your workflow in a `Github <https://github.com>`_ repository, it is a good idea to add some minimal test data and configure `Github Actions <https://github.com/features/actions>`_ for continuously testing the workflow on each new commit.
18-
For this purpose, we provide predefined Github actions for both running tests and linting `here <https://github.com/snakemake/snakemake-github-action>`_, as well as formatting `here <https://github.com/snakemake/snakefmt#github-actions>`_.
18+
For this purpose, we provide predefined Github actions for both running tests and linting `here <https://github.com/snakemake/snakemake-github-action>`__, as well as formatting `here <https://github.com/snakemake/snakefmt#github-actions>`__.
1919
* For publishing and distributing a Snakemake workflow, it is a good idea to stick to a :ref:`standardized structure <distribution_and_reproducibility>` that is expected by frequent users of Snakemake.
2020
The `Snakemake workflow catalog <https://snakemake.github.io/snakemake-workflow-catalog>`_ automatically lists Snakemake workflows hosted on `Github <https://github.com>`_ if they follow certain `rules <https://snakemake.github.io/snakemake-workflow-catalog/?rules=true>`_.
2121
By complying to these `rules <https://snakemake.github.io/snakemake-workflow-catalog/?rules=true>`_ you can make your workflow more discoverable and even automate its usage documentation (see `"Standardized usage" <https://snakemake.github.io/snakemake-workflow-catalog/?rules=true>`_).
22-
* Configuration of a workflow should be handled via :ref:`config files <snakefiles_standard_configuration>` and, if needed, tabular configuration like sample sheets (either via :ref:`Pandas <snakefiles_tabular_configuration>` or :ref:`PEPs <snakefiles_peps>`).
22+
* Configuration of a workflow should be handled via :ref:`config files <snakefiles_standard_configuration>` and, if needed, tabular configuration like sample sheets (either via :ref:`Pandas <snakefiles_tabular_configuration>` or :ref:`PEPs <snakefiles-peps>`).
2323
Use such configuration for metadata and experiment information, **not for runtime specific configuration** like threads, resources and output folders.
2424
For those, just rely on Snakemake's CLI arguments like ``--set-threads``, ``--set-resources``, ``--set-default-resources``, and ``--directory``.
2525
This makes workflows more readable, scalable, and portable.
2626
* Try to keep filenames short (thus easier on the eye), but informative. Avoid mixing of too many special characters (e.g. decide whether to use ``_`` or ``-`` as a separator and do that consistently throughout the workflow).
2727
* Try to keep Python code like helper functions separate from rules (e.g. in a ``workflow/rules/common.smk`` file). This way, you help non-experts to read the workflow without needing to parse internals that are irrelevant for them. The helper function names should be chosen in a way that makes them sufficiently informative without looking at their content. Also avoid ``lambda`` expressions inside of rules.
28-
* Make use of `Snakemake wrappers <https://snakemake-wrappers.readthedocs.io>`_ whenever possible. Consider contributing to the wrapper repo whenever you have a rule that reoccurs in at least two of your workflows.
28+
* Make use of `Snakemake wrappers <https://snakemake-wrappers.readthedocs.io>`_ whenever possible. Consider contributing to the wrapper repo whenever you have a rule that reoccurs in at least two of your workflows.

docs/snakefiles/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In the workflow, the configuration is accessible via the global variable `config
3434
expand("{sample}.{param}.output.pdf", sample=config["samples"], param=config["yourparam"])
3535
3636
If the `configfile` statement is not used, the config variable provides an empty array.
37-
In addition to the `configfile` statement, config values can be overwritten via the command line or the :ref:`api_reference_snakemake`, e.g.:
37+
In addition to the `configfile` statement, config values can be overwritten via the command line or the `snakemake.utils API <https://snakemake-api.readthedocs.io/en/stable/api_reference/snakemake_utils.html#snakemake.utils.update_config>`__, e.g.:
3838

3939
.. code-block:: console
4040
@@ -53,7 +53,7 @@ For adding config placeholders into a shell command, Python string formatting sy
5353
shell:
5454
"mycommand {config[foo]} ..."
5555
56-
.. _snakefiles_tabular_configuration
56+
.. _snakefiles_tabular_configuration:
5757

5858
---------------------
5959
Tabular configuration

docs/snakefiles/foreign_wms.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Consider the following example:
2929
3030
Here, the workflow is executed as usual until this rule is reached.
3131
Then, Snakemake passes all resources to the nextflow workflow management system, which generates certain files.
32-
The rule is executed as a :ref:`local rule <snakefiles-local-rule>`, meaning that it would not be submitted to a cluster or cloud system by Snakemake.
32+
The rule is executed as a :ref:`local rule <snakefiles-local-rules>`, meaning that it would not be submitted to a cluster or cloud system by Snakemake.
3333
Instead, the invoked other workflow management system is responsible for that.
3434
E.g., in case of `Nextflow <https://nextflow.io>`_, submission behavior can be configured via a ``nextflow.conf`` file or environment variables.
35-
After the step is done, Snakemake continues execution with the output files produced by the foreign workflow.
35+
After the step is done, Snakemake continues execution with the output files produced by the foreign workflow.

docs/snakefiles/modularization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The `Snakemake Wrapper Repository`_ is meant as a collaborative project and pull
6262
Common-Workflow-Language (CWL) support
6363
--------------------------------------
6464

65-
With Snakemake 4.8.0, it is possible to refer to `CWL <https://www.commonwl.org/>`_ tool definitions in rules instead of specifying a wrapper or a plain shell command.
65+
With Snakemake 4.8.0, it is possible to refer to `CWL <https://www.commonwl.org/>`__ tool definitions in rules instead of specifying a wrapper or a plain shell command.
6666
A CWL tool definition can be used as follows.
6767

6868
.. code-block:: python
@@ -89,7 +89,7 @@ Snakemake will execute the rule by invoking `cwltool`, which has to be available
8989
When using in combination with :ref:`--software-deployment-method apptainer <apptainer>` (``--sdm`` for short), Snakemake will instruct `cwltool` to execute the command via Singularity in user space.
9090
Otherwise, `cwltool` will in most cases use a Docker container, which requires Docker to be set up properly.
9191

92-
The advantage is that predefined tools available via any `repository of CWL tool definitions <https://www.commonwl.org/#Repositories_of_CWL_Tools_and_Workflows>`_ can be used in any supporting workflow management system.
92+
The advantage is that predefined tools available via any `repository of CWL tool definitions <https://www.commonwl.org/#Repositories_of_CWL_Tools_and_Workflows>`__ can be used in any supporting workflow management system.
9393
In contrast to a :ref:`Snakemake wrapper <snakefiles-wrappers>`, CWL tool definitions are in general not suited to alter the behavior of a tool, e.g., by normalizing output names or special input handling.
9494
As you can see in comparison to the analog :ref:`wrapper declaration <snakefiles-wrappers>` above, the rule becomes slightly more verbose, because input, output, and params have to be dispatched to the specific expectations of the CWL tool definition.
9595

0 commit comments

Comments
 (0)