added hyperlinks for every file pointer
authorChristian Urban <urbanc@in.tum.de>
Tue, 17 Mar 2009 12:26:34 +0100
changeset 182 4d0e2edd476d
parent 181 5baaabe1ab92
child 183 8bb4eaa2ec92
added hyperlinks for every file pointer
CookBook/Appendix.thy
CookBook/Intro.thy
CookBook/antiquote_setup.ML
cookbook.pdf
--- a/CookBook/Appendix.thy	Tue Mar 17 11:47:01 2009 +0100
+++ b/CookBook/Appendix.thy	Tue Mar 17 12:26:34 2009 +0100
@@ -3,6 +3,7 @@
 imports Main
 begin
 
+
 text {* \appendix *}
 
 
--- a/CookBook/Intro.thy	Tue Mar 17 11:47:01 2009 +0100
+++ b/CookBook/Intro.thy	Tue Mar 17 12:26:34 2009 +0100
@@ -109,6 +109,10 @@
   Further information or pointers to files.
   \end{readmore}
 
+  The pointers to Isabelle files are hyperlinked to the tip of the Mercurial
+  repository of Isabelle at \href{http://isabelle.in.tum.de/repos/isabelle/}
+  {http://isabelle.in.tum.de/repos/isabelle/}.
+
   A few exercises are scattered around the text. Their solutions are given 
   in Appendix~\ref{ch:solutions}. Of course, you learn most, if you first try
   to solve the exercises on your own, and then look at the solutions.
--- a/CookBook/antiquote_setup.ML	Tue Mar 17 11:47:01 2009 +0100
+++ b/CookBook/antiquote_setup.ML	Tue Mar 17 12:26:34 2009 +0100
@@ -80,10 +80,18 @@
 val _ = ThyOutput.antiquotation "ML_response_fake" two_args output_response_fake
 val _ = ThyOutput.antiquotation "ML_response_fake_both" two_args ouput_response_fake_both
 
+fun href_link txt =
+let 
+  val raw = Symbol.encode_raw
+  val path = "http://isabelle.in.tum.de/repos/isabelle/raw-file/tip/src/"    
+in
+ (raw "\\href{") ^ (raw path) ^ (raw txt) ^ (raw "}{") ^ txt ^ (raw "}")
+end 
+
 (* checks whether a file exists in the Isabelle distribution *)
 fun check_file_exists _ txt =
   (if File.exists (Path.append (Path.explode ("~~/src")) (Path.explode txt)) 
-   then output_fn (string_explode "" txt)
+   then output_fn [href_link txt]
    else error ("Source file " ^ (quote txt) ^ " does not exist."))
 
 val _ = ThyOutput.antiquotation "ML_file" single_arg check_file_exists
Binary file cookbook.pdf has changed