-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[R-package] Add pkgdown documentation support #1143
Comments
@Laurae2 For Travis support, you can see: https://github.com/ropenscilabs/tic#example-applications . I would like to contribute to the LightGBM, but I need some time to get familiar to the package functions. |
@Laurae2 Does pkgdown only work for R package ? |
@guolinke pkgdown is only for R, I don't know if there are equivalents existing for Python |
I guess pkgdown runs just like jekyll, you can see the template, and the function render_template and the whisker package. If you want to build a Python package html pages, maybe pystache can give you some hints |
@BruceZhaoR thanks for interesting in contribution. |
@Laurae2 any updates ? |
@guolinke Didn't find time to work on it currently, this month I have more free time so I might try to do it again. |
@Laurae2 I just used pkgdown built my package website: https://brucezhaor.github.io/pjutils/index.html |
@Laurae2 what's the status of this issue? Is it just the Travis item remaining? How is the I could take over finishing what's left for this if you can let me know the answers to those few things. Thanks! |
@BruceZhaoR that looks great, do you think you could help to make one LightGBM? @jameslamb I think the following must re-done from scratch:
For the following:
Unless we have a good free hosting somewhere, I can host it. |
@Laurae2 @jameslamb @guolinke to-do List
|
https://ci.appveyor.com/project/BruceZhaoR/lightgbm-r/build/artifacts git bash command: R CMD INSTALL lightgbm_2.2.3.zip
Rscript.exe -e 'library(lightgbm);demo("basic_walkthrough")' Maybe Windows users can download the zip here. |
@Laurae2 @jameslamb any ideals? I can make a PR. |
@BruceZhaoR I think it is better we merge your changes, then I can build on top of it. Otherwise we might duplicate work. |
Is anybody here familiar with conda R environment setup? In case we can manage to build LightGBM R package inside a conda environment, we can build the documentation directly on RTD site along with all other our docs without the need to host GH pages and separate Appveyor job. I tried to do this today, but without any luck. I installed The error after which I abandoned this idea happened on this line of @BruceZhaoR's pipeline. It was
and some words about unknown directory, which led me to the following MSYS issue and this fix which seems to be not included in MSYS from conda. Maybe on Linux this will be less painful (RTD's Docker is based on Ubuntu). |
😱 I have used R conda environment to get around Travis not have great built-in support for MacOS + Python (https://github.com/jameslamb/doppel-cli/blob/master/.ci/setup.sh) Based on that line, are you saying this is failing on installing I'm willing to help with this 😀 |
(p.s. here is the background, in case you're wondering "why did James say he uses conda R environment to solve a Python issue") |
@jameslamb It seems to be a Windows specific issue with MSYS in conda where compiling fails due to a missing pointer from the compiler (not from the compiled software). |
@jameslamb @Laurae2 Thanks for your replies! @jameslamb Thanks a lot for your links! I'll try to use CI to find out are any other MSYS issues presented in conda's R environment when I have time for it. Also, any help is appreciated, because it's quite uncomfortable to investigate it with CI, local Linux environment will be easier and faster 😃 . @Laurae2 I'm talking just about the possibility of building the docs on RTD site directly, not about any CI tests or producing R-artifacts for users from this (ugly conda) R environment. So, we just need to be sure that this environment is sufficient for building docs, which requires building the package itself, and not need to worry about any compatibility issues on users' side. @Laurae2
@Laurae2 Speaking about normal standard R installation, I've already told @jameslamb but you don't know yet that I successfully configured R environment at Travis and Appveyor for another project. We can borrow that code for testing purposes of LightGBM R-package. But I think that it falls outside the scope of this issue, we can create another one to discuss this. |
OK, seems that R from conda on Linux is less broken compared to one on Windows. 😄 |
As requested by @jameslamb, I'm posting here a TO-DO list, which was removed from the source code. After merging #2176, it is possible to replace To do this the following sub-tasks should be done first:
|
Finally #2176 has been merged recently! 🎉 See #1143 (comment) for actions required to resolve this issue completely. Now this issue entirely depends on #1944. After rewriting demos it should be rather straightforward replace Also, here are some known issues:
|
According to the policy from #2302, I'm closing this issue as I'm not working on it anymore. |
@jameslamb Can you please take a look at known issues 2 and 4? I have an intuition that they are pretty easy to fix, but unfortunately my lack of knowledge of R doesn't allow me to do it. |
On number 4...I will take a look. both For number 2, what do you think is wrong with it? That looks like a faithful representation of the code. It just looks weird because R thinks those are S3 methods, not plain-old functions. That is the danger of choosing function names with dots in them (a practice that is generally discouraged for R code) but now that we have them, I don't think there is much we can do. |
I worried about duplicated entry for one method (its' appearance differs from all other methods) and |
Just noticed that |
yes I think it is ok! The backticks are actually valid R code in that case (they are the way that you create symbols in R which use characters like |
For number 3, the are two ways to fix it: 1. Modify the Authors@R: c(
person("Guolin", "Ke", email = "[email protected]", role = c("aut", "cre")),
person("Damien", "Soukhavong", email = "[email protected]", role = c("aut", "ctb")),
person("Yachen", "Yan", role = c("aut", "ctb")),
person("James", "Lamb", email="[email protected]", role = c("aut","ctb"))
)
?person
# `aut`: (Author) Use for full authors who have made substantial contributions to the package and should show up in the package citation.
# `cre`: (Creator) Use for the package maintainer.
# `com`: (Compiler) Use for persons who collected code (potentially in other languages) but did not make further substantial contributions to the package.
# `fnd`: (Funder) Use for persons or organizations that furnished financial support for the development of the package.
# `ctb`: (Contributor) Use for authors who have made smaller contributions (such as code patches etc.) but should not show up in the package citation.
related issue: r-lib/pkgdown#450 2. Add home:
sidebar: "<div class='links'> <h2>Links</h2> <ul class='list-unstyled'> <li>Browse source code at <br /><a href='https://github.com/Microsoft/LightGBM'>https://​github.com/​Microsoft/​LightGBM</a> </li> <li>Report a bug at <br /><a href='https://github.com/Microsoft/LightGBM/issues'>https://​github.com/​Microsoft/​LightGBM/​issues</a> </li> </ul> </div> <div class='license'> <h2>License</h2> <ul class='list-unstyled'> <li><a href='https://opensource.org/licenses/mit-license.php'>MIT</a> + file <a href='LICENSE-text.html'>LICENSE</a></li> </ul> </div> <div class='developers'> <h2>Developers</h2> <ul class='list-unstyled'> <li><a href='https://github.com/guolinke'><img src='https://avatars0.githubusercontent.com/u/16040950?s=400&v=4' height='48' /> Guolin Ke</a> <br /> <small class='roles'> Author, maintainer </small> </li> <li><a href='https://github.com/Laurae2'><img src='https://avatars1.githubusercontent.com/u/9083669?s=460&v=4' height='48' /> Damien Soukhavong</a> <br /> <small class='roles'> Contributor </small> </li> <li><a href='https://github.com/yanyachen'><img src='https://avatars1.githubusercontent.com/u/6893682?s=460&v=4' height='48' /> Yachen Yan</a> <br /> <small class='roles'> Contributor </small> </li> <li><a href='https://github.com/jameslamb'><img src='https://avatars1.githubusercontent.com/u/7608904?s=400&v=4' height='48' /> James Lamb</a> <br /> <small class='roles'> Contributor </small> </li> <li><a href='authors.html'>All authors...</a></li> </ul> </div>"
|
@BruceZhaoR Thanks a lot for your investigation! Ah, they have role filter without the possibility to overwrite it, nice! I saw someone tried to specify roles in
I'm leaving this for R maintainers decision. |
I think that the current state of our
For more targeted recommended fixes, like #3036 , please create new issues. |
@jameslamb Please comment on this: #1143 (comment). I thought this issue should be closed after that we can simplify our |
Ah ok, apologies for missing that commentt. I'm confused by that comment @StrikerRUS ,can you clarify? I just ran this and it produced a site that looks identical to our current site: Rscript build_r.R
cd lightgbm_r
Rscript -e "pkgdown::build_site(install = FALSE)" If I understand correctly, #1143 (comment) is actually three areas for improvement that should be documented in their own issues
If you agree with my comment above, I'll break these into individual issues. That will be a lot more manageable for contributors than parsing the comments in this issue, I think. |
@jameslamb Thanks a lot for your explanation! I'm absolutely OK with breaking this meta-issue into individual ones! Can we now replace Lines 10 to 20 in 5cc38e6
with build_site() as it doesn't crash without some sections? And after resolving #1944 we'll get articles section at RTD automatically.
|
I think so, yes! Once we merge #3086 , can you leave the I'll try pushing a change that replaces Thanks for all your work getting the R documentation set up! |
Sure! Thank you! |
^ #3098 removes |
I will be adding pkgdown support to the documentation of LightGBM.
You can check the branch here: https://github.com/Laurae2/LightGBM/tree/pkgdown
To add support for pkgdown, it will require the following tasks:
Matrix
andmethods
to Depends instead of Imports (fixes many instances of example crashes)pkgdown::build_site()
on the R-package folder without vignettespkgdown::build_site()
on the R-package folder with vignettesExtras:
pkgdown::build_site(run_dont_run = TRUE)
(no idea how to do it, if someone can contribute to do it for us that would be great...)I'm sharing my setup for running
pkgdown
quickly:It will look like this:
Too much advanced example, gives a good baseline of what we can do with
pkgdown
: https://keras.rstudio.com/index.htmlAnother (very simplified) example (live): https://laurae2.github.io/LauraeDS/
The text was updated successfully, but these errors were encountered: