Re: [sphinx-dev] Include HTML in generated Sphinx docs

1296 views
Skip to first unread message

gilberto dos santos alves

unread,
Oct 29, 2012, 10:53:51 AM10/29/12
to sphin...@googlegroups.com
are you talking about relative links, since root http server? please could you explain if you want use include some java script to do that? it is this you want? best regards.


2012/10/22 James Brady <ja...@trigger.io>
Hi all, we're documenting a project which includes some Java APIs, and we'd really like to include the pre-generated Javadocs with the Sphinx docs.

Of course, we could put the HTML in the static directory, but I'm not sure how to link to it without using absolute links.

Is there some way to include, and link to, HTML in Sphinx output?

Thanks!

--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sphinx-dev/-/QHOAP99XIO0J.
To post to this group, send email to sphin...@googlegroups.com.
To unsubscribe from this group, send email to sphinx-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.



--
gilberto dos santos alves
+55.11.98646-5049
são paulo - sp - brasil





Takayuki Shimizukawa

unread,
Oct 30, 2012, 12:22:34 AM10/30/12
to sphin...@googlegroups.com
Hi James,

`intersphinx` will meet your needs.

`intersphinx` support to link another 'Sphinx Document' by using
inventory like 'objects.inv'.
But if you generate inventory by hand (or some program), you can use
this mechanism.
I wrote a sample: https://gist.github.com/3978232

intersphinx reference is here: http://sphinx.pocoo.org/ext/intersphinx.html

Best regards,
--
Takayuki SHIMIZUKAWA
Sphinx-users.jp

2012/10/23 James Brady <ja...@trigger.io>:

Kevin Horn

unread,
Oct 30, 2012, 10:09:56 AM10/30/12
to sphinx...@googlegroups.com
On Mon, Oct 22, 2012 at 11:25 AM, James Brady <ja...@trigger.io> wrote:

> Hi all, we're documenting a project which includes some Java APIs, and
> we'd really like to include the pre-generated Javadocs with the Sphinx docs.
>
> Of course, we could put the HTML in the static directory, but I'm not sure
> how to link to it without using absolute links.
>
> Is there some way to include, and link to, HTML in Sphinx output?
>
> Thanks!
>

James,

If what you want is to include your generated Javadocs as HTML and link to
them, what I would probably do (and have done in the past) is to write a
small sphinx extension for a custom role to create your links. It's pretty
easy (probably easier than you think) though not terribly well documented
anywhere that I know of.

If you'd like to see some example code though, there's a "traclinks"
extension in the sphinx-contrib repo:
https://bitbucket.org/birkenfeld/sphinx-contrib/src/d9788a8b567d/traclinks?at=default

and the PyDoctor project also has a similar one:
http://bazaar.launchpad.net/~mwhudson/pydoctor/dev/view/head:/apilinks_sphinxext.py

which does almost exactly what you are talking about, except it links to
PyDoctor-generated HTML, rather than Jaavdoc-generated HTML.

You can probably find other examples floating around the net.

(fair warning, I wrote both of these, so use at your own risk ;) )

[If I'm totally misunderstanding what you want, and you really want to
include excerpts of HTML _within_ a RestructuredText page, then just use
the "raw" directive.]

--
Kevin Horn
Reply all
Reply to author
Forward
0 new messages