Re: [Rd] Link to pdf documentation from other package ?

2009-11-24 Thread Ulrike Groemping


Duncan Murdoch-2 wrote:
 
 On 11/18/2009 8:01 AM, ml-it-r-de...@epigenomics.com wrote:
 Ulrike Grömping wrote, On 11/18/09 13:28:
 Duncan Murdoch schrieb:
 Ulrike Groemping wrote:

 Duncan Murdoch-2 wrote:
  
 Ulrike Groemping wrote:
   
 Dear developeRs,

 I have not found anything recent about how to link to a vignette or
 other
 documentation from within Rd-files. Is this now possible with the
 new
 help
 system ? For example, I would like to link to the file AlgDesign.pdf
 provided within the doc directory of package AlgDesign.

 
 Yes, you can do it with a \url{} macro.  Use a relative link, acting
 as though the starting page is located in
 /library/AlgDesign/html/*.  So \url{../doc/AlgDesign.pdf}
 should work from the same package,
 \url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let
 me know if this doesn't work, I haven't tested.

 Duncan Murdoch
 

 Yes, this works, thanks! Is it also possible to display an
 alternative text
 instead of the URL itself, like with other links (e.g. show text
 Open pdf
 that operates the link) ?

   
 ...
 Within the dynamic help, you're also restricted in what files you can 
 link to:  they need to be help pages, or files in the doc directory of a 
 package, or a few other special cases.
 
 Duncan Murdoch
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel
 
 

Good that you mention this restriction, this makes me understand my new
problem. With his new version of AlgDesign, Bob Wheeler has made the file
AlgDesign.pdf into a vignette which is no longer located in the doc
directory but now in inst/doc. A link to that file from within my
documentation does not work any longer. Would it be possible to include the
directory inst/doc into the special cases to which linking is permitted ?

Regards,
Ulrike 

-- 
View this message in context: 
http://old.nabble.com/Link-to-pdf-documentation-from-other-package---tp26405139p26495528.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-24 Thread Gabor Grothendieck
On Wed, Nov 18, 2009 at 8:29 AM, Duncan Murdoch murd...@stats.uwo.ca wrote:
 you could use the Sweave like macro to compute the path inside the Rd
 environments

 \Sexpr{file.path(system.file(package=AlgDesign, doc),
 AlgDesign.pdf)}

 described in 'Writing R extensions' 2.11

 http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Dynamic-pages


 That won't work with dynamic help. (It surprised me, too.)  You can't link
 to the file system from within the dynamic help pages.  You can't link to a
 file:// link, which is what you'd need to get that to work.

 This is a browser restriction, for security reasons.  You don't want

I am able to read files from my file system from the browser.  For
example enter this into the Windows command line:

echo some dummy text  dummy.html
echo a href=dummy.htmldummy/a  test-read-file.html
test-read-file.html

and click on dummy when the contents of test-read-file.html appears in
the browser.

For me, it causes the contents of the dummy.html file to appear in the
browser.  I am on Windows Vista and I tried it in IE8, Firefox 3.5.5
and Chrome 3.0 and it worked in all three.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-24 Thread Duncan Murdoch

On 11/24/2009 8:06 AM, Ulrike Groemping wrote:


Duncan Murdoch-2 wrote:


On 11/18/2009 8:01 AM, ml-it-r-de...@epigenomics.com wrote:

Ulrike Grömping wrote, On 11/18/09 13:28:

Duncan Murdoch schrieb:

Ulrike Groemping wrote:


Duncan Murdoch-2 wrote:
 

Ulrike Groemping wrote:
  

Dear developeRs,

I have not found anything recent about how to link to a vignette or
other
documentation from within Rd-files. Is this now possible with the
new
help
system ? For example, I would like to link to the file AlgDesign.pdf
provided within the doc directory of package AlgDesign.



Yes, you can do it with a \url{} macro.  Use a relative link, acting
as though the starting page is located in
/library/AlgDesign/html/*.  So \url{../doc/AlgDesign.pdf}
should work from the same package,
\url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let
me know if this doesn't work, I haven't tested.

Duncan Murdoch



Yes, this works, thanks! Is it also possible to display an
alternative text
instead of the URL itself, like with other links (e.g. show text
Open pdf
that operates the link) ?

  

...
Within the dynamic help, you're also restricted in what files you can 
link to:  they need to be help pages, or files in the doc directory of a 
package, or a few other special cases.


Duncan Murdoch
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel




Good that you mention this restriction, this makes me understand my new
problem. With his new version of AlgDesign, Bob Wheeler has made the file
AlgDesign.pdf into a vignette which is no longer located in the doc
directory but now in inst/doc. A link to that file from within my
documentation does not work any longer. Would it be possible to include the
directory inst/doc into the special cases to which linking is permitted ?


When you install the package, the contents of inst/doc would normally be 
copied to the doc directory.  Can you expand on why that doesn't happen 
in your case?


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-24 Thread Gabor Grothendieck
On Tue, Nov 24, 2009 at 10:26 AM, Duncan Murdoch murd...@stats.uwo.ca wrote:
 On 11/24/2009 8:20 AM, Gabor Grothendieck wrote:

 On Wed, Nov 18, 2009 at 8:29 AM, Duncan Murdoch murd...@stats.uwo.ca
 wrote:

 you could use the Sweave like macro to compute the path inside the Rd
 environments

 \Sexpr{file.path(system.file(package=AlgDesign, doc),
 AlgDesign.pdf)}

 described in 'Writing R extensions' 2.11


 http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Dynamic-pages


 That won't work with dynamic help. (It surprised me, too.)  You can't
 link
 to the file system from within the dynamic help pages.  You can't link to
 a
 file:// link, which is what you'd need to get that to work.

 This is a browser restriction, for security reasons.  You don't want

 I am able to read files from my file system from the browser.  For
 example enter this into the Windows command line:

 echo some dummy text  dummy.html
 echo a href=dummy.htmldummy/a  test-read-file.html
 test-read-file.html

 and click on dummy when the contents of test-read-file.html appears in
 the browser.

 For me, it causes the contents of the dummy.html file to appear in the
 browser.  I am on Windows Vista and I tried it in IE8, Firefox 3.5.5
 and Chrome 3.0 and it worked in all three.

 The rule in most browsers is that pages retrieved via http:// links can't
 link to file:// links.  Presumably your local file was already a file://
 link.

But the help files are local.  It would seem that this problem would
be addressed if the help files were not displayed using http://

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-24 Thread groemping
* 
Prof. Dr. Ulrike Grömping 
Fachbereich II 
BHT Berlin (ehemals TFH Berlin) 
Luxemburger Str. 10 
13353 Berlin 
Tel.: +49 (0)30 4504 5127 
Fax.: +49 (0)30 4504 66 5127 
mail: groemp...@bht-berlin.de 
www: http://prof.tfh-berlin.de/groemping/ 
*

-- Original Message ---
From: Duncan Murdoch murd...@stats.uwo.ca 
To: Ulrike Groemping gro...@beuth-hochschule.de 
Cc: r-devel@r-project.org 
Sent: Tue, 24 Nov 2009 10:31:50 -0500 
Subject: Re: [Rd] Link to pdf documentation from other package ?

 On 11/24/2009 8:06 AM, Ulrike Groemping wrote: 
  
  Duncan Murdoch-2 wrote: 
  
  On 11/18/2009 8:01 AM, ml-it-r-de...@epigenomics.com wrote: 
  Ulrike Grömping wrote, On 11/18/09 13:28: 
  Duncan Murdoch schrieb: 
  Ulrike Groemping wrote: 
  
  Duncan Murdoch-2 wrote: 
    
  Ulrike Groemping wrote: 
    
  Dear developeRs, 
  
  I have not found anything recent about how to link to a vignette or 
  other 
  documentation from within Rd-files. Is this now possible with the 
  new 
  help 
  system ? For example, I would like to link to the file AlgDesign.pdf 
  provided within the doc directory of package AlgDesign. 
  
          
  Yes, you can do it with a \url{} macro.  Use a relative link, acting 
  as though the starting page is located in 
  /library/AlgDesign/html/*.  So \url{../doc/AlgDesign.pdf} 
  should work from the same package, 
  \url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let 
  me know if this doesn't work, I haven't tested. 
  
  Duncan Murdoch 
      
  
  Yes, this works, thanks! Is it also possible to display an 
  alternative text 
  instead of the URL itself, like with other links (e.g. show text 
  Open pdf 
  that operates the link) ? 
  
    
  ... 
  Within the dynamic help, you're also restricted in what files you can 
  link to:  they need to be help pages, or files in the doc directory of a 
  package, or a few other special cases. 
  
  Duncan Murdoch 
  __ 
  R-devel@r-project.org mailing list 
  https://stat.ethz.ch/mailman/listinfo/r-devel 
  
  
  
  Good that you mention this restriction, this makes me understand my new 
  problem. With his new version of AlgDesign, Bob Wheeler has made the file 
  AlgDesign.pdf into a vignette which is no longer located in the doc 
  directory but now in inst/doc. A link to that file from within my 
  documentation does not work any longer. Would it be possible to include the 
  directory inst/doc into the special cases to which linking is permitted ? 
 
 When you install the package, the contents of inst/doc would normally be 
 copied to the doc directory.  Can you expand on why that doesn't happen 
 in your case? 
 
 Duncan Murdoch 
--- End of Original Message ---

I'm sorry, you are right, this hasn't changed anything, I can still use the doc 
link, 
I was making false assumptions based on the fact that Bob told me he had 
changed 
the status of the pdf and checked that inst/doc had it now but not that doc 
didn't.

Regards, Ulrike
 

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-24 Thread hadley wickham
 But the help files are local.  It would seem that this problem would
 be addressed if the help files were not displayed using http://

But then they couldn't be dynamic.

One solution which would allow both would be to implement a proxy
within the dynamic help that could point to any file on the file
system.  Of course this is a rather large security risk.

Hadley


-- 
http://had.co.nz/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-24 Thread Simon Urbanek


On Nov 24, 2009, at 10:58 , hadley wickham wrote:


But the help files are local.  It would seem that this problem would
be addressed if the help files were not displayed using http://


But then they couldn't be dynamic.

One solution which would allow both would be to implement a proxy
within the dynamic help that could point to any file on the file
system.


That is already implemented but not allowed in unsafe directories for  
security reasons (see previous discussion).


Cheers,
Simon

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-18 Thread Duncan Murdoch

Ulrike Groemping wrote:

Dear developeRs,

I have not found anything recent about how to link to a vignette or other
documentation from within Rd-files. Is this now possible with the new help
system ? For example, I would like to link to the file AlgDesign.pdf
provided within the doc directory of package AlgDesign.

  


Yes, you can do it with a \url{} macro.  Use a relative link, acting as 
though the starting page is located in /library/AlgDesign/html/*.  So 
\url{../doc/AlgDesign.pdf}
should work from the same package, 
\url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let me 
know if this doesn't work, I haven't tested.


Duncan Murdoch

Thanks for any suggestions,
regards, Ulrike 



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-18 Thread Ulrike Groemping



Duncan Murdoch-2 wrote:
 
 Ulrike Groemping wrote:
 Dear developeRs,

 I have not found anything recent about how to link to a vignette or other
 documentation from within Rd-files. Is this now possible with the new
 help
 system ? For example, I would like to link to the file AlgDesign.pdf
 provided within the doc directory of package AlgDesign.

   
 
 Yes, you can do it with a \url{} macro.  Use a relative link, acting as 
 though the starting page is located in /library/AlgDesign/html/*.  So 
 \url{../doc/AlgDesign.pdf}
 should work from the same package, 
 \url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let me 
 know if this doesn't work, I haven't tested.
 
 Duncan Murdoch
 

Yes, this works, thanks! Is it also possible to display an alternative text
instead of the URL itself, like with other links (e.g. show text Open pdf
that operates the link) ?

Regards, Ulrike

-- 
View this message in context: 
http://old.nabble.com/Link-to-pdf-documentation-from-other-package---tp26405139p26406675.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-18 Thread Duncan Murdoch

Ulrike Groemping wrote:


Duncan Murdoch-2 wrote:
  

Ulrike Groemping wrote:


Dear developeRs,

I have not found anything recent about how to link to a vignette or other
documentation from within Rd-files. Is this now possible with the new
help
system ? For example, I would like to link to the file AlgDesign.pdf
provided within the doc directory of package AlgDesign.

  
  
Yes, you can do it with a \url{} macro.  Use a relative link, acting as 
though the starting page is located in /library/AlgDesign/html/*.  So 
\url{../doc/AlgDesign.pdf}
should work from the same package, 
\url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let me 
know if this doesn't work, I haven't tested.


Duncan Murdoch




Yes, this works, thanks! Is it also possible to display an alternative text
instead of the URL itself, like with other links (e.g. show text Open pdf
that operates the link) ?

  


There's no optional text in the \url{} tag, but you could embed it in an 
\ifelse tag, e.g.


\ifelse{html}{\url{   }}{ [open pdf ...] }

might work.  Using the \ifelse tag will make your package depend on R = 
2.10.0.


Duncan Murdoch




__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-18 Thread Ulrike Grömping

Duncan Murdoch schrieb:

Ulrike Groemping wrote:


Duncan Murdoch-2 wrote:
 

Ulrike Groemping wrote:
   

Dear developeRs,

I have not found anything recent about how to link to a vignette or 
other

documentation from within Rd-files. Is this now possible with the new
help
system ? For example, I would like to link to the file AlgDesign.pdf
provided within the doc directory of package AlgDesign.


Yes, you can do it with a \url{} macro.  Use a relative link, acting 
as though the starting page is located in 
/library/AlgDesign/html/*.  So \url{../doc/AlgDesign.pdf}
should work from the same package, 
\url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let 
me know if this doesn't work, I haven't tested.


Duncan Murdoch




Yes, this works, thanks! Is it also possible to display an 
alternative text
instead of the URL itself, like with other links (e.g. show text 
Open pdf

that operates the link) ?

  


There's no optional text in the \url{} tag, but you could embed it in 
an \ifelse tag, e.g.


\ifelse{html}{\url{   }}{ [open pdf ...] }

might work.  Using the \ifelse tag will make your package depend on R 
= 2.10.0.


Duncan Murdoch
  
Another thought: the link only works, if the two packages are installed 
in the same library, doesn't it ? Would there be a way to make it work 
independently of this restriction ?


Regards, Ulrike

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-18 Thread ml-it-r-devel
Ulrike Grömping wrote, On 11/18/09 13:28:
 Duncan Murdoch schrieb:
 Ulrike Groemping wrote:

 Duncan Murdoch-2 wrote:
  
 Ulrike Groemping wrote:
   
 Dear developeRs,

 I have not found anything recent about how to link to a vignette or
 other
 documentation from within Rd-files. Is this now possible with the new
 help
 system ? For example, I would like to link to the file AlgDesign.pdf
 provided within the doc directory of package AlgDesign.

 
 Yes, you can do it with a \url{} macro.  Use a relative link, acting
 as though the starting page is located in
 /library/AlgDesign/html/*.  So \url{../doc/AlgDesign.pdf}
 should work from the same package,
 \url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let
 me know if this doesn't work, I haven't tested.

 Duncan Murdoch

 

 Yes, this works, thanks! Is it also possible to display an
 alternative text
 instead of the URL itself, like with other links (e.g. show text
 Open pdf
 that operates the link) ?

   

 There's no optional text in the \url{} tag, but you could embed it in
 an \ifelse tag, e.g.

 \ifelse{html}{\url{   }}{ [open pdf ...] }

 might work.  Using the \ifelse tag will make your package depend on R
 = 2.10.0.

 Duncan Murdoch
   
 Another thought: the link only works, if the two packages are installed
 in the same library, doesn't it ? Would there be a way to make it work
 independently of this restriction ?

you could use the Sweave like macro to compute the path inside the Rd 
environments

\Sexpr{file.path(system.file(package=AlgDesign, doc), AlgDesign.pdf)}

described in 'Writing R extensions' 2.11
http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Dynamic-pages

 Regards, Ulrike
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel
 


-- 
Matthias Burger Project Manager/ Biostatistician
Epigenomics AGKleine Praesidentenstr. 110178 Berlin, Germany
phone:+49-30-24345-0fax:+49-30-24345-555
http://www.epigenomics.com   matthias.bur...@epigenomics.com
--
Epigenomics AG Berlin   Amtsgericht Charlottenburg HRB 75861
Vorstand:   Geert Nygaard (CEO/Vorsitzender)
Oliver Schacht PhD (CFO)
Aufsichtsrat:   Prof. Dr. Dr. hc. Rolf Krebs (Chairman/Vorsitzender)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-18 Thread Duncan Murdoch

On 11/18/2009 7:28 AM, Ulrike Grömping wrote:

Duncan Murdoch schrieb:

Ulrike Groemping wrote:


Duncan Murdoch-2 wrote:
 

Ulrike Groemping wrote:
   

Dear developeRs,

I have not found anything recent about how to link to a vignette or 
other

documentation from within Rd-files. Is this now possible with the new
help
system ? For example, I would like to link to the file AlgDesign.pdf
provided within the doc directory of package AlgDesign.


Yes, you can do it with a \url{} macro.  Use a relative link, acting 
as though the starting page is located in 
/library/AlgDesign/html/*.  So \url{../doc/AlgDesign.pdf}
should work from the same package, 
\url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let 
me know if this doesn't work, I haven't tested.


Duncan Murdoch




Yes, this works, thanks! Is it also possible to display an 
alternative text
instead of the URL itself, like with other links (e.g. show text 
Open pdf

that operates the link) ?

  


There's no optional text in the \url{} tag, but you could embed it in 
an \ifelse tag, e.g.


\ifelse{html}{\url{   }}{ [open pdf ...] }

might work.  Using the \ifelse tag will make your package depend on R 
= 2.10.0.


Duncan Murdoch
  
Another thought: the link only works, if the two packages are installed 
in the same library, doesn't it ? Would there be a way to make it work 
independently of this restriction ?


With dynamic help, it doesn't matter where they are installed.  If you 
install the static HTML pages, then it matters.


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Link to pdf documentation from other package ?

2009-11-18 Thread Duncan Murdoch

On 11/18/2009 8:01 AM, ml-it-r-de...@epigenomics.com wrote:

Ulrike Grömping wrote, On 11/18/09 13:28:

Duncan Murdoch schrieb:

Ulrike Groemping wrote:


Duncan Murdoch-2 wrote:
 

Ulrike Groemping wrote:
  

Dear developeRs,

I have not found anything recent about how to link to a vignette or
other
documentation from within Rd-files. Is this now possible with the new
help
system ? For example, I would like to link to the file AlgDesign.pdf
provided within the doc directory of package AlgDesign.



Yes, you can do it with a \url{} macro.  Use a relative link, acting
as though the starting page is located in
/library/AlgDesign/html/*.  So \url{../doc/AlgDesign.pdf}
should work from the same package,
\url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere.  Please let
me know if this doesn't work, I haven't tested.

Duncan Murdoch




Yes, this works, thanks! Is it also possible to display an
alternative text
instead of the URL itself, like with other links (e.g. show text
Open pdf
that operates the link) ?

  


There's no optional text in the \url{} tag, but you could embed it in
an \ifelse tag, e.g.

\ifelse{html}{\url{   }}{ [open pdf ...] }

might work.  Using the \ifelse tag will make your package depend on R
= 2.10.0.

Duncan Murdoch
  

Another thought: the link only works, if the two packages are installed
in the same library, doesn't it ? Would there be a way to make it work
independently of this restriction ?


you could use the Sweave like macro to compute the path inside the Rd 
environments

\Sexpr{file.path(system.file(package=AlgDesign, doc), AlgDesign.pdf)}

described in 'Writing R extensions' 2.11
http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Dynamic-pages



That won't work with dynamic help. (It surprised me, too.)  You can't 
link to the file system from within the dynamic help pages.  You can't 
link to a file:// link, which is what you'd need to get that to work.


This is a browser restriction, for security reasons.  You don't want 
someone's Javascript to be able to read your private files, because it 
could then send them anywhere.


Within the dynamic help, you're also restricted in what files you can 
link to:  they need to be help pages, or files in the doc directory of a 
package, or a few other special cases.


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel