Skip to content

[Bioc-devel] Package reference manuals in html

11 messages · Sean Davis, Robert M. Flight, Kasper Daniel Hansen +1 more

#
Dear all,

I'm following up re my online references suggestion with my recent
experience with Hadley's pkgdown package

  https://github.com/hadley/pkgdown

It doesn't address the cross-package issue (which is a difficult one
anyway), but does pretty much everything else (with some caveats though,
see below).

Here are 2 examples 

- MSnbase: http://lgatto.github.io/MSnbase/
- hpar: http://lgatto.github.io/hpar/

It uses the REAMDE file as index page, creates html documents for all Rd
files in man, an article tab for vignettes (but see below) and a News
tab (but see below)

The biggest caveats is that only Rmd vignettes are taken into account;
Rnw are completely ignored (they don't show up at all in the Articles
tab). This is not going to be tackled by the developer [1].

[1] https://github.com/hadley/pkgdown/issues/220

I had a quick look at the code and patching pkgdown (and probably
rmarkdown) to build Rnw/pdf vignettes would take too much time I could
devote at the moment. I would be satisfied if the Rnw were not build but
at least there were links in the Articles tab pointing to the vignettes
Bioconductor landing pages. On the other hand, I am migrating to
BiocStyle's html_document2 with the nice floating table of contents...

Regarding the News tab, only NEWS.md (markdown format) are considered;
NEWS in Rd are ignored too. 

Hope this helps.

Best wishes,

Laurent
On 16 March 2016 23:33, Andrzej Ole? wrote:

            

  
    
#
There's actually another side-effect for Bioconductor. The package
website is (by default) generated in the package's ./docs
directory. This is very handy, as it can be set directly on Github as a
Github page and becomes available as https://username.github.io/pkgname.

This also means that the docs directory (which is about 5.5M for
MSnbase) ends up on hedgehog. It is easy for it not to be part of the
package build artefact using .Rbuildignore, but I am not sure how to
easily push it to github but not hedgehog when using git-svn.

Laurent
On 23 December 2016 16:36, Laurent Gatto wrote:

            

  
    
#
Github allows you to set the branch for the docs directory if I recall.  Perhaps a separate branch with a docs directory (not master) is a viable way to go?

Sean
#
Yes, this seems like a time where using a non-standard site directory on
Github is useful, or as Sean said, using a separate branch to serve the
html content.

-Robert
On Fri, Dec 23, 2016 at 12:19 PM Sean Davis <seandavi at gmail.com> wrote:

            

  
  
#
Seems to be a good start.

But I don't understand why NEWS.md is ok and NEWS.Rd is ignored, given than
NEWS.md is not (I think) compatible and NEWS.Rd is.

Best,
Kasper

On Fri, Dec 23, 2016 at 12:24 PM, Robert M. Flight <rflight79 at gmail.com>
wrote:

  
  
#
Dear Sean and Robert,
On 23 December 2016 17:24, Robert M. Flight wrote:

            
It's not clear to me how a separate branch is the solution. In git-svn,
devel, release_3_4, ... are just that, different branches. How would you
set a gh-pages branch that contains a single dir so that it doesn't
conflict with master?

If I could set branch-specific directives in my .gitignore file, then I
would set this up for the Bioc branches. This seems to suggest it is
possible, but I haven't tried yet

 http://stackoverflow.com/questions/1836742/using-git-how-do-i-ignore-a-file-in-one-branch-but-have-it-committed-in-another

Would it be possible to set something on the svn side to ignore/delete
the docs dir automatically, independently of what git does?

Laurent

  
    
#
On 23 December 2016 17:52, Kasper Daniel Hansen wrote:

            
What is irritating is that NEWS.md is not (yet?) supported by news()!

I say not yet because there's a currenlty unused format argument to
news, so there's hope.

Laurent

  
    
#
They are "orphan" branches, so they don't follow the parent. This was the
original protocol for creating project pages on github for the longest
time, you can see an example in the documentation here:
https://help.github.com/articles/creating-project-pages-using-the-command-line/

They are a pain in the butt to work with, for sure. When I've done
deploying vignettes from travis, my solution was to create a separate repo
entirely, and then push from the master to gh-pages, as shown in this shell
script:
https://github.com/rmflight/categoryCompare/blob/master/.push_gh_pages.sh

I'm sure the same could be done using pkgdown.

If you don't like the idea of overwriting, Steph Locke has a guide to
keeping up with changes, but still autodeploying the docs
https://itsalocke.com/auto-deploying-documentation-better-change-tracking-artefacts/

HTH

Robert
On Fri, Dec 23, 2016 at 1:14 PM Laurent Gatto <lg390 at cam.ac.uk> wrote:

            

  
  
#
On 23 December 2016 18:26, Robert M. Flight wrote:

            
Thanks, Robert, I will explore this solution too.

Laurent

  
    
#
Dear all,

I ended up implementing the branch specific .gitingore hack described in
on Stackoverflow

  http://stackoverflow.com/questions/29579546/git-excludesfile-for-a-branch/29583813#29583813

My notes and implementation are available here

  http://lgatto.github.io/branch-specific-gitignore/

Best wishes,

Laurent
On 23 December 2016 18:14, Laurent Gatto wrote:

            

  
    
4 days later
#
On 23 December 2016 16:36, Laurent Gatto wrote:

            
And, NEWS.md does not work (yet?) with the news() function.

As a workaround to this, a regular expression such as the following
(this is the make recipe from [1])

 NEWS: #' create plain text NEWS from NEWS.md if available
         test -f ${PKGDIR}/NEWS.md && sed 's/^# .*$$\|^## //g' ${PKGDIR}/NEWS.md > ${PKGDIR}/NEWS

can convert the markdown version to a regular text file. This allows to
use the news() function and benefit from a nice only md version.

To keep things tidy, one can then add the NEWS.md in .Rbuildignore and
NEWS to .gitignore, to keep only the relevant file in the package
bundle/repo.

Laurent

[1] https://github.com/computationalproteomicsunit/maker