-
Notifications
You must be signed in to change notification settings - Fork 65
move cuspatial, cuproj docs under 'inactive projects' #654
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
Changes from all commits
a939f2e
2d1c128
0afbd4f
1978f9d
235a62c
14d2eb8
1dfb693
fa0f539
0a752ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,17 @@ | |||||
| {% assign versions = api.versions | sort | where_exp: "item", "item[1] == 1" | join: "" | split: "1" | reverse %} | ||||||
| ### {{ api.name }} | ||||||
| {{ api.desc }} | ||||||
| #### DOCS {% for version_name in versions %} {% if api.name == "libucxx" %} **[{{ version_name }} ({{ site.data.releases[version_name].ucxx_version }})](/api/{{ api.path }}/{{ version_name }})** {% else %} **[{{ version_name }} ({{ site.data.releases[version_name].version }})](/api/{{ api.path }}/{{ version_name }})** {% endif %} {% unless forloop.last %}|{% endunless %} {% endfor %} | ||||||
| #### DOCS {% for version_name in versions -%} | ||||||
| {%- if api.version-overrides -%} | ||||||
| **[{{ version_name }} ({{ api.version-overrides[version_name] }})](/api/{{ api.path }}/{{ version_name }})** | ||||||
| {%- elsif api.name == "libucxx" -%} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check this? elsif seems unusual.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was as surprised as you are to learn that in Liquid, it's literally spelled
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's... not Jinja. My bad.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha no problem, I only just learned that recently through this work. |
||||||
| **[{{ version_name }} ({{ site.data.releases[version_name].ucxx_version }})](/api/{{ api.path }}/{{ version_name }})** | ||||||
| {%- else -%} | ||||||
| **[{{ version_name }} ({{ site.data.releases[version_name].version }})](/api/{{ api.path }}/{{ version_name }})** | ||||||
| {%- endif -%} | ||||||
| {%- unless forloop.last %} | {% endunless -%} | ||||||
| {%- endfor %} | ||||||
|
|
||||||
| #### LINKS {% if api.cllink %} **[changelog]({{ api.cllink }}){:target="_blank"}** | {% endif %} **[github]({{ api.ghlink }}){:target="_blank"}** | ||||||
| {: .mb-7 } | ||||||
| {% endif %} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,9 +64,15 @@ aws_cp() { | |
| } | ||
|
|
||
| # Downloads the RAPIDS libraries' documentation files from S3 and places them | ||
| # into the "_site/api" folder. The versions that should be copied are read from | ||
| # "_data/releases.json" and the libraries that should be copied are read from | ||
| # "_data/docs.yml". | ||
| # into the "_site/api" folder. | ||
| # | ||
| # The libraries that should be copied are read from "_data/docs.yml". | ||
| # | ||
| # The versions that should be copied are read from a mix of sources: | ||
| # | ||
| # - active projects: "_data/releases.json" | ||
| # - inactive projects: 'version-overrides' field in entries in "_data/docs.yml" | ||
| # | ||
| download_lib_docs() { | ||
| local DST PROJECT PROJECT_MAP \ | ||
| SRC VERSION_MAP VERSION_NAME \ | ||
|
|
@@ -78,10 +84,11 @@ download_lib_docs() { | |
| "nightly": { "version": .nightly.version, "ucxx_version": .nightly.ucxx_version } | ||
| }' _data/releases.json) | ||
|
|
||
| echo "--- processing active RAPIDS libraries ---" | ||
| PROJECT_MAP=$(yq '.apis + .libs' _data/docs.yml) | ||
|
|
||
| for VERSION_NAME in $(jq -r 'keys | .[]' <<< "$VERSION_MAP"); do | ||
| for PROJECT in $(yq -r 'keys | .[]' <<< "$PROJECT_MAP"); do | ||
| for PROJECT in $(yq -r 'keys | .[]' <<< "$PROJECT_MAP"); do | ||
| for VERSION_NAME in $(jq -r 'keys | .[]' <<< "$VERSION_MAP"); do | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switching the order of these so that in the logs, all the updates are grouped by library. I personally think it's more common to look at these logs with a question like "which files were copied for Happy to switch this back if reviewers disagree, I don't feel strongly. |
||
| VERSION_NUMBER=$(jq -r --arg vn "$VERSION_NAME" --arg pr "$PROJECT" ' | ||
| if ($pr | contains("ucxx")) then | ||
| .[$vn].ucxx_version | ||
|
|
@@ -97,7 +104,35 @@ download_lib_docs() { | |
|
|
||
| SRC="s3://${DOCS_BUCKET}/${PROJECT}/html/${VERSION_NUMBER}/" | ||
| DST="$(yq -n 'env(GENERATED_DIRS)|.libs')/${PROJECT}/${VERSION_NUMBER}/" | ||
| aws_cp "${SRC}" "${DST}" | ||
| done | ||
| done | ||
|
|
||
| # inactive projects (no longer maintained, but we still host the docs) | ||
| echo "--- processing inactive projects ---" | ||
| INACTIVE_PROJECT_MAP=$(yq '.inactive-projects' _data/docs.yml) | ||
|
|
||
| for PROJECT in $(yq -r 'keys | .[]' <<< "$INACTIVE_PROJECT_MAP"); do | ||
| for VERSION_NAME in $(jq -r 'keys | .[]' <<< "$VERSION_MAP"); do | ||
| # do not attempt updates for any versions where the corresponding key is '0' in docs.yml | ||
| INACTIVE_PROJECT_MAP_JSON=$(yq -r -o json '.' <<< "$INACTIVE_PROJECT_MAP") | ||
| if [ "$(jq -r --arg pr "$PROJECT" --arg vn "$VERSION_NAME" '.[$pr].versions[$vn]' <<< "$INACTIVE_PROJECT_MAP_JSON")" == "0" ]; then | ||
| echo "Skipping: $PROJECT | $VERSION_NAME" | ||
| continue | ||
| fi | ||
|
|
||
| # get the version from the 'version-overrides' field in docs.yml, hard-coded there | ||
| # so it doesn't change from release-to-release for inactive projects | ||
| VERSION_NUMBER=$( | ||
| jq -r \ | ||
| --arg vn "$VERSION_NAME" \ | ||
| --arg pr "${PROJECT}" \ | ||
| '.[$pr]."version-overrides"[$vn]' \ | ||
| <<< "${INACTIVE_PROJECT_MAP_JSON}" | ||
| ) | ||
|
|
||
| SRC="s3://${DOCS_BUCKET}/${PROJECT}/html/${VERSION_NUMBER}/" | ||
| DST="$(yq -n 'env(GENERATED_DIRS)|.libs')/${PROJECT}/${VERSION_NUMBER}/" | ||
| aws_cp "${SRC}" "${DST}" | ||
| done | ||
| done | ||
|
|
@@ -108,6 +143,7 @@ download_lib_docs() { | |
| download_deployment_docs() { | ||
| local DST SRC VERSION | ||
|
|
||
| echo "--- processing deployment docs ---" | ||
| for VERSION in nightly stable; do | ||
| SRC="s3://${DOCS_BUCKET}/deployment/html/${VERSION}/" | ||
| DST="$(yq -n 'env(GENERATED_DIRS)|.deployment')/${VERSION}/" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 lines are the only new logic. Basically, "if the entry in
_data/docs.ymlexplicitly specifies versions, just use those directly instead of looking up versions in the data from_data/releases.json".The rest of the diff here is just expanding this out to multiple lines with indentation, to make it easier to read. This doesn't introduce any visual artifacts like weird spacing or line breaks because I've also introduced a lot more whitespace stripping, via
{%-and-%}.For details on how that works in Liquid, see https://shopify.github.io/liquid/basics/whitespace/