Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated HTML has occasional double links #584

Closed
coke opened this issue Jun 10, 2016 · 10 comments
Closed

Generated HTML has occasional double links #584

coke opened this issue Jun 10, 2016 · 10 comments
Assignees

Comments

@coke
Copy link
Collaborator

coke commented Jun 10, 2016

part of #561

e.g. on

http://docs.perl6.org/type/nativeInt

the methods listed under "Routines supplied by class Any" are all doubly linked:

<ol class="indexList indexList2">
    <li class="indexItem indexItem2"><a href="#method_ACCEPTS"></a><a href="/routine/ACCEPTS#class_Any">method ACCEPTS</a></li>
    <li class="indexItem indexItem2"><a href="#method_any"></a><a href="/routine/any#class_Any">method any</a></li>
    <li class="indexItem indexItem2"><a href="#method_all"></a><a href="/routine/all#class_Any">method all</a></li>
    <li class="indexItem indexItem2"><a href="#method_one"></a><a href="/routine/one#class_Any">method one</a></li>
    <li class="indexItem indexItem2"><a href="#method_none"></a><a href="/routine/none#class_Any">method none</a></li>
    <li class="indexItem indexItem2"><a href="#method_list"></a><a href="/routine/list#class_Any">method list</a></li>
    <li class="indexItem indexItem2"><a href="#method_push"></a><a href="/routine/push#class_Any">method push</a></li>
    <li class="indexItem indexItem2"><a href="#routine_reverse"></a><a href="/routine/reverse#class_Any">routine reverse</a></li>
    <li class="indexItem indexItem2"><a href="#method_sort"></a><a href="/routine/sort#class_Any">method sort</a></li>
    <li class="indexItem indexItem2"><a href="#method_map"></a><a href="/routine/map#class_Any">method map</a></li>
    <li class="indexItem indexItem2"><a href="#method_flat"></a><a href="/routine/flat#class_Any">method flat</a></li>
    <li class="indexItem indexItem2"><a href="#method_eager"></a><a href="/routine/eager#class_Any">method eager</a></li>
    <li class="indexItem indexItem2"><a href="#method_elems"></a><a href="/routine/elems#class_Any">method elems</a></li>
    <li class="indexItem indexItem2"><a href="#method_end"></a><a href="/routine/end#class_Any">method end</a></li>
    <li class="indexItem indexItem2"><a href="#method_pairup"></a><a href="/routine/pairup#class_Any">method pairup</a></li>
    <li class="indexItem indexItem2"><a href="#sub_exit"></a><a href="/routine/exit#class_Any">sub exit</a></li>
  </ol>

This is being created by this snippet of htmlify.p6

            $pod.contents.append:
                pod-heading("Routines supplied by class $class"),
                pod-block(
                    "$podname inherits from class ",
                    pod-link($class.name, "/type/{uri_escape ~$class}"),
                    ", which provides the following methods:",
                ),
                %routines-by-type{$class}.list,
            ;
@coke
Copy link
Collaborator Author

coke commented Jun 10, 2016

Here's a snippet of Perl 6 that shows the issue, snapshotted from a running htmlify.p6's $pod contents and then stripped down to the minimum case that still generates the double-linked issue:

use Pod::To::HTML;

say pod2html 

Pod::Block::Named.new(name => "pod", config => {}, contents => [
    Pod::Heading.new(level => 1, config => {}, contents => [Pod::Block::Para.new(config => {}, contents => ["Routines supplied by class Any"])]),
    Pod::Block::Para.new(config => {}, contents => ["int inherits from class ", Pod::FormattingCode.new(type => "L", meta => ["/type/Any"], config => {}, contents => ["Any"]), ", which provides the following methods:"]), 
    [[
        Pod::Heading.new(level => 2, config => {}, contents => [Pod::FormattingCode.new(type => "L", meta => ["/routine/ACCEPTS#class_Any"], config => {}, contents => ["method ACCEPTS"])]),
        Pod::Block::Para.new(config => {}, contents => ["Defined as:"]), 
    ]]
])

Note that the outer L's contents don't seem to be wrapping the inner L. This may point to a bug in Pod::To::HTML

@coke
Copy link
Collaborator Author

coke commented Jun 10, 2016

Comment from zoffix on the parent ticket:

If it helps anyone, I tried to debug the double-links on headers and gotten only as far as the three %routines-by-type{}.list in this section stuff links into headers and then when pod is generated the headers get wrapped into links by Pod::To::Html. Since complete content is included anyway, the %routines-by-type{}.list needn't to have links in the content.

@coke
Copy link
Collaborator Author

coke commented Dec 19, 2016

I just checked this page again, and no longer see this particular issue.

@coke
Copy link
Collaborator Author

coke commented Dec 20, 2016

There is now an example of this on https://docs.perl6.org/routine/$TILDE.html

@coke
Copy link
Collaborator Author

coke commented Jul 6, 2017

TILDE is now at https://docs.perl6.org/routine/~.html and no longer shows the dupes.

If we can't find any more examples, let's close the ticket.

@tisonkun
Copy link
Member

tisonkun commented Nov 8, 2017

@coke do we have tolerance for this?

<h2 id="(Int)_method_Capture"><a class="u" href="#___top" title="go to top of document"><a href="/routine/Capture#class_Int">(Int) method Capture</a></a></h2>

It's in http://docs.perl6.org/type/nativeInt, but regardless of double links, it works well(somehow)

@AlexDaniel
Copy link
Member

AlexDaniel commented Nov 8, 2017

@W4anD0eR96 no, that is not right. For example, it's one of the reasons why checklink tool complains in #561.

@JJ
Copy link
Contributor

JJ commented Mar 6, 2018

There are still examples such as this one

@JJ
Copy link
Contributor

JJ commented Mar 6, 2018

This is the code in Pod::To::Html that generates it.

@JJ
Copy link
Contributor

JJ commented Mar 13, 2018

I think that was fixed here. Please check and reopen if needed.

@JJ JJ closed this as completed Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants