diff --git a/.github/workflows/tools-api-docs-dev.yml b/.github/workflows/tools-api-docs-dev.yml index c8ccf211d6..8a45922c7c 100644 --- a/.github/workflows/tools-api-docs-dev.yml +++ b/.github/workflows/tools-api-docs-dev.yml @@ -1,7 +1,6 @@ name: nf-core/tools dev API docs -on: - push: - branches: [dev] +# Run on push and PR to test that docs build +on: [pull_request, push] jobs: api-docs: @@ -27,7 +26,8 @@ jobs: run: make --directory ./docs/api html - name: Sync dev docs - if: github.repository == 'nf-core/tools' + # Only sync with the website if it was a push from nf-core/tools dev branch + if: github.repository == 'nf-core/tools' && github.event.type == 'push' && github.event.base_ref == 'refs/heads/dev' uses: SamKirkland/FTP-Deploy-Action@4.0.0 with: server: ${{ secrets.ftp_server }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 87ea3eae15..19596e5c4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ### General +* Convert nf-core/tools API / lint test documentation to MyST ([#1245](https://github.com/nf-core/tools/pull/1245)) + ### Modules ## [v2.3 - Mercury Vulture](https://github.com/nf-core/tools/releases/tag/2.3) - [2022-03-15] diff --git a/docs/api/_src/api/bump_version.rst b/docs/api/_src/api/bump_version.md similarity index 73% rename from docs/api/_src/api/bump_version.rst rename to docs/api/_src/api/bump_version.md index aca9f76210..54c3774408 100644 --- a/docs/api/_src/api/bump_version.rst +++ b/docs/api/_src/api/bump_version.md @@ -1,8 +1,9 @@ -nf_core.bump_version -==================== +# nf_core.bump_version +```{eval-rst} .. automodule:: nf_core.bump_version :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/create.rst b/docs/api/_src/api/create.md similarity index 76% rename from docs/api/_src/api/create.rst rename to docs/api/_src/api/create.md index 10803a8313..5d5f6a62d1 100644 --- a/docs/api/_src/api/create.rst +++ b/docs/api/_src/api/create.md @@ -1,8 +1,9 @@ -nf_core.create -============== +# nf_core.create +```{eval-rst} .. automodule:: nf_core.create :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/download.rst b/docs/api/_src/api/download.md similarity index 75% rename from docs/api/_src/api/download.rst rename to docs/api/_src/api/download.md index b7f8940f85..18ab51376e 100644 --- a/docs/api/_src/api/download.rst +++ b/docs/api/_src/api/download.md @@ -1,8 +1,9 @@ -nf_core.download -================ +# nf_core.download +```{eval-rst} .. automodule:: nf_core.download :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/index.md b/docs/api/_src/api/index.md new file mode 100644 index 0000000000..9050280fd3 --- /dev/null +++ b/docs/api/_src/api/index.md @@ -0,0 +1,9 @@ +# API Reference + +```{toctree} +:caption: 'Tests:' +:glob: true +:maxdepth: 2 + +* +``` diff --git a/docs/api/_src/api/index.rst b/docs/api/_src/api/index.rst deleted file mode 100644 index 4ddec5ecbe..0000000000 --- a/docs/api/_src/api/index.rst +++ /dev/null @@ -1,9 +0,0 @@ -API Reference -============= - -.. toctree:: - :maxdepth: 2 - :caption: Tests: - :glob: - - * diff --git a/docs/api/_src/api/launch.rst b/docs/api/_src/api/launch.md similarity index 76% rename from docs/api/_src/api/launch.rst rename to docs/api/_src/api/launch.md index 060d97009e..eef777ca87 100644 --- a/docs/api/_src/api/launch.rst +++ b/docs/api/_src/api/launch.md @@ -1,8 +1,9 @@ -nf_core.launch -============== +# nf_core.launch +```{eval-rst} .. automodule:: nf_core.launch :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/licences.rst b/docs/api/_src/api/licences.md similarity index 75% rename from docs/api/_src/api/licences.rst rename to docs/api/_src/api/licences.md index 8d061741d9..95b5f9768b 100644 --- a/docs/api/_src/api/licences.rst +++ b/docs/api/_src/api/licences.md @@ -1,8 +1,9 @@ -nf_core.licences -================ +# nf_core.licences +```{eval-rst} .. automodule:: nf_core.licences :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/lint.rst b/docs/api/_src/api/lint.md similarity index 63% rename from docs/api/_src/api/lint.rst rename to docs/api/_src/api/lint.md index 8e0cfdff97..a0e3a6d5c9 100644 --- a/docs/api/_src/api/lint.rst +++ b/docs/api/_src/api/lint.md @@ -1,14 +1,19 @@ -nf_core.lint -============ +# nf_core.lint -.. seealso:: See the `Lint Tests <../lint_tests/index.html>`_ docs for information about specific linting functions. +:::{seealso} +See the [Lint Tests](../lint_tests/index.html) docs for information about specific linting functions. +::: +```{eval-rst} .. automodule:: nf_core.lint :members: run_linting :undoc-members: :show-inheritance: +``` +```{eval-rst} .. autoclass:: nf_core.lint.PipelineLint :members: _lint_pipeline :private-members: _print_results, _get_results_md, _save_json_results, _wrap_quotes, _strip_ansi_codes :show-inheritance: +``` diff --git a/docs/api/_src/api/list.rst b/docs/api/_src/api/list.md similarity index 76% rename from docs/api/_src/api/list.rst rename to docs/api/_src/api/list.md index ea4a406ffa..35c819bc56 100644 --- a/docs/api/_src/api/list.rst +++ b/docs/api/_src/api/list.md @@ -1,8 +1,9 @@ -nf_core.list -============ +# nf_core.list +```{eval-rst} .. automodule:: nf_core.list :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/modules.rst b/docs/api/_src/api/modules.md similarity index 75% rename from docs/api/_src/api/modules.rst rename to docs/api/_src/api/modules.md index 6bb6e0547d..e3f1e39bed 100644 --- a/docs/api/_src/api/modules.rst +++ b/docs/api/_src/api/modules.md @@ -1,8 +1,9 @@ -nf_core.modules -=============== +# nf_core.modules +```{eval-rst} .. automodule:: nf_core.modules :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/schema.rst b/docs/api/_src/api/schema.md similarity index 76% rename from docs/api/_src/api/schema.rst rename to docs/api/_src/api/schema.md index d2d346c28c..a702d28058 100644 --- a/docs/api/_src/api/schema.rst +++ b/docs/api/_src/api/schema.md @@ -1,8 +1,9 @@ -nf_core.schema -============== +# nf_core.schema +```{eval-rst} .. automodule:: nf_core.schema :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/sync.rst b/docs/api/_src/api/sync.md similarity index 76% rename from docs/api/_src/api/sync.rst rename to docs/api/_src/api/sync.md index edb9c28e31..8cc02209da 100644 --- a/docs/api/_src/api/sync.rst +++ b/docs/api/_src/api/sync.md @@ -1,8 +1,9 @@ -nf_core.sync -============== +# nf_core.sync +```{eval-rst} .. automodule:: nf_core.sync :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/api/utils.rst b/docs/api/_src/api/utils.md similarity index 76% rename from docs/api/_src/api/utils.rst rename to docs/api/_src/api/utils.md index f3077f4cbb..1353f97ef5 100644 --- a/docs/api/_src/api/utils.rst +++ b/docs/api/_src/api/utils.md @@ -1,8 +1,9 @@ -nf_core.utils -============= +# nf_core.utils +```{eval-rst} .. automodule:: nf_core.utils :members: :undoc-members: :show-inheritance: :private-members: +``` diff --git a/docs/api/_src/conf.py b/docs/api/_src/conf.py index 36807cf340..4d8ae661d5 100644 --- a/docs/api/_src/conf.py +++ b/docs/api/_src/conf.py @@ -39,7 +39,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"] +extensions = ["myst_parser", "sphinx.ext.autodoc", "sphinx.ext.napoleon"] # Add any paths that contain templates here, relative to this directory. templates_path = ["./_templates"] diff --git a/docs/api/_src/index.md b/docs/api/_src/index.md new file mode 100644 index 0000000000..a6fb767122 --- /dev/null +++ b/docs/api/_src/index.md @@ -0,0 +1,24 @@ +# nf-core/tools documentation + +```{toctree} +:caption: 'Contents:' +:glob: true +:hidden: true +:maxdepth: 2 + +pipeline_lint_tests/index.rst +module_lint_tests/index.rst +api/index.rst +``` + +This documentation is for the `nf-core/tools` package. + +Primarily, it describes the different [code lint tests](lint_tests/index.html) +run by `nf-core lint` (typically visited by a developer when their pipeline fails a given +test), and also reference for the `nf_core` [Python package API](api/index.html). + +## Indices and tables + +- {ref}`genindex` +- {ref}`modindex` +- {ref}`search` diff --git a/docs/api/_src/index.rst b/docs/api/_src/index.rst deleted file mode 100644 index 8561e2757e..0000000000 --- a/docs/api/_src/index.rst +++ /dev/null @@ -1,24 +0,0 @@ -nf-core/tools documentation -=========================== - -.. toctree:: - :hidden: - :maxdepth: 2 - :caption: Contents: - :glob: - - pipeline_lint_tests/index.rst - api/index.rst - -This documentation is for the ``nf-core/tools`` package. - -Primarily, it describes the different `code lint tests `_ -run by ``nf-core lint`` (typically visited by a developer when their pipeline fails a given -test), and also reference for the ``nf_core`` `Python package API `_. - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/api/_src/pipeline_lint_tests/actions_awsfulltest.rst b/docs/api/_src/pipeline_lint_tests/actions_awsfulltest.md similarity index 61% rename from docs/api/_src/pipeline_lint_tests/actions_awsfulltest.rst rename to docs/api/_src/pipeline_lint_tests/actions_awsfulltest.md index daf414a1b7..c0f0aef5a4 100644 --- a/docs/api/_src/pipeline_lint_tests/actions_awsfulltest.rst +++ b/docs/api/_src/pipeline_lint_tests/actions_awsfulltest.md @@ -1,4 +1,5 @@ -actions_awsfulltest -=================== +# actions_awsfulltest +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.actions_awsfulltest +``` diff --git a/docs/api/_src/pipeline_lint_tests/actions_awstest.rst b/docs/api/_src/pipeline_lint_tests/actions_awstest.md similarity index 62% rename from docs/api/_src/pipeline_lint_tests/actions_awstest.rst rename to docs/api/_src/pipeline_lint_tests/actions_awstest.md index b27c830285..42441c8ac5 100644 --- a/docs/api/_src/pipeline_lint_tests/actions_awstest.rst +++ b/docs/api/_src/pipeline_lint_tests/actions_awstest.md @@ -1,4 +1,5 @@ -actions_awstest -=============== +# actions_awstest +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.actions_awstest +``` diff --git a/docs/api/_src/pipeline_lint_tests/actions_ci.rst b/docs/api/_src/pipeline_lint_tests/actions_ci.md similarity index 63% rename from docs/api/_src/pipeline_lint_tests/actions_ci.rst rename to docs/api/_src/pipeline_lint_tests/actions_ci.md index 28bf91cce5..78ea3aea0d 100644 --- a/docs/api/_src/pipeline_lint_tests/actions_ci.rst +++ b/docs/api/_src/pipeline_lint_tests/actions_ci.md @@ -1,4 +1,5 @@ -actions_ci -========== +# actions_ci +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.actions_ci +``` diff --git a/docs/api/_src/pipeline_lint_tests/actions_schema_validation.rst b/docs/api/_src/pipeline_lint_tests/actions_schema_validation.md similarity index 57% rename from docs/api/_src/pipeline_lint_tests/actions_schema_validation.rst rename to docs/api/_src/pipeline_lint_tests/actions_schema_validation.md index d7d2b4c13d..f0c98eb213 100644 --- a/docs/api/_src/pipeline_lint_tests/actions_schema_validation.rst +++ b/docs/api/_src/pipeline_lint_tests/actions_schema_validation.md @@ -1,4 +1,5 @@ -actions_schema_validation -========================= +# actions_schema_validation +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.actions_schema_validation +``` diff --git a/docs/api/_src/pipeline_lint_tests/files_exist.rst b/docs/api/_src/pipeline_lint_tests/files_exist.md similarity index 63% rename from docs/api/_src/pipeline_lint_tests/files_exist.rst rename to docs/api/_src/pipeline_lint_tests/files_exist.md index 5d4700af00..309ea62f0b 100644 --- a/docs/api/_src/pipeline_lint_tests/files_exist.rst +++ b/docs/api/_src/pipeline_lint_tests/files_exist.md @@ -1,5 +1,5 @@ -files_exist -=========== +# files_exist +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.files_exist - +``` diff --git a/docs/api/_src/pipeline_lint_tests/files_unchanged.rst b/docs/api/_src/pipeline_lint_tests/files_unchanged.md similarity index 62% rename from docs/api/_src/pipeline_lint_tests/files_unchanged.rst rename to docs/api/_src/pipeline_lint_tests/files_unchanged.md index 5ec1de6492..2f3b04fe1b 100644 --- a/docs/api/_src/pipeline_lint_tests/files_unchanged.rst +++ b/docs/api/_src/pipeline_lint_tests/files_unchanged.md @@ -1,4 +1,5 @@ -files_unchanged -=============== +# files_unchanged +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.files_unchanged +``` diff --git a/docs/api/_src/pipeline_lint_tests/index.md b/docs/api/_src/pipeline_lint_tests/index.md new file mode 100644 index 0000000000..d10f8421c5 --- /dev/null +++ b/docs/api/_src/pipeline_lint_tests/index.md @@ -0,0 +1,9 @@ +# Pipline lint tests + +```{toctree} +:caption: 'Tests:' +:glob: true +:maxdepth: 2 + +* +``` diff --git a/docs/api/_src/pipeline_lint_tests/index.rst b/docs/api/_src/pipeline_lint_tests/index.rst deleted file mode 100644 index 6b6d2d9717..0000000000 --- a/docs/api/_src/pipeline_lint_tests/index.rst +++ /dev/null @@ -1,9 +0,0 @@ -Pipline lint tests -============================================ - -.. toctree:: - :maxdepth: 2 - :caption: Tests: - :glob: - - * diff --git a/docs/api/_src/pipeline_lint_tests/merge_markers.rst b/docs/api/_src/pipeline_lint_tests/merge_markers.md similarity index 62% rename from docs/api/_src/pipeline_lint_tests/merge_markers.rst rename to docs/api/_src/pipeline_lint_tests/merge_markers.md index ea5e3be84b..b52fdba1a8 100644 --- a/docs/api/_src/pipeline_lint_tests/merge_markers.rst +++ b/docs/api/_src/pipeline_lint_tests/merge_markers.md @@ -1,4 +1,5 @@ -merge_markers -============== +# merge_markers +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.merge_markers +``` diff --git a/docs/api/_src/pipeline_lint_tests/modules_json.rst b/docs/api/_src/pipeline_lint_tests/modules_json.md similarity index 60% rename from docs/api/_src/pipeline_lint_tests/modules_json.rst rename to docs/api/_src/pipeline_lint_tests/modules_json.md index 33fb139bb4..0c0ba71a8f 100644 --- a/docs/api/_src/pipeline_lint_tests/modules_json.rst +++ b/docs/api/_src/pipeline_lint_tests/modules_json.md @@ -1,4 +1,5 @@ -nextflow_config -=============== +# nextflow_config +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.modules_json +``` diff --git a/docs/api/_src/pipeline_lint_tests/nextflow_config.rst b/docs/api/_src/pipeline_lint_tests/nextflow_config.md similarity index 62% rename from docs/api/_src/pipeline_lint_tests/nextflow_config.rst rename to docs/api/_src/pipeline_lint_tests/nextflow_config.md index 68fe8708e7..e23e966143 100644 --- a/docs/api/_src/pipeline_lint_tests/nextflow_config.rst +++ b/docs/api/_src/pipeline_lint_tests/nextflow_config.md @@ -1,4 +1,5 @@ -nextflow_config -=============== +# nextflow_config +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.nextflow_config +``` diff --git a/docs/api/_src/pipeline_lint_tests/pipeline_name_conventions.rst b/docs/api/_src/pipeline_lint_tests/pipeline_name_conventions.md similarity index 57% rename from docs/api/_src/pipeline_lint_tests/pipeline_name_conventions.rst rename to docs/api/_src/pipeline_lint_tests/pipeline_name_conventions.md index 8a63f9759a..0034319d3d 100644 --- a/docs/api/_src/pipeline_lint_tests/pipeline_name_conventions.rst +++ b/docs/api/_src/pipeline_lint_tests/pipeline_name_conventions.md @@ -1,4 +1,5 @@ -pipeline_name_conventions -========================= +# pipeline_name_conventions +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.pipeline_name_conventions +``` diff --git a/docs/api/_src/pipeline_lint_tests/pipeline_todos.rst b/docs/api/_src/pipeline_lint_tests/pipeline_todos.md similarity index 62% rename from docs/api/_src/pipeline_lint_tests/pipeline_todos.rst rename to docs/api/_src/pipeline_lint_tests/pipeline_todos.md index 259cc693e2..08e456ea22 100644 --- a/docs/api/_src/pipeline_lint_tests/pipeline_todos.rst +++ b/docs/api/_src/pipeline_lint_tests/pipeline_todos.md @@ -1,4 +1,5 @@ -pipeline_todos -============== +# pipeline_todos +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.pipeline_todos +``` diff --git a/docs/api/_src/pipeline_lint_tests/readme.rst b/docs/api/_src/pipeline_lint_tests/readme.md similarity index 64% rename from docs/api/_src/pipeline_lint_tests/readme.rst rename to docs/api/_src/pipeline_lint_tests/readme.md index dca8a32d11..9583a56e0a 100644 --- a/docs/api/_src/pipeline_lint_tests/readme.rst +++ b/docs/api/_src/pipeline_lint_tests/readme.md @@ -1,4 +1,5 @@ -readme -====== +# readme +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.readme +``` diff --git a/docs/api/_src/pipeline_lint_tests/schema_description.rst b/docs/api/_src/pipeline_lint_tests/schema_description.md similarity index 61% rename from docs/api/_src/pipeline_lint_tests/schema_description.rst rename to docs/api/_src/pipeline_lint_tests/schema_description.md index 8733e203e5..14f756acd2 100644 --- a/docs/api/_src/pipeline_lint_tests/schema_description.rst +++ b/docs/api/_src/pipeline_lint_tests/schema_description.md @@ -1,4 +1,5 @@ -schema_description -=========== +# schema_description +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.schema_description +``` diff --git a/docs/api/_src/pipeline_lint_tests/schema_lint.rst b/docs/api/_src/pipeline_lint_tests/schema_lint.md similarity index 63% rename from docs/api/_src/pipeline_lint_tests/schema_lint.rst rename to docs/api/_src/pipeline_lint_tests/schema_lint.md index 7d9697c8e9..39be2ea65c 100644 --- a/docs/api/_src/pipeline_lint_tests/schema_lint.rst +++ b/docs/api/_src/pipeline_lint_tests/schema_lint.md @@ -1,4 +1,5 @@ -schema_lint -=========== +# schema_lint +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.schema_lint +``` diff --git a/docs/api/_src/pipeline_lint_tests/schema_params.rst b/docs/api/_src/pipeline_lint_tests/schema_params.md similarity index 62% rename from docs/api/_src/pipeline_lint_tests/schema_params.rst rename to docs/api/_src/pipeline_lint_tests/schema_params.md index 0997774c50..80a626e880 100644 --- a/docs/api/_src/pipeline_lint_tests/schema_params.rst +++ b/docs/api/_src/pipeline_lint_tests/schema_params.md @@ -1,4 +1,5 @@ -schema_params -============= +# schema_params +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.schema_params +``` diff --git a/docs/api/_src/pipeline_lint_tests/template_strings.rst b/docs/api/_src/pipeline_lint_tests/template_strings.md similarity index 61% rename from docs/api/_src/pipeline_lint_tests/template_strings.rst rename to docs/api/_src/pipeline_lint_tests/template_strings.md index 9599a1c26b..3d03bfb256 100644 --- a/docs/api/_src/pipeline_lint_tests/template_strings.rst +++ b/docs/api/_src/pipeline_lint_tests/template_strings.md @@ -1,4 +1,5 @@ -template_strings -================ +# template_strings +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.template_strings +``` diff --git a/docs/api/_src/pipeline_lint_tests/version_consistency.rst b/docs/api/_src/pipeline_lint_tests/version_consistency.md similarity index 61% rename from docs/api/_src/pipeline_lint_tests/version_consistency.rst rename to docs/api/_src/pipeline_lint_tests/version_consistency.md index f0b334fc1c..e8038f8531 100644 --- a/docs/api/_src/pipeline_lint_tests/version_consistency.rst +++ b/docs/api/_src/pipeline_lint_tests/version_consistency.md @@ -1,4 +1,5 @@ -version_consistency -=================== +# version_consistency +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.version_consistency +``` diff --git a/docs/api/make_lint_rst.py b/docs/api/make_lint_rst.py index 67d2bc5ef7..2e80e384ac 100644 --- a/docs/api/make_lint_rst.py +++ b/docs/api/make_lint_rst.py @@ -6,27 +6,29 @@ docs_basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_src", "pipeline_lint_tests") -# Get list of existing .rst files +# Get list of existing .md files existing_docs = [] for fn in os.listdir(docs_basedir): - if fnmatch.fnmatch(fn, "*.rst") and not fnmatch.fnmatch(fn, "index.rst"): + if fnmatch.fnmatch(fn, "*.md") and not fnmatch.fnmatch(fn, "index.md"): existing_docs.append(os.path.join(docs_basedir, fn)) -# Make .rst file for each test name +# Make .md file for each test name lint_obj = nf_core.lint.PipelineLint("", True) -rst_template = """{0} -{1} +md_template = """# {0} +```{eval-rst} .. automethod:: nf_core.lint.PipelineLint.{0} +``` + """ for test_name in lint_obj.lint_tests: - fn = os.path.join(docs_basedir, "{}.rst".format(test_name)) + fn = os.path.join(docs_basedir, "{}.md".format(test_name)) if os.path.exists(fn): existing_docs.remove(fn) else: with open(fn, "w") as fh: - fh.write(rst_template.format(test_name, len(test_name) * "=")) + fh.write(md_template.format(test_name)) for fn in existing_docs: os.remove(fn) diff --git a/docs/api/requirements.txt b/docs/api/requirements.txt index 3f9531ba3d..fc5184b95f 100644 --- a/docs/api/requirements.txt +++ b/docs/api/requirements.txt @@ -1,3 +1,4 @@ Sphinx>=3.3.1 sphinxcontrib-napoleon sphinx_rtd_theme>=0.5.0 +myst-parser diff --git a/tests/test_lint.py b/tests/test_lint.py index 78c8c26aee..8a12fea271 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -160,29 +160,29 @@ def test_strip_ansi_codes(self): stripped = self.lint_obj._strip_ansi_codes("ls \x1b[00m\x1b[01;31mexamplefile.zip\x1b[00m\x1b[01;31m") assert stripped == "ls examplefile.zip" - def test_sphinx_rst_files(self): - """Check that we have .rst files for all lint module code, + def test_sphinx_md_files(self): + """Check that we have .md files for all lint module code, and that there are no unexpected files (eg. deleted lint tests)""" docs_basedir = os.path.join( os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "docs", "api", "_src", "pipeline_lint_tests" ) - # Get list of existing .rst files + # Get list of existing .md files existing_docs = [] for fn in os.listdir(docs_basedir): - if fnmatch.fnmatch(fn, "*.rst") and not fnmatch.fnmatch(fn, "index.rst"): + if fnmatch.fnmatch(fn, "*.md") and not fnmatch.fnmatch(fn, "index.md"): existing_docs.append(os.path.join(docs_basedir, fn)) - # Check .rst files against each test name + # Check .md files against each test name lint_obj = nf_core.lint.PipelineLint("", True) for test_name in lint_obj.lint_tests: - fn = os.path.join(docs_basedir, "{}.rst".format(test_name)) - assert os.path.exists(fn), "Could not find lint docs .rst file: {}".format(fn) + fn = os.path.join(docs_basedir, "{}.md".format(test_name)) + assert os.path.exists(fn), "Could not find lint docs .md file: {}".format(fn) existing_docs.remove(fn) - # Check that we have no remaining .rst files that we didn't expect - assert len(existing_docs) == 0, "Unexpected lint docs .rst files found: {}".format(", ".join(existing_docs)) + # Check that we have no remaining .md files that we didn't expect + assert len(existing_docs) == 0, "Unexpected lint docs .md files found: {}".format(", ".join(existing_docs)) ####################### # SPECIFIC LINT TESTS #