Skip to content

[docs] Add support for external markdown#23505

Merged
krfricke merged 8 commits intoray-project:masterfrom
Yard1:ecosystem_auto_docs
Mar 31, 2022
Merged

[docs] Add support for external markdown#23505
krfricke merged 8 commits intoray-project:masterfrom
Yard1:ecosystem_auto_docs

Conversation

@Yard1
Copy link
Copy Markdown
Member

@Yard1 Yard1 commented Mar 25, 2022

Why are these changes needed?

This PR fixes the issue of diverging documentation between Ray Docs and ecosystem library readmes which live in separate repos (eg. xgboost_ray). This is achieved by adding an extra step before the docs build process starts that downloads the readmes of specified ecosystem libraries from their GitHub repositories. The files are then preprocessed by a very simple parser to allow for differences between GitHub and Docs markdowns.

In summary, this makes the markdown files in ecosystem library repositories single sources of truth and removes the need to manually keep the doc pages up to date, all the while allowing for differences between what's rendered on GitHub and in the Docs.

See ray-project/xgboost_ray#204 & https://ray--23505.org.readthedocs.build/en/23505/ray-more-libs/xgboost-ray.html for an example.

Needs ray-project/xgboost_ray#204 and ray-project/lightgbm_ray#30 to be merged first.

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

GitHub:

```html
<!--$UNCOMMENTthis will be uncommented--> More text
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we can somehow make this convention easier in a follow-up PR. It'd be great to add more external content from trusted sources, without them having to add our special commenting syntax.

Copy link
Copy Markdown
Contributor

@maxpumperla maxpumperla left a comment

Choose a reason for hiding this comment

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

Fantastic idea, really like the preprocessor system!

Copy link
Copy Markdown
Contributor

@amogkam amogkam left a comment

Choose a reason for hiding this comment

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

@Yard1 as I'm developing docs in external repos, is there a way to see how it will be rendered on the Ray docs? If so, could we add this to the README section?

@@ -0,0 +1,8 @@
<!--
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we need one for xgboost as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is a file there for xgboost already

@Yard1
Copy link
Copy Markdown
Member Author

Yard1 commented Mar 28, 2022

@amogkam I'll add a convenience script to convert an external markdown file to MyST file and then you can build the docs locally with that included to see how it will look like

Copy link
Copy Markdown
Contributor

@krfricke krfricke left a comment

Choose a reason for hiding this comment

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

Great idea! And I generally like the implementation. Just two questions:

  1. Instead of uncommenting e.g. headlines, can we just have a "template" on the Ray docs side that replaces some body part with the fetched content? That way we can have more content on Ray (e.g. the API docs, which are not used in the library READMEs at all but only in the Ray docs).
  2. Can we just convert the READMEs with some converter instead of providing e.g. two versions of the same table?

@Yard1
Copy link
Copy Markdown
Member Author

Yard1 commented Mar 29, 2022

@krfricke The problem with conversion is that there are some elements that only make sense in the docs (eg. sphinx headers). As for the tables specifically, I believe there wouldn't be any issues if we left them in markdown, this is just how it is in the docs currently.

I toyed with the template idea before through the use of sphinx directives, but unfortunately it's not straightforward (especially with MyST having issues with custom Include-like directives). I think the simple uncomment/remove combo provides the greatest flexibility. Templates etc. could potentially get messy and complicated. Plus we are in control of the external docs, so we can make any changes we need anytime.

@Yard1 Yard1 marked this pull request as ready for review March 29, 2022 21:46
@krfricke krfricke merged commit 756d08c into ray-project:master Mar 31, 2022
amogkam added a commit to ray-project/ray_lightning that referenced this pull request Apr 6, 2022
Adjust the readme file to take advantage of ray-project/ray#23505
amogkam added a commit that referenced this pull request Apr 8, 2022
Automatically pull the latest ray_lightning README to render on Ray docs. (#23505)

Depends on ray-project/ray_lightning#135
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.

4 participants