-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MyST lexer can't handle code fences with additional backticks #111
Comments
Can you provide the sybil config you used to generate the above? A full exception would also be helpful... |
This is the relevant part of import doctest
from sybil import Sybil
from sybil.parsers import myst
doctest_option_flags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE
pytest_collect_file = Sybil(
parsers=[
myst.PythonCodeBlockParser(doctest_optionflags=doctest_option_flags),
myst.SkipParser(),
],
patterns=["*.md", "*.py", "*.pyi"],
).pytest() Here is one of the backtraces from pytest.
Here is the contents of that file FWIW: # {py:mod}`bytewax.connectors.demo`
```{py:module} bytewax.connectors.demo
```
```{autodoc2-docstring} bytewax.connectors.demo
:parser: myst
:allowtitles:
```
## Data
````{py:data} X
:canonical: bytewax.connectors.demo.X
:type: typing.TypeVar
```{autodoc2-docstring} bytewax.connectors.demo.X
:parser: myst
```
````
## Classes
`````{py:class} RandomMetricSource(metric_name: str, interval: datetime.timedelta = timedelta(seconds=0.7), count: int = sys.maxsize, next_random: typing.Callable[[], float] = lambda: random.randrange(0, 10))
:canonical: bytewax.connectors.demo.RandomMetricSource
:Bases:
- {py:obj}`~bytewax.inputs.FixedPartitionedSource``[`{py:obj}`~typing.Tuple``[`{py:obj}`~str``, `{py:obj}`~float``], `{py:obj}`~bytewax.connectors.demo._RandomMetricState``]`
```{autodoc2-docstring} bytewax.connectors.demo.RandomMetricSource
:parser: myst
```
```{rubric} Initialization
```
```{autodoc2-docstring} bytewax.connectors.demo.RandomMetricSource.__init__
:parser: myst
```
````{py:method} list_parts() -> typing.List[str]
:canonical: bytewax.connectors.demo.RandomMetricSource.list_parts
````
````{py:method} build_part(now: datetime.datetime, for_part: str, resume_state: typing.Optional[bytewax.connectors.demo._RandomMetricState])
:canonical: bytewax.connectors.demo.RandomMetricSource.build_part
````
````` |
I'm glad I checked, my proposed fix in #113 doesn't work for this! Working on it now... |
@davidselassie - this should be fixed now, but I'll hold off releasing for now in the hope we can get #110 done too, but headsup that I'm likely to move onto another project and close that as "won't fix" if I don't hear back soon... |
Released here: https://pypi.org/project/sybil/6.1.0/ |
The following put in a MyST Markdown file causes a
LexingException
:With the following exception:
Additional backticks are sometimes needed when you want to nest directives or handle literal code that has three backticks.
The text was updated successfully, but these errors were encountered: