Giter VIP home page Giter VIP logo

Comments (3)

stephenfin avatar stephenfin commented on September 23, 2024

fwiw, I looked at this today. It seems myst_parser does not seem to be happy with our use of sphinx.utils.nodes.nested_parse_with_titles. That should return a load of docutils nodes but the output is off.

Here's an example using reStructuredText:

Screen Shot 2024-04-06 at 10 28 29

and here's the equivalent using Markdown:

Screen Shot 2024-04-06 at 10 28 17

You can see that all the directives are outputted in raw form rather than being processed and nested as expected. I'm not sure how you'd go about fixing this, tbh.

from sphinx-click.

stephenfin avatar stephenfin commented on September 23, 2024

If anyone is interested in fixing this, there's a minimal reproducer here.

from sphinx-click.

LecrisUT avatar LecrisUT commented on September 23, 2024

Yes, and I think that's expected, I've used something similar when messing around with autodoc extensions. For that case, it was fine because the nature of the docstring (rst or md fomat) is known by the user, amd they could fine-tune and select the appropriate parser with eval-rst.

The issue here are:

  • the generated doc fragments do not account for which parser it is currently in, e.g.
    yield '.. program:: {}'.format(ctx.command_path)

    This could have an if statement to generate either format. It should be within an with to appropriately start-end the blocks
  • the api is monolithic, but something along the lines of sphinx autodoc would probably be more manageable

I think the only relevant references here is sphinx-autodoc2, e.g. see their approach here (navigate to the concrete implementations for myst and rst)

from sphinx-click.

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.