forked from ClickHouse/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-12017: [R] [Documentation] Make proper developing arrow docs
Closes apache#9898 from jonkeane/ARROW-12017-dev-docs Lead-authored-by: Jonathan Keane <[email protected]> Co-authored-by: Neal Richardson <[email protected]> Signed-off-by: Neal Richardson <[email protected]>
- Loading branch information
1 parent
818c57c
commit 1c0641d
Showing
10 changed files
with
724 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# NOTE: must set "Crossbow" as name to have the badge links working in the | ||
# github comment reports! | ||
name: Crossbow | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*-github-*" | ||
|
||
jobs: | ||
devdocs: | ||
name: 'R devdocs {{ "${{ matrix.os }}" }} system install: {{ "${{ matrix.system-install }}" }}' | ||
runs-on: {{ "${{ matrix.os }}" }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macOS-latest, ubuntu-20.04] | ||
# should the install method install libarrow into a system directory | ||
# or a temporary directory. old is the same as a temporary | ||
# directory, but an old version of libarrow will be installed | ||
# into a system directory first (to make sure we can link correctly when building) | ||
system-install: [true, false] | ||
|
||
steps: | ||
- name: Checkout Arrow | ||
run: | | ||
git clone --no-checkout {{ arrow.remote }} arrow | ||
git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }} | ||
git -C arrow checkout FETCH_HEAD | ||
git -C arrow submodule update --init --recursive | ||
- uses: r-lib/actions/setup-r@v1 | ||
- uses: r-lib/actions/setup-pandoc@v1 | ||
- name: Install knitr, rmarkdown | ||
run: | | ||
install.packages(c("rmarkdown", "knitr", "sessioninfo")) | ||
shell: Rscript {0} | ||
- name: Session info | ||
run: | | ||
options(width = 100) | ||
pkgs <- installed.packages()[, "Package"] | ||
sessioninfo::session_info(pkgs, include_base = TRUE) | ||
shell: Rscript {0} | ||
- name: Write the install script | ||
env: | ||
RUN_DEVDOCS: TRUE | ||
DEVDOCS_MACOS: {{ "${{contains(matrix.os, 'macOS')}}" }} | ||
DEVDOCS_UBUNTU: {{ "${{contains(matrix.os, 'ubuntu')}}" }} | ||
DEVDOCS_SYSTEM_INSTALL: {{ "${{contains(matrix.system-install, 'true')}}" }} | ||
DEVDOCS_PRIOR_SYSTEM_INSTALL: {{ "${{contains(matrix.system-install, 'old')}}" }} | ||
run: | | ||
# This isn't actually rendering the docs, but will save arrow/r/vignettes/script.sh | ||
# which can be sourced to install arrow. | ||
rmarkdown::render("arrow/r/vignettes/developing.Rmd") | ||
shell: Rscript {0} | ||
- name: Install from the devdocs | ||
env: | ||
LIBARROW_BINARY: FALSE | ||
ARROW_R_DEV: TRUE | ||
run: bash arrow/r/vignettes/script.sh | ||
shell: bash | ||
- name: Ensure that the Arrow package is loadable and we have the correct one | ||
run: | | ||
echo $LD_LIBRARY_PATH | ||
R --no-save <<EOF | ||
Sys.getenv("LD_LIBRARY_PATH") | ||
library(arrow) | ||
arrow_info() | ||
EOF | ||
shell: bash -l {0} | ||
- name: Save the install script | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: {{ "devdocs-script_os-${{ matrix.os }}_sysinstall-${{ matrix.system-install }}" }} | ||
path: arrow/r/vignettes/script.sh | ||
if: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
(function () { | ||
// Load the rmarkdown tabset script | ||
var script = document.createElement("script"); | ||
script.type = "text/javascript"; | ||
script.async = true; | ||
script.src = | ||
"https://cdn.jsdelivr.net/gh/rstudio/rmarkdown@47d837d3d9cd5e8e212b05767454f058db7d2789/inst/rmd/h/navigation-1.1/tabsets.js"; | ||
script.integrity = "sha256-Rs54TE1FCN1uLM4f7VQEMiRTl1Ia7TiQLkMruItwV+Q="; | ||
script.crossOrigin = "anonymous"; | ||
|
||
// Run the processing as the onload callback | ||
script.onload = () => { | ||
// Monkey patch the .html method to use the .text method | ||
$(document).ready(function () { | ||
(function ($) { | ||
$.fn.html = function (content) { | ||
return this.text(); | ||
}; | ||
})(jQuery); | ||
|
||
window.buildTabsets("toc"); | ||
}); | ||
|
||
$(document).ready(function () { | ||
$(".tabset-dropdown > .nav-tabs > li").click(function () { | ||
$(this).parent().toggleClass("nav-tabs-open"); | ||
}); | ||
}); | ||
|
||
$(document).ready(function () { | ||
/** | ||
* The tabset creation above sometimes relies on empty headers to stop the | ||
* tabbing. Though they shouldn't be included in the TOC in the first place, | ||
* this will remove empty headers from the TOC after it's created. | ||
*/ | ||
|
||
// find all the empty <a> elements and remove them (and their parents) | ||
var empty_a = $("#toc").find("a").filter(":empty"); | ||
empty_a.parent().remove(); | ||
|
||
// now find any empty <ul>s and remove them too | ||
var empty_ul = $("#toc").find("ul").filter(":empty"); | ||
empty_ul.remove(); | ||
}); | ||
}; | ||
|
||
document.head.appendChild(script); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.