Commit 7b84942e authored by Per Bothner's avatar Per Bothner

Fixes to documentation browsing.

* +default+: Treat empty local-path as index.html (not index.xhtml).
Also, don't bother sending a 301 re-direct - just handle it.
* browse-kawa-manual: No longer use flakey frameset version.
* kawa.texi: Update url for manual.
* with-frames.html: Incomplete fix/update. Probably obsolete.
parent 844ed658
Pipeline #108535798 passed with stage
in 10 minutes and 51 seconds
......@@ -29,15 +29,13 @@
((local-path:endsWith ".js") 'application/javascript)
(else 'application/xhtml+xml)))
(cond ((string=? local-path "") ;; translate default "" to "index.xhtml"
(values
(response-status 301)
(response-header '|Location| "index.xhtml")))
(else
(values
(response-content-type response-type)
(try-catch
&<{jar:&(resource-url "kawa-manual.epub")!/OEBPS/&[local-path]}
(ex java.lang.Throwable
(error-response 404 (format #f "NOT FOUND ~w: ~w"
local-path ex:message)))))))
(if (string=? local-path "")
(set! local-path "index.html"))
(values
(response-content-type response-type)
(try-catch
&<{jar:&(resource-url "kawa-manual.epub")!/OEBPS/&[local-path]}
(ex java.lang.Throwable
(error-response 404 (format #f "NOT FOUND ~w: ~w"
local-path ex:message)))))
2020-01-10 Per Bothner <per@bothner.com>
Fixes to documentation browsing.
* +default+: Treat empty local-path as index.html (not index.xhtml).
Also, don't bother sending a 301 re-direct - just handle it.
* browse-kawa-manual: No longer use flakey frameset version.
* kawa.texi: Update url for manual.
* with-frames.html: Incomplete fix/update. Probably obsolete.
2019-12-31 Per Bothner <per@bothner.com>
* kawa.texi: Document --langserver option, justification format.
......
......@@ -33,8 +33,5 @@ exec ${JAVA-"java"} -jar ${KAWA_HOME}/lib/kawa.jar $thisfile
(let* ((browser (javafx.scene.web.WebView))
(web-engine (browser:getEngine))
(manual-url (resource-url "../doc/kawa-manual.epub")))
;; Using an <iframe> for the sidebar on WebView doesn't work for some
;; unknown reason so we use the <frameset> version instead.
;; (web-engine:load &{jar:&[manual-url]!/OEBPS/index.xhtml})
(web-engine:load &{jar:&[manual-url]!/OEBPS/with-frames.html})
(web-engine:load &{jar:&[manual-url]!/OEBPS/index.html})
browser))
......@@ -1552,7 +1552,7 @@ cd $KAWA_HOME/doc
unzip kawa-manual.epub
@end example
Then you can use a plain browser
with the URL @code{file:$KAWA_HOME/doc/OEBPS/index.xhtml}.
with the URL @code{file:$KAWA_HOME/doc/OEBPS/index.html}.
@node Source distribution, , Binary distribution, Installation
@section Installing and using the source distribution
......
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>Kawa manual</title>
<link rel="up" href="../index.html">
<link rel="top" href="../../index.html">
<script type="text/javascript">
<script type="text/javascript">
// FIXME this needs some work to get working (again).
// (Clicking on links does not work properly.)
// However, it's not clear it's needed (or even useful) anymore.
var sliderBgcolor = "#60ECEC";
function setHash(pathname) {
var contextLength = location.pathname.indexOf("with-frames");
......@@ -12,12 +16,16 @@ function setHash(pathname) {
pathname = pathname.substring(contextLength);
history.replaceState(null, null, "#"+pathname);
};
function receiveMessage(event) {
frames['slider'].postMessage(event.data);
}
function framesetLoaded() {
var hash=top.location.hash;
var main=top.main;
if (hash && main) {
// FUTURE: load specified file into main frame
}
window.addEventListener("message", receiveMessage, false);
}
function framesetUnloaded() {
var request = new XMLHttpRequest();
......@@ -28,6 +36,6 @@ function framesetUnloaded() {
</head>
<frameset cols="280,*" onload="top.framesetLoaded()" onunload="framesetUnloaded()">
<frame name="slider" src="ToC.xhtml">
<frame name="main" src="index.xhtml">
<frame name="main" src="index.html">
</frameset>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment