Giter Site home page Giter Site logo

Comments (5)

spoore1 avatar spoore1 commented on September 27, 2024

Without token-prefix (and using a character other than colon), is it possible to use colons in the value side of the :key: part of the RST field list syntax? I thought that was part of the reason the token-prefix option was added originally.

from betelgeuse.

elyezer avatar elyezer commented on September 27, 2024

@spoore1 you can have : on the value. The prefix was added because the desire to support RST's field-list which 1) produces better docs and 2) does not look like Java annotations.

The prefix was added as a feature to help migrating and allowing new code to start using the RST's field-list while giving some time to old code to get updated.

from betelgeuse.

spoore1 avatar spoore1 commented on September 27, 2024

@elyezer I'm seeing issues using : in the value field. For instance if I use a url in description, I see nothing get imported but, if I strip off http: , I do see the rest get imported:

Does not seem to work:

:description: http://something.gitrepo.test/some/path

Seems to work:

:description: something.gitrepo.test/some/path

Should I open this as a separate bug?

from betelgeuse.

elyezer avatar elyezer commented on September 27, 2024

@spoore1 I checked and it is really not parsing properly:

In [5]: parser = DocstringParser()

In [8]: parser.parse("""
   ...: :description: http://test.com/path/to/something
   ...: """)
Out[8]: ({}, {})

In [10]: parser.parse("""
    ...: :description:
    ...:     http//test.com/path/to/something
    ...: """)
Out[10]: ({}, {'description': 'http//test.com/path/to/something'})

The parser is implemented by Testimony, I have tried using testimony and added some print to see if the generated XML (which testimony uses to extract the information) is working. And as we can see:

In [4]: parser.parse("""
   ...: :description: http://test.com/path/to/something
   ...: """)
b'<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n<!-- Generated by Docutils 0.12 -->\n<document source="&lt;string&gt;"><docinfo><field><field_name>description</field_name><field_body><paragraph><reference refuri="http://test.com/path/to/something">http://test.com/path/to/something</reference></paragraph></field_body></field></docinfo></document>'
Out[4]: ({}, {})

It is working but the logic to check for steps is making that break https://github.com/SatelliteQE/testimony/blob/master/testimony/parser.py#L67-L75. Will do some more investigation and will try to fix this asap.

If you want create an issue to track this down, then I will recommend you to open on testimony project instead. I will do that if you don't do before I start working on it.

Thank you

from betelgeuse.

elyezer avatar elyezer commented on September 27, 2024

Token prefix was done by ec38bdd, closing this.

from betelgeuse.

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.