[ 5 posts ]

Peter Peterson

YUI Contributor

  • Username: linuxpete
  • Joined: Tue Mar 03, 2009 1:02 pm
  • Posts: 10
  • GitHub: petey
  • Gists: petey
  • Offline
  • Profile

yuidocjs and extended yui3 classes

Post Posted: Fri Feb 17, 2012 1:21 pm
+0-
I've started to use yuidocjs to build javascript documentation and it is fantastic. I'm wondering what is the recommended way to get the information about classes I've extended in the YUI3 library (e.g. Base, Widget, etc) into my widget's docs without having all of YUI3's docs included with my own as well.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: yuidocjs and extended yui3 classes

Post Posted: Fri Feb 17, 2012 1:34 pm
+1-
Peter, currently I am waiting on IO to be functional again in YUI on Node. Once that works, you will be able to set a config option like this in your yuidoc.json file (this does not work yet):

Code:
{
     external: {
          data: 'http://yuilibrary.com/yui/docs/api/data.json'
     }
}


Then when YUIDoc builds the docs, it will fetch and mix this external data with the internal parsed data crosslinking those objects out to our site.

Peter Peterson

YUI Contributor

  • Username: linuxpete
  • Joined: Tue Mar 03, 2009 1:02 pm
  • Posts: 10
  • GitHub: petey
  • Gists: petey
  • Offline
  • Profile
Tags:

Re: yuidocjs and extended yui3 classes

Post Posted: Tue Feb 28, 2012 2:31 pm
+0-
Will/Could this support multiple external sources? e.g. I have an app whose components are built from a combination of widget_library_a, gallery_module_b, and yuilibrary.

Nick Husher

YUI Contributor

  • Offline
  • Profile
Tags:

Re: yuidocjs and extended yui3 classes

Post Posted: Wed Feb 29, 2012 10:08 am
+0-
If you don't mind hacking your node_modules until that's fixed, you can edit yuidocjs to allow you to point at a local data.json and a remote webhost.

In your yuidocjs module directory, go open lib/builder.js and comment out the line that looks like this:

Code:
info.base = path.dirname(path.resolve(info.data));


Then, you should be able to do this in your doc config:

Code:
{
    external: {
        data: "path/to/data.json",
        base: "http://yuilibrary.com/yui/docs/api"
    }
}


As a note: this won't include inherited methods or properties from the external modules, and the @use keyword won't link remotely. It will provide remote links to the classes you're extending.

As a further note: I would find the above case--pointing at a local data.json and a remote documentation source--immensely useful. The data.json file is 3.6 meg and it needs to be downloaded any time you want to build the docs, which takes a non-zero amount of time. Pointing at a local json file and assuming it's up-to-date would be a handy trick.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: yuidocjs and extended yui3 classes

Post Posted: Wed Feb 29, 2012 12:08 pm
+0-
I'll likely support data as an array of config's & I will likely add a cache to it as well Only fetching the headers for a last modified stamp before downloading a new version.

I'm hoping to be able to get this back into the system next week, this week I'm finishing up IO in Node so I will have something to work with :)
  [ 5 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum