[Vegan-commits] r1733 - in pkg/vegan: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 19 09:02:08 CEST 2011


Author: jarioksa
Date: 2011-08-19 09:02:08 +0200 (Fri, 19 Aug 2011)
New Revision: 1733

Modified:
   pkg/vegan/R/vegandocs.R
   pkg/vegan/inst/ChangeLog
Log:
use browser to show NEWS if that is the platform default

Modified: pkg/vegan/R/vegandocs.R
===================================================================
--- pkg/vegan/R/vegandocs.R	2011-08-19 06:29:13 UTC (rev 1732)
+++ pkg/vegan/R/vegandocs.R	2011-08-19 07:02:08 UTC (rev 1733)
@@ -10,7 +10,17 @@
             shell.exec(doc)
         else system(paste(getOption("pdfviewer"), doc, "&"))
     } else if (doc == "NEWS") {
-        file.show(tools:::Rd2txt(file.path(path.package("vegan"), "NEWS.Rd"), tempfile()))
+        ## Try html
+        helptype <- getOption("help_type")
+        if (length(helptype) && helptype == "html") {
+            if (!tools:::httpdPort)
+                tools:::startDynamicHelp()
+            browseURL(paste("http://127.0.0.1:", tools:::httpdPort,
+                            "/library/vegan/NEWS", sep=""))
+        } else {
+            file.show(tools:::Rd2txt(file.path(path.package("vegan"),
+                                               "NEWS.Rd"), tempfile()))
+        }
     } else {
         file.show(system.file(package="vegan", doc))
     } 

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-08-19 06:29:13 UTC (rev 1732)
+++ pkg/vegan/inst/ChangeLog	2011-08-19 07:02:08 UTC (rev 1733)
@@ -13,10 +13,13 @@
 	Keeping neat formatting of this file may be challenging to many
 	text editors, but it is worth trying. This file should list the
 	important items for regular vegan users, whereas this ChangeLog
-	should explain the changes to other vegan developers. vegandocs()
-	uses a kluge to show the text formatted NEWS file -- I really do
-	not understand why R core decided to use NEWS format that is not
-	intended to be human readable but is very difficult to access. 
+	should explain the changes to other vegan developers. If
+	getOption("help_type") == "html", should start a browser to show
+	the NEWS, and use text console otherwise ("html" tested on MacOS
+	R.App GUI, text mode in Linux and MacOS bash shells, no testing on
+	Windows yet). However, although the browser knows how to show
+	NEWS.Rd it does not do the formatting: perhaps we need to build a
+	NEWS.html for the purpose, but I do not yet know how to do that.
 	
 Version 1.91-0 (closed August 18, 2011)
 



More information about the Vegan-commits mailing list