You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "thisisnic (via GitHub)" <gi...@apache.org> on 2023/04/13 09:22:37 UTC

[GitHub] [arrow] thisisnic opened a new pull request, #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

thisisnic opened a new pull request, #35103:
URL: https://github.com/apache/arrow/pull/35103

   This PR moves the option to select a different version of the docs from a dropdown menu to a link in the footer, which links to an article generated when the docs are build, listing the previous versions.
   
   This resolves the problem in #34907 and also fixes #14969 in which the JavaScript used in the dropdown interferes with the JavaScript code used for the search box (present since the upgrade to BS5).
   
   This change also simplifies the maintenance of the version selection functionality, though does remove the ability to navigate directly to the same reference page in a different version - overall I think this minor loss of functionality is a worthwhile trade for simpler maintenance.
   
   Footer before (note that the author information is already in the sidebar, so this is duplication):
   ![image](https://user-images.githubusercontent.com/13715823/231714608-73ec3e0b-cc28-4f41-9b22-a87033ab3977.png)
   
   
   Footer after:
   ![image](https://user-images.githubusercontent.com/13715823/231714402-e04b1c43-495a-477b-ae1e-4035b35b088b.png)
   
   The new page:
   
   ![image](https://user-images.githubusercontent.com/13715823/231715235-da6b5f88-e9b3-44d9-a7df-dc9f9a609113.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #35103:
URL: https://github.com/apache/arrow/pull/35103#issuecomment-1526305318

   Benchmark runs are scheduled for baseline = 7bf1dec7f8bab44522fcbf84263045cc5a24e534 and contender = c95980f4bee406504a68ff3a3d39cd86c1d97ec0. c95980f4bee406504a68ff3a3d39cd86c1d97ec0 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/8f561bfc16e84141b91508f557644d10...cab56c5c4fbe4dd98c8121c94943a6e3/)
   [Finished :arrow_down:5.43% :arrow_up:1.95%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/e90a799eba894429b87bfa49f9ea4e17...94d46de895c34b41b7bb21eec3bf0edf/)
   [Finished :arrow_down:1.28% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/c2b74a874cab476492979286c803031f...841b2f97567546a78bdcc7e03bb2eeec/)
   [Finished :arrow_down:0.21% :arrow_up:0.0%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/0769f2f369684bdf8c6eb461b6729ef5...f63a70036a6a46cdac66dfd856faed44/)
   Buildkite builds:
   [Finished] [`c95980f4` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2792)
   [Finished] [`c95980f4` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2826)
   [Finished] [`c95980f4` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2790)
   [Finished] [`c95980f4` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2817)
   [Finished] [`7bf1dec7` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2791)
   [Finished] [`7bf1dec7` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2825)
   [Finished] [`7bf1dec7` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2789)
   [Finished] [`7bf1dec7` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2816)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35103:
URL: https://github.com/apache/arrow/pull/35103#issuecomment-1506638063

   * Closes: #34907


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1179162563


##########
r/pkgdown/assets/versions.html:
##########
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<body><p><a href="../dev/r/">11.0.0.9000 (dev)</a></p>
+<p><a href="../r/">11.0.0 (release)</a></p>

Review Comment:
   I see.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1177056052


##########
r/pkgdown/assets/versions.html:
##########
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<body><p><a href="../dev/r/">11.0.0.9000 (dev)</a></p>
+<p><a href="../r/">11.0.0 (release)</a></p>

Review Comment:
   "11.0.0.3"?
   
   You may need to rebase on main for #35132.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1178846585


##########
r/pkgdown/assets/versions.html:
##########
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<body><p><a href="../dev/r/">11.0.0.9000 (dev)</a></p>
+<p><a href="../r/">11.0.0 (release)</a></p>

Review Comment:
   With the R docs, we only go to 3 levels (to reflect the Arrow release versions), so 11.0.0 effectively is the same as 11.0.0.3.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on PR #35103:
URL: https://github.com/apache/arrow/pull/35103#issuecomment-1508152965

   >  Is it acceptable for R users?
   
   I don't know as I don't know if anyone uses this functionality at all, and nobody requested it.  However, I'd say the main use case is probably someone coming to the docs but having to work with an older version of the package. They can still navigate to the latest version by re-navigating to the main page.
   
   Alternatively, we could have that footer link point to a page which is published independently (e.g. so to a URL like `https://arrow.apache.org/docs/r/versions.html`).  This might be a better solution than having this as an article actually.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #35103:
URL: https://github.com/apache/arrow/pull/35103#issuecomment-1526310134

   ['Python', 'R'] benchmarks have high level of regressions.
   [test-mac-arm](https://conbench.ursa.dev/compare/runs/e90a799eba894429b87bfa49f9ea4e17...94d46de895c34b41b7bb21eec3bf0edf/)
   [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/c2b74a874cab476492979286c803031f...841b2f97567546a78bdcc7e03bb2eeec/)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou merged pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #35103:
URL: https://github.com/apache/arrow/pull/35103


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] eitsupi commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "eitsupi (via GitHub)" <gi...@apache.org>.
eitsupi commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1165713754


##########
r/vignettes/prevdocs.Rmd:
##########
@@ -0,0 +1,12 @@
+---
+title: "Current and Older Versions of this Documentation"
+output: rmarkdown::html_vignette
+---
+
+```{r, echo=FALSE}
+versions <- jsonlite::read_json("https://arrow.apache.org/docs/r/versions.json")
+```
+
+`r paste(purrr::map(versions, ~paste("[",.x$name, "](../", .x$version, "r/)\n\n", sep=""), collapse = ""), collapse = "")`

Review Comment:
   If this is the intent, please ignore it, but I think using `results="asis"` r code chunk here would make it easier to see this code.
   https://bookdown.org/yihui/rmarkdown-cookbook/results-asis.html



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on PR #35103:
URL: https://github.com/apache/arrow/pull/35103#issuecomment-1508563920

   I've updated this now so that instead of adding an article-which-isn't-an-article, we instead generate a HTML page when we do a release, which contains links to all other docs versions.  This page is updated every release, so it always contains an up-to-date version of available docs versions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1165777082


##########
r/vignettes/prevdocs.Rmd:
##########
@@ -0,0 +1,12 @@
+---
+title: "Current and Older Versions of this Documentation"
+output: rmarkdown::html_vignette
+---
+
+```{r, echo=FALSE}
+versions <- jsonlite::read_json("https://arrow.apache.org/docs/r/versions.json")
+```
+
+`r paste(purrr::map(versions, ~paste("[",.x$name, "](../", .x$version, "r/)\n\n", sep=""), collapse = ""), collapse = "")`

Review Comment:
   Oh nice, that means I can split it up a bit!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1167285094


##########
dev/release/utils-update-docs-versions.py:
##########
@@ -26,6 +26,7 @@
 
 main_versions_path = dir_path + "/docs/source/_static/versions.json"
 r_versions_path = dir_path + "/r/pkgdown/assets/versions.json"
+r_html_path = dir_path + "/r/pkgdown/assets/versions.html"

Review Comment:
   Could you add a generated HTML to this pull request?
   We should version control the HTML, right?



##########
dev/release/utils-update-docs-versions.py:
##########
@@ -87,3 +88,15 @@
 with open(r_versions_path, 'w') as json_file:
     json.dump(new_r_versions, json_file, indent=4)
     json_file.write("\n")
+
+# Load the updated versions JSON file
+with open(r_versions_path) as json_file:
+    data = json.load(json_file)
+
+# Write HTML to file
+with open(r_html_path, 'w') as html_file:
+    html_file.write('<!DOCTYPE html>\n<html>\n<body>')
+    for i in data:
+        html_file.write('<p><a href="../' + i['version'] + 'r/">' + i['name'] + '</a></p>\n')

Review Comment:
   I think that `i['version']` and `i['name']` will not include any HTML special characters such as `<` but how about escape them for safety?
   
   ```python
   import html
   html.escape(i['version'])
   ```
   
   How about using f-string?
   
   ```suggestion
           html_file.write(f'<p><a href="../{i["version"]}/r/">{i["name"]}</a></p>\n')
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1176368899


##########
dev/release/utils-update-docs-versions.py:
##########
@@ -87,3 +88,15 @@
 with open(r_versions_path, 'w') as json_file:
     json.dump(new_r_versions, json_file, indent=4)
     json_file.write("\n")
+
+# Load the updated versions JSON file
+with open(r_versions_path) as json_file:
+    data = json.load(json_file)
+
+# Write HTML to file
+with open(r_html_path, 'w') as html_file:
+    html_file.write('<!DOCTYPE html>\n<html>\n<body>')
+    for i in data:
+        html_file.write('<p><a href="../' + i['version'] + 'r/">' + i['name'] + '</a></p>\n')

Review Comment:
   Thanks, done!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1176368319


##########
dev/release/utils-update-docs-versions.py:
##########
@@ -26,6 +26,7 @@
 
 main_versions_path = dir_path + "/docs/source/_static/versions.json"
 r_versions_path = dir_path + "/r/pkgdown/assets/versions.json"
+r_html_path = dir_path + "/r/pkgdown/assets/versions.html"

Review Comment:
   Good point, added now!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #35103:
URL: https://github.com/apache/arrow/pull/35103#discussion_r1165987188


##########
r/vignettes/prevdocs.Rmd:
##########
@@ -0,0 +1,12 @@
+---
+title: "Current and Older Versions of this Documentation"
+output: rmarkdown::html_vignette
+---
+
+```{r, echo=FALSE}
+versions <- jsonlite::read_json("https://arrow.apache.org/docs/r/versions.json")

Review Comment:
   How about reading local `r/pkgdown/assets/versions.json` instead of `https://arrow.apache.org/docs/r/versions.json`?
   It seems that we don't need to use https://arrow.apache.org/docs/r/versions.json here.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on pull request #35103: GH-34907: [Docs][R] Version selector reports that release version is dev

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on PR #35103:
URL: https://github.com/apache/arrow/pull/35103#issuecomment-1506710915

   I am wondering if this is even necessary and whether anyone is actually using older versions of the docs? Is there somewhere it might make sense to add a note that these older versions of the docs are available, with an example URL, and just let people find it themselves?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org