Git Product home page Git Product logo

Comments (8)

chrisjsewell avatar chrisjsewell commented on May 24, 2024 1

Don't worry I've already taken care of it in https://github.com/ExecutableBookProject/myst_parser/tree/restructure-testing, PR to come soon

from myst-parser.

chrisjsewell avatar chrisjsewell commented on May 24, 2024

Yeh no problem, I’ll look into it

from myst-parser.

choldgraf avatar choldgraf commented on May 24, 2024

I have been trying to figure out what's going on, and the only difference I can find between the MyST and the docutils statemachine seems to be in the parse_directive_arguments method:

    def parse_directive_arguments(directive, arg_text):

If I print a type on each iteration like so:

    def parse_directive_arguments(directive, arg_text):
        print(type(arg_text))

Then I get these outputs:

  • docutils function: <class 'docutils.statemachine.StringList'>
  • MyST function: <class 'str'>

No idea if that has something to do with this error, but I'm just trying to figure out where behavior is different between the two packages

from myst-parser.

chrisjsewell avatar chrisjsewell commented on May 24, 2024

It was because the CodeFence regex was including the line break character as part of the argument string.

from myst-parser.

chrisjsewell avatar chrisjsewell commented on May 24, 2024

This PR will also handle the directive option indentation #54

from myst-parser.

choldgraf avatar choldgraf commented on May 24, 2024

Note that this doesn't seem to be fixed. Now when I run the same code (after a rebase), I get a warning instead of a break, but it's the same warning (1 argument passed while 0 expected). Gonna re-open this so we don't lose track of it, in case there is an underlying issue that's causing this

from myst-parser.

choldgraf avatar choldgraf commented on May 24, 2024

Note - here is an example of code that causes this behavior: #60

from myst-parser.

chrisjsewell avatar chrisjsewell commented on May 24, 2024

To clarify this issue: the docutils parser here
does not rigidly specify the structure of the directive block:

.. <name>:: <arguments>
    <option block>

   <body>

Instead, if no required/optional arguments are specified (by the directive class); the <option block> can start at <arguments> or, if no required/optional arguments are specified and no options are specified; the <body> block can start at <arguments>. Examples:

.. content:: :depth: 2
.. note:: This is body text

from myst-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.