I started working on PDoc--at long last--during the first Prototype
Hackfest, held last mid-July in Vienna.
On this occasion, I forked Tobie's master on GitHub and implemented the
following changes, which are scheduled now for inclusion back in the ref
master (therefore, you should be aware of them in advance):
The main change is about methodized methods: Andrew's first jab
requested the syntax to be instance-based, but that didn't make too much
sense (no offense, Andrew! You were sitting right next to me when we
switched that) as you'll be using the "static" variant when providing
the element argument explicitly.
So now, declaring a methodized method requires static signature instead
of instance signature:
RIGHT: Element.show(@element)
WRONG: Element#show(@element)
The helper also outputs two EBNFs for this now: the static one and the
instance-based one. Any further elements in the argument list will be
properly displayed in those.
Other changes focus on the HTML helper:
• known types in structured returns (alternative-based, array-based…)
are detected and auto-linked (it used to be auto-linked on just-a-
simple-type returns only).
• three-dot ellipses ("...") are turned into typographical ellipses
("…").
• Whenever your PDoc provides multiple EBNF's, *we use them*; just
now the ref master will only use the first one; we fixed that to
leverage all the EBNFs comments provide. When on a methodized
method, use the methodized syntax on the *first* EBNF, and go
whichever way you want (instance or static) on the next ones.
You can check the upcoming implementation on my fork [1]; comments are
welcome, either as Git commenting or in this list (or both).
Cheers!
[1] http://github.com/tdd/pdoc/tree/master
--
Christophe Porteneuve aka TDD
t...@tddsworld.com
Hey!
I'll try and look into that this weekend. Just FMI, did these specific
pages work alright *before* my changes?
I'll try and look into the long-pending utility function pages' bugs,
too (they don't create proper relpaths to the assets, hence show up w/o
CSS or JS…).
Keep in mind: that's something that happens on api.prototypejs.org,
but not on my local machine. I've occasionally tried to push newer
docs to that site, but the newer stuff never shows up; I need to get
Sam to restart that server or something.
Are you still experiencing this bug locally?
Cheers,
Andrew
The double slashes no. But I don't think those were originally linked.
However, now that they are, they might as well be correctly linked.
I'm more concerned with the overall code quality of those commits, though.
It's hard to understand what these methods are doing, what kind of
arguments they accept, etc.
I can't seem to remember how to sync my fork's master with your recent
commits on yours? Do I need to setup some special branch or sth?
Yeah, we're definitely lacking a good code review tool.
Yeah, we're definitely lacking a good code review tool.
> I'm more than willing to discuss issues with the quality of my code especially *prior* to its being merged upstream :-)
Sorry I took so long to get back to you.
The state of helper.rb is so bad I don't really know how to answer you.
Hopefully I'll find time to clean it up at some point (unless someone
volunteers before then).
Not directly related, but affecting the same lines of code: we'll have
to either switch back to BlueCloth or use Maruku as RDiscount isn't
supported on Windows.
Best,
Tobie
Hi, James.
Sorry I took so long to get back to you.
The state of helper.rb is so bad I don't really know how to answer you.
Not directly related, but affecting the same lines of code: we'll have
to either switch back to BlueCloth or use Maruku as RDiscount isn't
supported on Windows.
Please go ahead.
> We can probably handle this the same way we handle ERB vs. Erubis -- try to
> load all of them, catch LoadErrors, and provide a helper function that hides
> which one is actually being used.
That's what we were initially doing. However, this causes
inconsistencies in the HTML output depending on which parser is used.
I'd rather we traded performance for consistency here. Especially
since this clearly isn't our perf bottleneck.
Maruku seems like a fair compromise.
I'll push it in once you've done your changes.
Best,
Tobie
Actually, we can move back to BlueCloth, I think — the latest version
integrated the Discount library and is much faster.
Cheers,
Andrew