Skip to content

Update docs theme version to 1.5#1308

Merged
zimnx merged 2 commits intoscylladb:masterfrom
rzetelskik:update-sphinx-1.5
Aug 16, 2023
Merged

Update docs theme version to 1.5#1308
zimnx merged 2 commits intoscylladb:masterfrom
rzetelskik:update-sphinx-1.5

Conversation

@rzetelskik
Copy link
Copy Markdown
Member

@rzetelskik rzetelskik commented Aug 3, 2023

Description of your changes: This PR updates the docs theme version to 1.5 as per https://sphinx-theme.scylladb.com/stable/upgrade/1-3-to-1-4.html and https://sphinx-theme.scylladb.com/stable/upgrade/1-4-to-1-5.html.
Underscores in source files are also replaced with hyphens due to a warning being thrown by Sphinx, causing the build to fail.

Which issue is resolved by this Pull Request:
Resolves #1201

@rzetelskik rzetelskik added kind/documentation Categorizes issue or PR as related to documentation. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Aug 3, 2023
@rzetelskik rzetelskik added this to the v1.10 milestone Aug 3, 2023
@rzetelskik rzetelskik marked this pull request as draft August 3, 2023 12:39
@annastuchlik
Copy link
Copy Markdown

@rzetelskik The new version of the theme triggers a warning if an underscore is encountered in a file name. The following files should be renamed to use a hyphen instead of the underscore:

  • known_issues
  • nodeoperations/automatic_cleanup
  • nodeoperations/maintenance_mode
  • nodeoperations/replace_node
  • nodeoperations/scylla_upgrade
  • scylla_cluster_crd

@rzetelskik rzetelskik marked this pull request as ready for review August 3, 2023 12:50
@rzetelskik
Copy link
Copy Markdown
Member Author

@annastuchlik yup, I've updated the PR just before your comment. Should be fine now.

Copy link
Copy Markdown
Contributor

@tnozicka tnozicka left a comment

Choose a reason for hiding this comment

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

modulo Makefile, this lgtm

Comment thread docs/Makefile Outdated
@annastuchlik
Copy link
Copy Markdown

Let me look into it with @dgarcia360 before I approve or suggest an update. Thanks.

@rzetelskik rzetelskik requested a review from tnozicka August 4, 2023 07:37
@annastuchlik
Copy link
Copy Markdown

annastuchlik commented Aug 4, 2023

I'm unable to build the docs. It looks like more updates are required to the Makefile. @dgarcia360 Can you provide the details?

Copy link
Copy Markdown
Contributor

@tnozicka tnozicka left a comment

Choose a reason for hiding this comment

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

/lgtm

I'll give @annastuchlik a while to see if it works for her

@rzetelskik
Copy link
Copy Markdown
Member Author

I'm unable to build the docs. It looks like more updates are required to the Makefile.

@annastuchlik can you elaborate? What did you try? What do you mean by being unable to build the docs?

@annastuchlik
Copy link
Copy Markdown

I get the following error:

Traceback (most recent call last):
  File "C:\Users\annstu\.poetry\bin\poetry", line 17, in <module>
    from poetry.console import main
ModuleNotFoundError: No module named 'poetry.console'
make: *** [Makefile:24: preview] Error 1

@scylla-operator-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rzetelskik, tnozicka

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@scylla-operator-bot scylla-operator-bot Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 8, 2023
@rzetelskik
Copy link
Copy Markdown
Member Author

I get the following error:

Traceback (most recent call last):
  File "C:\Users\annstu\.poetry\bin\poetry", line 17, in <module>
    from poetry.console import main
ModuleNotFoundError: No module named 'poetry.console'
make: *** [Makefile:24: preview] Error 1

@annastuchlik please try the following:

podman run -it --rm -v="$( pwd ):/go/$( go list -m )" --workdir="/go/$( go list -m )/docs" -p 5500:5500 ubuntu:20.04 bash -c 'apt-get update && apt-get install -y curl python3 python3-distutils make git && ./hack/install-poetry.sh && $HOME/.poetry/bin/poetry install && make dirhtml SPHINXOPTS="--keep-going" && make redirects && make preview'

