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

Add code of conduct and redirects to our docs #592

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

jhkennedy
Copy link
Collaborator

@jhkennedy jhkennedy commented Jun 7, 2024

The two redirects should ensure that these links get redirected appropriately:

  • https://https://earthaccess.readthedocs.io/CODE_OF_CONDUCT
  • https://https://earthaccess.readthedocs.io/CODE_OF_CONDUCT.md

Had to add mkdocs-redirects (I've used it a lot; works great) and so the pyproject.toml got updated and the lock file.

fixes #591


📚 Documentation preview 📚: https://earthaccess--592.org.readthedocs.build/en/592/

@jhkennedy
Copy link
Collaborator Author

IDK why mkdocs isn't building -- worked fine on my machine, but likely a dependency issue from adding mkdocs-redirects and poetry being poetry.

@chuckwondo
Copy link
Collaborator

IDK why mkdocs isn't building -- worked fine on my machine, but likely a dependency issue from adding mkdocs-redirects and poetry being poetry.

If I can manage to get this PR merged, it includes a fix for the mkdocs build failure: #571 (@mfisher87, nudge, nudge)

@mfisher87
Copy link
Collaborator

Good to go! 🐌 🚀

@chuckwondo
Copy link
Collaborator

@jhkennedy, if you want to rebase/merge main into your branch, your build should pass now.

@jhkennedy
Copy link
Collaborator Author

@chuckwondo @mfisher87 everything's passing now.

Notably, I added mkdocs-redirects to the dev dependencies. For the rebase, I resolved conflicts in the pyproject.toml and updated the poetry lock file like poetry lock --no-update.

I also don't remember/understand what's going on with:
https://github.com/nsidc/earthaccess/blob/main/ci/environment-dev.yml

I see most of the mkdocs stuff there, but I don't really understand why we have things there beyond just:

name: earthaccess-dev
channels:
  - conda-forge
dependencies:
  - python=3.10
  - poetry

and I'm not sure we even need to pin Python here, either.

But anyway, for this PR, do I need to update envionment-dev.yml to include mkdocs-redirects?

@mfisher87
Copy link
Collaborator

I would like to better understand the reason for the environment-dev.yml file as well. A lot of overhead to update it. I think we should add the new dependency there for now, and maybe let's make a new issue to discuss removing the file?

@jhkennedy
Copy link
Collaborator Author

lol, docs timed out in the notebook execution step.

I added it mostly to re-trigger the docs build, but the only different between it being in the env vs not is whether it's installed from conda-forge or pypi (doesn't matter here).

I'll open an issue for the environment-dev.yml file.

@mfisher87
Copy link
Collaborator

mfisher87 commented Jun 12, 2024

lol, docs timed out in the notebook execution step.

This happened on another PR too. I think RTD had a hiccup.

Copy link
Collaborator

@mfisher87 mfisher87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @jhkennedy do you want to merge this when you're ready?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!

@@ -6,7 +6,7 @@ with the community and maintainers via
[a GitHub Discussion](https://github.com/nsidc/earthaccess/discussions),
or [any other method](our-meet-ups.md).

Please note that we have a [code of conduct](/CODE_OF_CONDUCT.md). Please follow it in all of your interactions with the project.
Please note that we have a [code of conduct](./code-of-conduct.md). Please follow it in all of your interactions with the project.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder why strict mode didn't catch this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfisher87 Absolute links aren't officially supported on MkDocs because they can be unpredictable and are not validated because they are effectively external links.
https://www.mkdocs.org/user-guide/writing-your-docs/#linking-to-pages

For example, if you host multiple things on a domain, this is a way to link them without knowing the explicit domain name, e.g.:

  • root: <pacakge.com>
  • MkDocs site URL: <package.com/docs/>
  • download artifacts: <example.com/downloads/>

So /downloads/package-linux.tar.gz would be a valid link for a tarball you might want to document on the site.

This is probably a good policy as it's really hard to say what / is intended to be -- here, the absolute link was intended to be back to the repository root, not to the docs dir or the domain root.

@jhkennedy jhkennedy merged commit 9026706 into nsidc:main Jun 12, 2024
11 checks passed
@jhkennedy jhkennedy deleted the fix-docs-coc-591 branch June 12, 2024 00:56
@jhkennedy
Copy link
Collaborator Author

LGTM! @jhkennedy do you want to merge this when you're ready?

Merged! @mfisher87 is that sufficient for this to be deployed to readthedocs, or do we need a release as well?

@mfisher87
Copy link
Collaborator

mfisher87 commented Jun 12, 2024

This is deployed on ReadTheDocs, but unfortunately, it doesn't seem to have resolved our issue. Turns out it's not an Mkdocs issue, it's a ReadTheDocs issue.

I set up an "exact redirect" in the admin dashboard following the RTD redirects documentation and now the link in the proposal works.

@mfisher87
Copy link
Collaborator

@jhkennedy should we revert this PR since the redirect is handled by RTD? The reason we can't solve this in Mkdocs is because of RTD handles the language and version URL parts before hitting the Mkdocs output.

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.

code of conduct not rendering properly
3 participants