Skip to content

Perl 6 documentation parser #35

Closed
wants to merge 12 commits into from

2 participants

@xfix
xfix commented Jul 31, 2012

I have made Perl 6 Documentation parser. I don't know if output.txt is written correctly (I don't know how to test it), so if any changes will be needed to be done, I will fix them.

@rpicard
rpicard commented Jul 31, 2012

We are working on getting Fathead testing integrated into Duckpan to make development much easier, but for now we really appreciate the patience.

  • The first thing I'd point out is that the first element of the line is what the user will search to trigger that zero-click info (ZCI). The "(Perl 6)" part isn't necessary there; it's something that we'll add on our side.

  • It's not likely that the user will be searching, for example, Str.wordcase, so maybe also having the title as just wordcase that redirects to Str.wordcase would be useful.

    In cases where there are multiple items with the same name, e.g. Code.ACCEPTS and Numeric.ACCEPTS, a disambiguation that triggers on ACCEPTS could be the way to go. To create a disambiguation, use the type D and the disambiguation field (see the general file format section of the readme).

    In the disambiguation field you would have something like this (uses the same format as Wikipedia): [[Code.ACCEPTS]], a brief abstract\n[[Numeric.ACCEPTS]], another brief abstract

    Each item would end up linking to a more specific search, e.g. Code.ACCEPTS, that would trigger the releveant ZCI (as it already does).

  • We are currently looking to move away from the programming data file format in favor of using the general format for everything. To include a synopsis (code block) with the general data file format, just wrap it like this: <pre><code># code goes here</code></pre>

I know that's a lot of feedback, but if you have any questions just let me know!

@xfix
xfix commented Aug 1, 2012

I've updated output.txt. Is it correct now?

@rpicard
rpicard commented Aug 1, 2012

Thanks for fixing that so quickly. At first glance it looks great! I'll test it out and get back to you.

@xfix
xfix commented Aug 1, 2012

I've checked out http://robert.duckduckgo.com/?q=perl6+uc and noticed that linebreaks don't work. 535ecca should fix it.

Also, it seems that when "perl" and "6" is separated by space it doesn't work (possibly conflict with Perl 5 doc?) and disambig pages don't work for some reason (I don't know why)

@rpicard
rpicard commented Aug 1, 2012

@GlitchMr I'm in the process of debugging the disambiguations. I was expecting the issue with "perl 6" as a trigger. I'm just using "perl6" for testing, but once I get the disambiguations figured out, I'll tackle the trigger issue. I know where the problem is coming from, so it shouldn't be too hard to fix.

@rpicard
rpicard commented Aug 1, 2012

@GlitchMr Check out the disambiguation: https://robert.duckduckgo.com/?q=count+perl6

Right now I'm using some sample text, "making some information available," so if you could edit that to give the disambiguation links a small text sample, maybe the first sentence of the description, I think the disambiguations would be all set.

I pushed my changes (updated to include 535ecca) to the branch perl6_doc, so please base your changes on that branch.

rpicard and others added some commits Aug 1, 2012
@rpicard rpicard perl6_doc: Add asterisk and sample abstract to disambiguations d79dff1
GlitchMr Make real disambig description e70be23
GlitchMr Rewrite Perl 6 documentation scripts according to @moritz hints.
* Add support for generic type information, for example `perl6 Rat`
  will return informations about `Rat` type.
* Add support for class inheritance. You can type `Real.log` and
  you will get information about `Numberic.log`.
* The `output.txt` is now not affected by random hash keys order.
1417a74
@rpicard
rpicard commented Aug 2, 2012

@GlitchMr You may still be working on this, but from looking at e70be23 I'd recommend you limit the disambiguation description to the first sentence of the abstract.

@xfix
xfix commented Aug 2, 2012

@rpicard: Actually, i have limited disambiguation descriptions in 1417a74, but by accident I also shortened normal descriptions. Now it should be fixed completely.

@rpicard
rpicard commented Aug 7, 2012

@GlitchMr Just to keep you updated, I'm still trying to figure out the issue where the abstract is getting cut off at a weird spot on for Str.comb on the category page[1]. Everything looks good from your end though.

[1] If it looks really weird, it's because I'm fiddling with it :) https://robert.duckduckgo.com/81/c/Perl_6_Str

@rpicard
rpicard commented Sep 6, 2012

@GlitchMr Okay, we finally got everything figured out and the plugin is live. Sorry it took so long but I've been a little busy getting back into school. Could you give me your Twitter account for attribution?

@xfix
xfix commented Sep 7, 2012

I don't have Twitter. Anyways, thanks.

@rpicard rpicard closed this Sep 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.