It's what our workflow does essentially.

@dgarcia360
Copy link
Copy Markdown
Contributor

Hi @annastuchlik, @tnozicka, and @rzetelskik,

While these changes will build the docs as expected for prod, building the docs locally differs from how we do it in other projects. I'm sharing some proposed modifications to the Makefile:

  1. Modify the POETRY variable to ensure compatibility for Windows:

    POETRY        = poetry
    
    # For Windows users
    ifeq ($(OS),Windows_NT)
        POETRY = $(APPDATA)\Python\Scripts\poetry
    endif
    
  2. Include the setup step before executing commands to generate documentation. For example:

    # Preview commands
    .PHONY: preview
    preview: setup
        $(POETRY) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500
    

    This ensures that the latest version of the dependencies are installed before building the docs.

    If this suggestions don't align with your preferences, I'd like to propose an alternative. To provide more context, I'm sharing a README from another project that outlines their build process, which is different from the one provided by the Sphinx Theme:https://github.com/scylladb/cpp-driver/blob/dacab2ced2fa84d798723d13ecb8c8f658f28d30/README-dev.md

    You could create a similar "README-dev.md" within the docs directory, explaining the considerations needed to run the docs locally. For example:

    # Building the docs
    
    This project uses [Sphinx Theme](https://sphinx-theme.scylladb.com/) , but we have modified the base project to adapt it to our workflows.
    
    ## Local preview
    
    To build the documentation locally, run `make setup` first.
    
    Then, you can build and preview the documentation by following the steps outlined in the [Quickstart guide](https://sphinx-theme.scylladb.com/stable/getting-started/quickstart.html).
    
    ## Custom workflows 
    
    (optional) Explain other  customization. 

@rzetelskik
Copy link
Copy Markdown
Member Author

rzetelskik commented Aug 8, 2023

@dgarcia360 thanks!
Ad 2. I suppose we could add the setup target and dirhtml/multiversion and redirects as prerequisites for preview and multiversionpreview.
It won't affect our workflow and if it'll align our Makefile with other projects, then I don't see why not. Same goes for Windows compatibility I guess Windows compatibility would require a separate setup script, so I guess a readme saying we don't support it would be good enough.

Having said that, it should go in a separate PR. @tnozicka any objections?

@tnozicka
Copy link
Copy Markdown
Contributor

tnozicka commented Aug 9, 2023

I believe setup shouldn't be a prerequisite to preview (aka) run, nor any of the other targets in the upstream makefile. If you run it a second time, it shouldn't install dependencies again, every time. Separate make invocations give you the option, the is no way to achieve that the other way around. Often times dependency management is left to the user as a common knowledge and not put in the makefile (devs already need to know how to bump the deps).

Adding a README looks reasonable.

I don't mind a windows snippet if the is no other way, but I isn't there something like PATH for windows as well?

@rzetelskik
Copy link
Copy Markdown
Member Author

@tnozicka @annastuchlik @dgarcia360 please see #1323

@tnozicka
Copy link
Copy Markdown
Contributor

/lgtm

With readme shipping in #1323 are there any concerns about the content of this PR or can we land this bump?

@scylla-operator-bot scylla-operator-bot Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2023
@scylla-operator-bot scylla-operator-bot Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2023
@rzetelskik
Copy link
Copy Markdown
Member Author

With readme shipping in #1323 are there any concerns about the content of this PR or can we land this bump?

I don't think they interfere with each other so I believe they can land in any order.

@zimnx zimnx force-pushed the update-sphinx-1.5 branch from f88681a to 7ec1d9a Compare August 16, 2023 10:13
@tnozicka
Copy link
Copy Markdown
Contributor

/lgtm

@scylla-operator-bot scylla-operator-bot Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2023
@zimnx zimnx merged commit a77a991 into scylladb:master Aug 16, 2023
@rzetelskik rzetelskik deleted the update-sphinx-1.5 branch August 16, 2023 11:02
@annastuchlik
Copy link
Copy Markdown

@rzetelskik @tnozicka Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation Categorizes issue or PR as related to documentation. lgtm Indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: update theme 1.5

5 participants