Skip to content

Add package documentation website - #24

Merged
rsbivand merged 2 commits into
r-spatial:masterfrom
angela-li:master
Dec 10, 2018
Merged

rsbivand merged 2 commits into
r-spatial:masterfrom
angela-li:master

Conversation

@angela-li

Copy link
Copy Markdown
Member

I ran pkgdown::build_site() to generate the docs folder, which produces the package documentation website with Github Pages. I didn't convert the 2 Rnw files to Rmd, so those 2 vignettes don't build in pkgdown, but I can try my hand at that if you'd like.

@rsbivand

Copy link
Copy Markdown
Member

I guess you would have to edit the file excluding docs from the R CMD build process, to prevent the proper R build train getting clogged up by the website, if this goes forward. I always build and check locally before committing and pushing, so its presence may be a problem in itself. I see that sf has a lot in the .Rbuildignore file.

@angela-li

Copy link
Copy Markdown
Member Author

Great point. I updated .Rbuildignore so that docs are excluded from the R CMD build process.

@rsbivand
rsbivand merged commit 5b29183 into r-spatial:master Dec 10, 2018
@rsbivand

Copy link
Copy Markdown
Member

Thanks, merged. I really appreciate your willingness to engage - lets see how this goes.

@rsbivand

Copy link
Copy Markdown
Member

Do you know how to expose docs/index.html as a web page - though README.md - @edzer should it appear anywhere? Is the r-spatial.github.io/spdep location suitable, or rather as suggested above?

@angela-li

Copy link
Copy Markdown
Member Author

You have to change the repository settings I believe. Check out the Github guide on how to publish from docs here.

@edzer

edzer commented Dec 11, 2018

Copy link
Copy Markdown
Member

Settings tab on the top of this page -> GitHub pages -> Source: select "master branch /docs folder". And then it appears at r-spatial.github.io/spdep, sometimes a minute later.

@rsbivand

rsbivand commented Dec 11, 2018 •

Copy link
Copy Markdown
Member

Which is the theme used by sf? - ok, it's minimal

@edzer

edzer commented Dec 11, 2018

Copy link
Copy Markdown
Member

Theme doesn't do anything in this case. Looking great!

@rsbivand

Copy link
Copy Markdown
Member

I added @angela-li to DESCRIPTION. Will docs/authors.html update automatically?

@edzer

edzer commented Dec 11, 2018

Copy link
Copy Markdown
Member

It does after you run devtools::build_site() in the spdep directory, verify by browsing docs/index.html, and on success commit & push the docs directory.

@rsbivand

Copy link
Copy Markdown
Member

Help!:

Building the package will delete...
  '/home/rsb/topics/packages/github/spdep/inst/doc'
Are you sure?

1: Yes
2: No

I have valuable content in inst/doc - stored simulation objects used in an Rnw vignette.

Why is RS/TV so dictatorial?

@edzer

edzer commented Dec 11, 2018

Copy link
Copy Markdown
Member

No clue. Move its contents somewhere else?

@rsbivand

Copy link
Copy Markdown
Member

Moved to inst/etc, I'll see what the dictator stuffs in inst/doc. If it is /docs, I will tear it out and revert to no pkgdown, of course.

@rsbivand

Copy link
Copy Markdown
Member

This message with no explanation.

Error in replayPlot(x) : invalid graphics state

Does devtools::build_site() require that this is done in RS? If so, I will not use it.

@rsbivand

Copy link
Copy Markdown
Member

Further, vignettes/nb_igraph.Rmd comes up with UNKOWN TITLE, then flips to its title. A big mess, really not worth the trouble. Examples are to be run, not looked at!!!

@edzer

edzer commented Dec 11, 2018

Copy link
Copy Markdown
Member

I see the replayPlot error too in Rstudio, and no articles (vignettes). @angela-li which setup did you use to generate the docs?

@rsbivand

Copy link
Copy Markdown
Member

Same replayPlot in RS. No idea where it comes from. Committing and pushing, will raise issue for someone else to sort out - I do not have the time or patience to adapt to RS/DS etc.

@rsbivand

Copy link
Copy Markdown
Member

Wow - this pkgdown rubbish has peppered /src with *.o and spdep.so, presumably because it builds in-tree and only cleans later. It also put

	docs/docsearch.js
	docs/reference/nboperations-2.png
	docs/reference/nboperations-3.png

in the package tree. What a mess! Issue possibly in or after docs/reference/residuals.sarlm.html as subsequent files not in commit list.

@rsbivand

rsbivand commented Dec 11, 2018 •

Copy link
Copy Markdown
Member

And the real disaster - the examples in reference pages omit \dontrun examples, which must be displayed without exception!!! All \donttest should be shown but not run (it seems to try to run them and fails), all \dontrun should be shown. I put a lot of time into exposing the corner cases in the examples, together with user comments accumulated over twenty years. The must be exposed. If pkgdown is not accommodating, it is not fit for purpose. - I'll try build_site(run_dont_run=TRUE).

@rsbivand

Copy link
Copy Markdown
Member

Running pkgdown::build_site(run_dont_run=TRUE) does display output, so maybe the error can be traced.

@rsbivand

rsbivand commented Dec 11, 2018 •

Copy link
Copy Markdown
Member
Reading 'man/rotation.Rd'
<simpleError in replayPlot(x): invalid graphics state>
Warning messages:
1: In matrix(cell_contents, ncol = length(align), byrow = TRUE) :
  data length [39] is not a sub-multiple or multiple of the number of rows [10]
2: In matrix(cell_contents, ncol = length(align), byrow = TRUE) :
  data length [113] is not a sub-multiple or multiple of the number of rows [29]
Error in replayPlot(x) : invalid graphics state

No problem at all running in terminal or in the RS console. Errant image says:

rotation-1

@rsbivand

rsbivand commented Dec 11, 2018 •

Copy link
Copy Markdown
Member

Resolved by editing example to reduce plot margins. However, pkgdown::build_site() still leaves src/*.o and src/*.so

@rsbivand

rsbivand commented Dec 11, 2018 •

Copy link
Copy Markdown
Member

The authors.html link was visible in the preview, but is no longer visible from index.html. I give up ...

@angela-li

Copy link
Copy Markdown
Member Author

The site looks good! In the future, you can just rebuild the home page to update authors (without rebuilding all the documentation from scratch) with pkgdown::build_home()), instead of build_site(), which does the whole site (and has the replayPlot issue - I ran into that too...). You can also just rebuild individual sections of the site, like vignettes, the reference section, and articles - see here for info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants