Re: JavaScript code documentation



On Sun, Mar 1, 2009 at 8:28 PM, Colin Walters <walters verbum org> wrote:
> [...]  One thing I wonder is how extensible it is.  For
> example, there's the generic gjs support for signals; would be quite
> useful to have those listed.  And in the shell we have the convention
> of having a .actor property for things which effectively subclass
> Actor.  Might be nice to mark those somehow.  [...]

It is quite easy to alter the output. For example, adding the code below to
index.html makes all instances of 'actor' in the code link to an explanation.

<script>
  App.processors.push(function(documentation) {
    $(documentation[0]).parent().children(".code").each(function() {
      this.innerHTML = this.innerHTML.replace(/([^\w])(actor)([^\w])/,
          "$1<a href='#clutter-basics/actor.html'>$2</a>$3");
    });
  });
</script>

It's actually not as easy as it could be, but that can be fixed. :-)

Ubiquity's documentation contains some other examples of extensions, like links
to external API docs, defined in index.html.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]