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

links to Java Client javadoc failing from within other pages #691

Open
kcoleman-marklogic opened this issue Jun 22, 2017 · 2 comments
Open
Assignees
Milestone

Comments

@kcoleman-marklogic
Copy link
Contributor

kcoleman-marklogic commented Jun 22, 2017

We're supposed to be able to link to the Java Client API apidoc (javadoc) from within the guide text. I think there's some fixup that happens either during ingestion or before that. In any case, the resulting links aren't working.

There's some examples on this page: http://docs.marklogic.com/guide/semantics/clientAPIs. Just search for the phrase "java client api documentation".

If you click on one of those links, no javadoc comes up, and the Chrome dev tools report the following error:

Uncaught TypeError: Cannot read property '0' of null
    at extractContainer (jquery.pjax.js:701)
    at m.fn.init.options.success (jquery.pjax.js:263)
    at j (jquery-1.11.2.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.11.2.min.js:2)
    at x (jquery-1.11.2.min.js:4)
    at XMLHttpRequest.b (jquery-1.11.2.min.js:4)

If you instead do "copy link address" and paste it into a new tab, it loads fine. The link address you get is http://docs.marklogic.com/javadoc/client/index.html.

The href in the page source looks like this: <a href="/javadoc/client/index.html">. I think that should be OK, which is why I'm filing this against RunDMC instead of pointing fingers at the pre-processing. Of course, it might ultimately requiring fixing on that end to wriggle around this.

However, on the wire, the request has some extra pjax cruft on the end, as shown below. Could that be making a mess?

http://docs.marklogic.com/javadoc/client/index.html?_pjax=%23page_content

This is not an urgent issue, but it would be nice to get some better informed input as to possible cause. My web app skills are easily tapped out. Could it be as simple as needing to include a target="_blank" in the href transform?

@kcoleman-marklogic
Copy link
Contributor Author

I think linking magic is courtesy of src/apidoc/config/title-aliases.xml and stp:list-page-root in src/apidoc/setup/setup.xqm.

If adding target="_blank" is the right answer, that function needs to get a bit smarter (or dumber, depending on how you look at it) in how it handles the <auto-link> element. For example, copy all the attrs instead of just @href so we could slap @target in as needed, such as for the other javadoc bundles.

@dmcassel
Copy link
Contributor

Able to reproduce locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants