Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make preferably work with devel version of pkgdown #8

Closed
wviechtb opened this issue Oct 20, 2021 · 8 comments
Closed

Make preferably work with devel version of pkgdown #8

wviechtb opened this issue Oct 20, 2021 · 8 comments

Comments

@wviechtb
Copy link
Contributor

At the moment, preferably doesn't seem to work together with the development version of pkgdown. After remotes::install_github("r-lib/pkgdown"), trying to build the docs leads to:

Error in readLines(con) : cannot open the connection
Calls: <Anonymous> ... %||% -> <Anonymous> -> yaml.load -> paste -> readLines
In addition: Warning message:
In readLines(con) :
  cannot open file '/home/wviechtb/rlib/4.1/preferably/pkgdown/_pkgdown.yml': No such file or directory
Execution halted

There are some useful developments in pkgdown that I would like to take advantage of and at the same time use the very nice preferably template. I understand that making preferably compatible with the devel version of pkgdown is a bit like shooting at a moving target, but sooner or later, when a new version of pkgdown is released on CRAN, this will become an issue. Maybe there is even a simple fix (seems like a _pkgdown.yml file needs to be bundled with preferably, although I don't know exactly what needs to go in there). In any case, I thought I would bring this to your attention.

@amirmasoudabdol
Copy link
Owner

Hi @wviechtb, thanks for bringing this to my attention. I am following the dev branch, but they have changed course a few times and I stopped tweaking things until the settle on something; which I think they finally did. In coming weeks, {pkgdown} 2.0 will be released, and I will make sure that {preferably} works with it. I will let you know when I have my dev branch up and running.

@wviechtb
Copy link
Contributor Author

wviechtb commented Nov 2, 2021

Great - and at the moment, preferably seems to work just fine with the current development version of pkgdown (see here: https://wviechtb.github.io/metafor/ -- this was built yesterday). The only thing that is slightly off is at the very bottom where it says "Developed by ." (should show the package author name there) but otherwise everything is fine, so maybe this was a false alarm :)

@amirmasoudabdol
Copy link
Owner

@wviechtb, so {pkgdown} 2.0 is out, and they have moved to BS5. For now, as far as I can tell everything works, but I'm planning a bigger update to support BS5 very soon! :-)

P.S. I have pushed a minor update to fix the footer issues for now!

@amirmasoudabdol
Copy link
Owner

It could still happen that you don't see the footer, and I think that's a bug in {pkgdown}. If that's the case, you may want to add this to your _pkgdown.yml:

footer:
  structure: 
    left: developed_by
    right: built_with

@wviechtb
Copy link
Contributor Author

wviechtb commented Dec 1, 2021

Seems to work just fine, even without having to add the footer part. I tried it also with bootstrap: 5 but that still needs some work it seems. But without this, the pages look as nice as ever with {preferably}!

Not sure if it's just me, but I also see Usage,NULL on pages that do not have a \usage{} section (for example, package intro pages do not typically have this section). This also happens when not using {preferably} so this seems be a {pkgdown} problem.

@amirmasoudabdol
Copy link
Owner

I have looked into the new Bootstrap, and I think I have it running fine after some tweaking. I will take a better look this afternoon, and will submit it to CRAN! :-)

I'm only patching their front-end, so it's very unlikely that {preferably} breaks things like that. They have changed a lot for this release, so, they'll be a few hiccup like this for a while I guess.

@wviechtb
Copy link
Contributor Author

wviechtb commented Dec 2, 2021

Yes, that Usage issue is unrelated to preferably: r-lib/pkgdown#1931 for the moment, I just use sed to remove the offending superfluous entries, but it seems like there is a fix for this already in pkgdown itself. In any case, the updated docs for the metafor package using preferably are up and running at https://wviechtb.github.io/metafor/ and everything looks great. Looking forward to what the new version of preferably will bring eventually.

@amirmasoudabdol
Copy link
Owner

Thanks for using {preferably}! 🎉

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

No branches or pull requests

2 participants