From a65b9ad70f38d7baa8c13f0ccf8c4900d37a813c Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Tue, 18 Feb 2020 20:34:57 -0800 Subject: [PATCH 1/6] showing off weird syntax w/ tabs directive --- docs/conf.py | 2 +- docs/test/md.md | 12 ++++++++++++ docs/test/rst.rst | 12 ++++++++++++ docs/using/index.md | 2 ++ setup.py | 2 +- 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 docs/test/md.md create mode 100644 docs/test/rst.rst diff --git a/docs/conf.py b/docs/conf.py index fb78af18..06ca2d4e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,7 +28,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 = ["myst_parser", "sphinxcontrib.bibtex"] +extensions = ["myst_parser", "sphinxcontrib.bibtex", "sphinx_tabs.tabs"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/docs/test/md.md b/docs/test/md.md new file mode 100644 index 00000000..2ae005d0 --- /dev/null +++ b/docs/test/md.md @@ -0,0 +1,12 @@ +# Testing md + + +````{tabs} +```{tab} testa +contenta +``` + +```{tab} testb +contentb +``` +```` \ No newline at end of file diff --git a/docs/test/rst.rst b/docs/test/rst.rst new file mode 100644 index 00000000..beec8870 --- /dev/null +++ b/docs/test/rst.rst @@ -0,0 +1,12 @@ +Testing rst +=========== + +.. tabs:: + + .. tab:: testa + + contenta + + .. tab:: testb + + contentb diff --git a/docs/using/index.md b/docs/using/index.md index 60154a13..c7ba9768 100644 --- a/docs/using/index.md +++ b/docs/using/index.md @@ -6,4 +6,6 @@ Myst documents. ```{toctree} install.md syntax.md +../test/md.md +../test/rst.rst ``` diff --git a/setup.py b/setup.py index a36dcefb..1df7e34e 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ ) ], extras_require={ - "sphinx": ["pyyaml", "docutils>=0.15", "sphinx>=2,<3"], + "sphinx": ["pyyaml", "docutils>=0.15", "sphinx>=2,<3", "sphinx-tabs"], "code_style": ["flake8<3.8.0,>=3.7.0", "black", "pre-commit==1.17.0"], "testing": [ "coverage", From 5e3afe4bff3bb1aa5085de75448c51cb0c200a10 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 20 Feb 2020 06:36:28 +1100 Subject: [PATCH 2/6] Add more error feedback --- myst_parser/docutils_renderer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/myst_parser/docutils_renderer.py b/myst_parser/docutils_renderer.py index e6b3c8e8..f1c43300 100644 --- a/myst_parser/docutils_renderer.py +++ b/myst_parser/docutils_renderer.py @@ -631,15 +631,15 @@ def parse_directive_arguments(directive, arg_text): arguments = arg_text.split() if len(arguments) < required: raise DirectiveParsingError( - "{} argument(s) required, {} supplied".format(required, len(arguments)) + "{} argument(s) required, {} supplied, argument text: '{}'".format(required, len(arguments), arg_text) ) elif len(arguments) > required + optional: if directive.final_argument_whitespace: arguments = arg_text.split(None, required + optional - 1) else: raise DirectiveParsingError( - "maximum {} argument(s) allowed, {} supplied".format( - required + optional, len(arguments) + "maximum {} argument(s) allowed, {} supplied, argument text: '{}'".format( + required + optional, len(arguments), arg_text ) ) return arguments From d3c527b1d497592a9b7eb3b91f1fd04f43934d7a Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 20 Feb 2020 07:10:29 +1100 Subject: [PATCH 3/6] try without argument --- docs/test/md.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/test/md.md b/docs/test/md.md index 2ae005d0..30718efe 100644 --- a/docs/test/md.md +++ b/docs/test/md.md @@ -9,4 +9,18 @@ contenta ```{tab} testb contentb ``` -```` \ No newline at end of file +```` + +````{tabs} +```{tab} +testa +contenta1 +contenta2 +``` + +```{tab} +testb +contentb1 +contentb2 +``` +```` From f4fe5228175028dac1680d40e7f81c3c6842ca9e Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 20 Feb 2020 07:45:13 +1100 Subject: [PATCH 4/6] test directive with no args/options --- docs/test/rst.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/test/rst.rst b/docs/test/rst.rst index beec8870..5ba66445 100644 --- a/docs/test/rst.rst +++ b/docs/test/rst.rst @@ -10,3 +10,8 @@ Testing rst .. tab:: testb contentb + + +.. note:: start writing + and don't + stop From d8a0e8f7b2c8f3402f55b9b1b753ccc0949851ca Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 20 Feb 2020 07:46:18 +1100 Subject: [PATCH 5/6] test --- docs/test/rst.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/test/rst.rst b/docs/test/rst.rst index 5ba66445..7b0e85da 100644 --- a/docs/test/rst.rst +++ b/docs/test/rst.rst @@ -15,3 +15,8 @@ Testing rst .. note:: start writing and don't stop + + +.. note:: start writing + + with space From 151644b33d444c30f26459aae98a13cc4fe09fd1 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 20 Feb 2020 07:47:01 +1100 Subject: [PATCH 6/6] Update rst.rst --- docs/test/rst.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/test/rst.rst b/docs/test/rst.rst index 7b0e85da..0bf613fd 100644 --- a/docs/test/rst.rst +++ b/docs/test/rst.rst @@ -11,6 +11,9 @@ Testing rst contentb +.. note:: + + normal .. note:: start writing and don't