eXist-db / eXide

A web-based XQuery IDE for eXist-db
GNU General Public License v3.0
45 stars 32 forks source link

Add 'generate xqdoc' #31

Open dizzzz opened 11 years ago

dizzzz commented 11 years ago

It would be nice if eXide could generate for xquery schrips/modules xqdoc compatible documentation (skeleton) based on the function signature.

This will encourage writing documentation, and saves lots of typing :-)

pwin commented 7 years ago

can this modification include capacity to operate with restxq scripts? The current xqdoc fails with the '%' char of the restxq annotation

joewiz commented 7 years ago

@pwin I think I may have seen similar problems. Could you post a small example that reproduces the error you're seeing?

duncdrum commented 7 years ago

There are more problems with how special characters within xqdoc annotations get parsed

pwin commented 7 years ago

Hi JoeIf I have a small sample file ('/db/apps/sports-api/example-restxq-file.xql') likexquery version "3.0";module namespace demo="http://exist-db.org/apps/restxq/demo";(:~ : List all addresses and return them as XML. :)declare    %rest:GET    %rest:path("/address")    %rest:produces("application/xml", "text/xml")function demo:addresses() {                };and scan as follows:xquery version "3.1";xqdm:scan(xs:anyURI('xmldb:exist:///db/apps/sports-api/example-restxq-file.xql'))I get an error stating that at line 9:5 there was an unexpected character '%'This is part of the restxq annotationI'm using exist-db 3.3.0 Any thoughts?Peter -----Original Message-----From: notifications@github.comSent: Mon, 24 Jul 2017 15:41:13 +0000 (UTC)To: exide@noreply.github.comSubject: Re: [wolfgangmm/eXide] Add 'generate xqdoc' (#31)@pwin I think I may have seen similar problems. Could you post a small example that reproduces the error you're seeing?

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

joewiz commented 7 years ago

I think the formatting got mangled in your email. Let me try to get that into markdown. Is this right?

xquery version "3.0";

module namespace demo="http://exist-db.org/apps/restxq/demo";

(:~ : List all addresses and return them as XML. :)

declare 
    %rest:GET
    %rest:path("/address")    
    %rest:produces("application/xml", "text/xml") 
function demo:addresses() {
    <addresses>
        <myaddress/>
    </addresses>
};

And:

xquery version "3.1";

xqdm:scan(xs:anyURI('xmldb:exist:///db/apps/sports-api/example-restxq-file.xql'))

Did I get that correctly?

pwin commented 7 years ago

 Yes.Any typical restxq function will do. The xqdoc fails at the percentage sign of the annotation-----Original Message-----From: notifications@github.comSent: Wed, 26 Jul 2017 01:48:32 +0000 (UTC)To: exide@noreply.github.comSubject: Re: [wolfgangmm/eXide] Add 'generate xqdoc' (#31)I think the formatting got mangled in your email. Let me try to get that into markdown. Is this right? xquery version "3.0";

module namespace demo="http://exist-db.org/apps/restxq/demo";

(:~ : List all addresses and return them as XML. :)

declare %rest:GET %rest:path("/address")
%rest:produces("application/xml", "text/xml") function demo:addresses() {

}; And: xquery version "3.1";

xqdm:scan(xs:anyURI('xmldb:exist:///db/apps/sports-api/example-restxq-file.xql')) Did I get that correctly?

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.