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

[ci][docs] replace file extensions in docs during Sphinx build #3738

Merged
merged 6 commits into from
Jan 7, 2021

Conversation

StrikerRUS
Copy link
Collaborator

@jameslamb I remember you proposed this change some time ago. But I was against because was not bought of idea to rewrite all docs source files during the build process. Now I know that we can do it via internal Sphinx process which doesn't require rewriting files on a disk. Also, this approach safer than rewriting files because we are sure our regex is applied only to links in docs (self.document.traverse(reference)) not to the whole document.

Live demo: https://lightgbm.readthedocs.io/en/sphinx/

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

ooooo yeah this is great! I just tried clicking through https://lightgbm.readthedocs.io/en/sphinx/ and it seems like internal links are all doing what we'd expect (including in the R package).

@StrikerRUS
Copy link
Collaborator Author

@jameslamb Thanks!

all doing what we'd expect (including in the R package)

Another +1 for this way of replacing extensions because R-package docs will be unaffected as they are outside of the Sphinx build tree. 😉 (We simply pick up their folder after Sphinx is finished.)

LightGBM/docs/conf.py

Lines 305 to 307 in eb9bbfb

app.connect("build-finished",
lambda app, exception: copy_tree(os.path.join(CURR_PATH, os.path.pardir, "lightgbm_r", "docs"),
os.path.join(app.outdir, "R"), verbose=0))

@StrikerRUS StrikerRUS merged commit c2dd54f into master Jan 7, 2021
@StrikerRUS StrikerRUS deleted the sphinx branch January 7, 2021 20:35
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants