spyder-ide / spyder-docs

Documentation for Spyder, the Scientific Python Development Environment
https://docs.spyder-ide.org
MIT License
33 stars 283 forks source link

PR: Add explanation on the use of subsections in the Outline Explorer #285

Closed ghost closed 2 years ago

ghost commented 2 years ago

Pull Request

Pull Request Checklist

Description of Changes

I added a paragraph on the use of subsections in the Editor to create a multi-level outline view in the Outline Explorer.

Issue(s) Resolved

Fixes #

CAM-Gerlach commented 2 years ago

Hey @ba-tno ; thanks for your contribution! Despite being the most important pane, our Editor is the only one that doesn't have properly written docs about it yet, so every little bit helps. This looks like a great addition (and something we planned to add ourselves, we just haven't gotten to it yet).

However, there's an issue with this PR, which might not only create problems for us but also for you: it looks like you have accidentally made your changes directly on your fork's master branch instead of creating a feature branch for your changes. This is something that's easy to do accidentally, and in fact we sometimes do it too; we actually have a pre-commit hook that checks for this and prevents this from happening, but unfortunately we had it disabled temporarily (and make sure to install them as our contributing guide instructs).

Never, fear, though, this is easy to fix. From the master branch at the root of your local spyder-docs repository, run the following commands (assuming origin is your fork and upstream is the Spyder docs repo; see our contributing guide on how to set that up if that's not the case):

git checkout master
git reset HEAD~
git push -f origin master
git checkout -b add-subsection-explanation
git add . && git commit -m "Add explanation on the use of subsections in the Outline Explorer"

Given this equally applies to the 4.x branch, I suggest you base your changes against that instead of master (and make sure to set your PR target branch accordingly). The following will do that for you:

git checkout 4.x
git pull upstream 4.x
git checkout add-subsection-explanation
git rebase --onto 4.x master add-subsection-explanation

Finally, push your changes to your remote with git push -u origin add-subsection-explanation, close this PR and create a new pull request against 4.x.

As a sidenote, we can fix it for you when we merge, but remember to follow the standard convention for commit messages, particularly phrasing them in the imperative ("Add", not "Added") and no period at the end; our pre-commit hooks will check that for you. Thanks, and looking forward to reviewing this!

CAM-Gerlach commented 2 years ago

Hey @ba-tno , let us know if you need any help with that!