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

Break up style guide into multiple pages #53

Merged

Conversation

bourque
Copy link
Collaborator

@bourque bourque commented Aug 6, 2023

Change Summary

Overview

This PR splits up the sections of the style guide into their own pages. The Release Workflow is also moved from out of the style guide.

New Files

  • Several new .rst files for each of the sections of the style guide

Updated Files

  • style-guide.rst
    • Removed most of the content, and now instead including the individual .rst files are the content
    • Removed the Release Workflow section, as it is now outside of the style guide

@bourque bourque added the Repo: Documentation Improvements or additions to documentation label Aug 6, 2023
@bourque bourque self-assigned this Aug 6, 2023
@bourque
Copy link
Collaborator Author

bourque commented Aug 6, 2023

While the sections of the style guide are now in their own .rst files, I currently have the contents of these files just 'included' in the main style-guide.rst file, e.g.:

.. include:: git-and-github-workflow.rst
.. include:: python-coding.rst
.. include:: api-documentation.rst
.. include:: poetry-environment.rst
.. include:: security.rst
.. include:: naming-conventions.rst
.. include:: tools-and-library-recommendations.rst
.. include:: versioning.rst
.. include:: checklist-for-pull-requests.rst

Therefore, when viewing the docs on RTD, they still appear as subsections of the style guide instead of their own separate pages. I have been struggling to figure out how to create separate pages AND have the navigation bar look like:

Style Guide
  git and GitHub Workflow
  Python Coding
  Poetry Environment
  ...

@maxinelasp Do you know how I might accomplish getting these sections into their own pages, and also get the navigation to reflect that these pages are under the Style Guide 'umbrella'?

@maxinelasp
Copy link
Contributor

Yes, you can use a toctree to do that. See index.rst for an example for how it looks in production. I think that will accomplish what you're looking for.

@maxinelasp
Copy link
Contributor

I think .. include:: just embeds the document into the main one, which doesn't seem right. I'd recommend taking that out. I think it's also causing some errors in the build process about duplicate labels, although I'm not sure if that's some other issue instead.

@bourque
Copy link
Collaborator Author

bourque commented Aug 7, 2023

Thanks @maxinelasp

I am still a little confused. If I use this in index.rst:

.. toctree::
    :maxdepth: 1

    doc-overview
    release-workflow
    style-guide
    git-and-github-workflow
    python-coding
    api-documentation
    poetry-environment
    security
    naming-conventions
    tools-and-library-recommendations
    versioning
    checklist-for-pull-requests

This does create separate pages for each of the items like I want. But it results in a navigation that looks like this:

Screen Shot 2023-08-07 at 09 54 24

It would be ideal if the style-guide page could act as a parent page/tree to the other sections, something like:

Contributing to Documentation
Release Workflow
Style Guide
|    git and GitHub workflow
|    Python Coding
|    ...etc

I tried messing with maxdepth but that just seems to control which subsections of a file get displayed. I also tried moving the sections of the style guide into their own style_guide subdirectory and trying things that way.

I must also be googling the wrong combination of words because I can't seem to find a relevant StackOverflow or equivalent 😬

@maxinelasp
Copy link
Contributor

You can create a new folder ("development/style_guide") and add all documents under that. Then, create a toctree in style_guide.rst that has all the new files you want. Then, update index.rst to only have style_guide in the toctree. This creates another layer in the files:
index.rst > style_guide.rst > python_coding, git_workflow, etc

This way, the main index.rst will only link to the main style guide page, but the style guide page will then link to all the sub pages. Is that what you want?

@bourque
Copy link
Collaborator Author

bourque commented Aug 7, 2023

Ahh, perfect, thank you @maxinelasp!

… organize them all under a parent style-guide page
@bourque bourque changed the title [WIP] Break up style guide into multiple pages Break up style guide into multiple pages Aug 7, 2023
@bourque bourque requested a review from maxinelasp August 7, 2023 16:18
@bourque
Copy link
Collaborator Author

bourque commented Aug 7, 2023

@maxinelasp Now could you review this? 😅

No need to review the content of the pages as those have not changed.

Copy link
Contributor

@maxinelasp maxinelasp left a comment

Choose a reason for hiding this comment

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

Looks great and runs without errors! Thanks for doing this, I think it's a lot easier to navigate!

@bourque bourque merged commit 874c9a9 into IMAP-Science-Operations-Center:dev Aug 7, 2023
@bourque bourque deleted the style-guide-multiple-pages branch August 7, 2023 16:44
laspsandoval pushed a commit to laspsandoval/imap_processing that referenced this pull request Nov 15, 2023
…le-guide-multiple-pages

Break up style guide into multiple pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repo: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants