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

ARROW-18363: [Docs] Include warning when viewing old docs (redirecting to stable/dev docs) #275

Merged
merged 8 commits into from
Dec 8, 2022

Conversation

AlenkaF
Copy link
Member

@AlenkaF AlenkaF commented Nov 23, 2022

Link to the Jira issue: https://issues.apache.org/jira/browse/ARROW-18363.

This PR inserts a script element into all .html files which calls a /docs/versionwarning.js file. The file adds a version warning to the .html page if the file path matches any of the 4 criteria:

  • the page is under developers section in stable release
  • the page is in the docs for arrow version older then 4.0
  • the page is under developers section and in the docs for older arrow version (but at least 4.0)
  • the page is in the docs for older arrow version (but at least 4.0)

Each of these warnings has its own warning message.

This PR is a part of Jira to GitHub migration work.

Hot to test the code locally?

  1. Checkout any commit from arrow-site/asf-site other than this one
  2. Save versionwarning.js to arrow-site/docs/ folder
  3. Run next code snippet in the terminal (for MacOS, should be a bit different for Linux/Wind) from the arrow-site/docs folder. You will have to check/correct numbers 6&7 from the snippet.
    My path to arrow-site/docs is /Users/alenkafrim/repos/arrow-site/docs and is a "length" of 5 so numbers I used down below were 6&7. If the length of you path is 7 then you need to change 6 with 8 and 7 with 9 😬
    I am searching for a shell function to give the length and I can automate this step =)
# Run this from the arrow-site/docs/ folder (check the numbers 6&7!)
sed -i '' "s/'arrow.apache.org')/'')/" versionwarning.js
sed -i '' "s/\[2\]/\[6\]/" versionwarning.js
sed -i '' "s/\[3\]/\[7\]/" versionwarning.js
sed -i '' "s/(2)/\(6\)/" versionwarning.js
sed -i '' "s/(3)/\(7\)/" versionwarning.js

# insert the JS file into all the html files in /docs
find . -iname "*.html" | xargs sed -i '' '/<\/body>/ i\
<script type="text/javascript" src="/docs/versionwarning.js"></script>'

This is the visual from my local tests:
Screenshot 2022-11-23 at 13 24 11
Screenshot 2022-11-23 at 13 24 14
Screenshot 2022-11-23 at 13 24 17
Screenshot 2022-11-23 at 13 24 20

@AlenkaF AlenkaF marked this pull request as ready for review November 27, 2022 17:17
@jorisvandenbossche
Copy link
Member

I can't officially "approve" the PR as I don't get into the Files changed tab (it indicates an infinity of touched files ...). But from a local checkout, this looks good!

@jorisvandenbossche
Copy link
Member

One small thing -> latestStable is already 10.0.1 at the moment.

We will also have to update the release script for the docs to update that line (post-08-docs.sh in the arrow repo)

@AlenkaF
Copy link
Member Author

AlenkaF commented Dec 2, 2022

Oh thanks for reminding me of that!! Will correct the version here and update the release script together with updating layout.html in a separate PR.

@jorisvandenbossche
Copy link
Member

Thanks for the update! Let's give this a try

@jorisvandenbossche jorisvandenbossche merged commit bc10f7d into apache:asf-site Dec 8, 2022
@AlenkaF AlenkaF deleted the ARROW-18363 branch December 8, 2022 09:03
@jorisvandenbossche
Copy link
Member

Seems to be working fine!

jorisvandenbossche pushed a commit to apache/arrow that referenced this pull request Dec 23, 2022
…g to stable/dev docs) (#14839)

This PR is a complementary work to apache/arrow-site#275.

It adds a version warning script tag to the `docs/source/_templates/layout.html` and _versionwarnings.js_ file into `docs/source/_static/`.

Authored-by: Alenka Frim <frim.alenka@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
EpsilonPrime pushed a commit to EpsilonPrime/arrow that referenced this pull request Jan 5, 2023
…g to stable/dev docs) (apache#14839)

This PR is a complementary work to apache/arrow-site#275.

It adds a version warning script tag to the `docs/source/_templates/layout.html` and _versionwarnings.js_ file into `docs/source/_static/`.

Authored-by: Alenka Frim <frim.alenka@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
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.

2 participants