asciidoctor / docgist

Render AsciiDoc documents from Gists, GitHub, DropBox and other remote sources in the browser.
http://gist.asciidoctor.org
57 stars 79 forks source link

Link to included document not working. #18

Closed jmini closed 8 years ago

jmini commented 9 years ago

I am not sure what the safe mode used by gist.asciidoctor.org is.

I am trying to render this document:

The includes are replaced by links, maybe because we the safe mode is set to secure. This is Ok for me.

It would be great to have the links working and pointing to the corresponding page in the gist.asciidoctor.org preview.

For example the first link ../../../../adoc/CreateNewProject.adoc should point to the preview page adoc/CreateNewProject.adoc.

nawroth commented 9 years ago

This is a good suggestion. Based on the work with the images, it shouldn't be too hard to implement.

mojavelinux commented 9 years ago

I think it's reasonable to assume we can get includes working (filed as #11). The link feature is really only intended to be used on GitHub where we have no authority to enable includes (so we needed to provide a concession in the interim).

nawroth commented 9 years ago

Right, rewriting the links would just be a temporary fix until we get includes working. Getting those working is a larger piece of work though.

mojavelinux commented 9 years ago

rewriting the links would just be a temporary fix until we get includes working.

Totally reasonable.

nawroth commented 8 years ago

The URLs get quite crazy when browsing into folders, that should be fixed at some point.

nawroth commented 8 years ago

Example: http://goo.gl/1pGe3B

mojavelinux commented 8 years ago

Are you referring to recursive includes? If so, there is a parameter to guard against this. max-include-depth I think.

nawroth commented 8 years ago

It doesn't resolve ../ etc in URLs, but just appends it which works but makes the URL very long, especially after some browsing. Example: http://gist.asciidoctor.org/?github-asciidoctor%2Fdocgist%2F%2Fgists%2Fincludes%2F..%2Fincludes%2F..%2Fincludes%2F..%2Fincludes%2F..%2Fincludes%2F..%2Fincludes%2F..%2Fincludes%2F..%2Fincludes%2F..%2Fincludes.adoc I'm surprised it works!

mojavelinux commented 8 years ago

Oh, I see what you mean. Actually, I'm not too surprised it works because inside of Asciidoctor we normalize paths like crazy. So once it reads in the path, it resolves it down to a simple path and then processes it...at least, I'm pretty sure about that.