-
Notifications
You must be signed in to change notification settings - Fork 8
docs: add contribute section #636
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
fba63d4
docs: add contribute session
Revathyvenugopal162 9cc3174
docs: add build docs
Revathyvenugopal162 1004774
docs: add contribute page
Revathyvenugopal162 902b814
docs: add dependency
Revathyvenugopal162 d78ea42
docs: add contribute
Revathyvenugopal162 fa9ef1f
docs: add contribute link
Revathyvenugopal162 2ca6ade
chore: adding changelog file 636.documentation.md [dependabot-skip]
pyansys-ci-bot d432baf
docs: update dependabot
Revathyvenugopal162 7d2eb43
Merge branch 'docs/contribute' of https://github.com/ansys/ansys-sphi…
Revathyvenugopal162 19fb17f
docs: update dependabot
Revathyvenugopal162 1b5d1cd
docs: update dependabot
Revathyvenugopal162 76e3226
docs: add tox usage
Revathyvenugopal162 dfc6cee
fix: docs error
Revathyvenugopal162 03ee2e6
fix: docs cleanup
Revathyvenugopal162 efaa130
fix: tox clean command
Revathyvenugopal162 ecc4e7c
fix: tox clean command
Revathyvenugopal162 b7251c6
docs: add dist tox commad
Revathyvenugopal162 270f4eb
Apply suggestions from code review
Revathyvenugopal162 907f8a2
docs: fix links
Revathyvenugopal162 d91eaea
Update doc/source/contribute/developer.rst
Revathyvenugopal162 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,16 @@ | ||
| # Contributing | ||
|
|
||
| If you are interested in contributing to our project, please make sure to review | ||
| our contribution guidelines, which are specified in the | ||
| [PyAnsys Developer's Documentation - Contributing](https://dev.docs.pyansys.com/how-to/contributing.html) page. This document | ||
| outlines the process for submitting issues, proposing changes, and making pull | ||
| requests to our codebase. Following these guidelines will help ensure that your | ||
| contributions are properly integrated and reviewed, and will help maintain the | ||
| overall quality and consistency of the project. Thank you for your interest in | ||
| contributing to our community. | ||
| We absolutely welcome any code contributions and we hope that this | ||
| guide will facilitate an understanding of the Ansys sphinx theme code | ||
| repository. It is important to note that while the Ansys sphinx theme software | ||
Revathyvenugopal162 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| package is maintained by ANSYS and any submissions will be reviewed | ||
Revathyvenugopal162 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| thoroughly before merging, we still seek to foster a community that can | ||
| support user questions and develop new features to make this software | ||
| a useful tool for all users. As such, we welcome and encourage any | ||
| questions or submissions to this repository. | ||
|
|
||
| For contributing to this project, please refer to the [PyAnsys Developer's Guide]. | ||
| Further information about contributing to Ansys sphinx theme can be found in [Contributing]. | ||
Revathyvenugopal162 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [PyAnsys Developer's Guide]: https://dev.docs.pyansys.com/index.html | ||
| [Contributing]: https://sphinxdocs.ansys.com/version/dev/contribute.html | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| docs: add contribute section |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
|
|
||
| Contribute | ||
| ########## | ||
|
|
||
| Thank you for your interest in contributing to Ansys Sphinx theme! Contributions are welcome | ||
| to make the project better, whether it's fixing bugs, adding new features, or | ||
| improving documentation. Below are the guidelines to follow when contributing. | ||
|
|
||
|
|
||
| .. grid:: | ||
| :gutter: 1 2 3 3 | ||
| :padding: 1 2 3 3 | ||
|
|
||
| .. grid-item-card:: :fa:`user` User | ||
| :link: contribute/user | ||
| :link-type: doc | ||
|
|
||
| Learn how to contribute as a user. | ||
|
|
||
| .. grid-item-card:: :fa:`code-fork` Developer | ||
| :link: contribute/developer | ||
| :link-type: doc | ||
|
|
||
| Learn how to contribute as a developer. | ||
|
|
||
|
|
||
| .. toctree:: | ||
| :hidden: | ||
| :maxdepth: 1 | ||
| :caption: Contribute | ||
|
|
||
| User<contribute/user> | ||
| Developer<contribute/developer> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,241 @@ | ||
| Contributing as a developer | ||
| ########################### | ||
|
|
||
| .. grid:: 1 1 3 3 | ||
|
|
||
| .. grid-item-card:: :fa:`code-fork` Fork the repository | ||
| :padding: 2 2 2 2 | ||
| :link: fork-the-repository | ||
| :link-type: ref | ||
|
|
||
| Learn how to fork the project and get your own copy. | ||
|
|
||
| .. grid-item-card:: :fa:`download` Clone the repository | ||
| :padding: 2 2 2 2 | ||
| :link: clone-the-repository | ||
| :link-type: ref | ||
|
|
||
| Download your own copy in your local machine. | ||
|
|
||
| .. grid-item-card:: :fa:`download` Install for developers | ||
| :padding: 2 2 2 2 | ||
| :link: install-for-developers | ||
| :link-type: ref | ||
|
|
||
| Install the project in editable mode. | ||
|
|
||
|
|
||
| .. _fork-the-repository: | ||
|
|
||
| Fork the repository | ||
| =================== | ||
|
|
||
| Forking the repository is the first step to contributing to the project. This | ||
Revathyvenugopal162 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| allows you to have your own copy of the project so you can make changes without | ||
| affection the main project. Once you have made your changes, you can submit a | ||
| pull-request to the main project to have your changes reviewed and merged. | ||
|
|
||
| .. button-link:: https://github.com/ansys/ansys-sphinx-theme/fork | ||
| :color: primary | ||
| :align: center | ||
|
|
||
| :fa:`code-fork` Fork this project | ||
|
|
||
| .. note:: | ||
|
|
||
| If you are an Ansys employee, you can skip this step. | ||
|
|
||
| .. _clone-the-repository: | ||
|
|
||
| Clone the repository | ||
| ==================== | ||
|
|
||
| Make sure you `configure SSH`_ with your GitHub | ||
| account. This allows you to clone the repository without having to use tokens | ||
| or passwords. Also, make sure you have `git`_ installed in your machine. | ||
|
|
||
| To clone the repository using SSH, run: | ||
|
|
||
| .. code-block:: bash | ||
| git clone [email protected]:ansys/ansys-sphinx-theme | ||
| .. _install-for-developers: | ||
|
|
||
| Install for developers | ||
| ====================== | ||
|
|
||
| Installing Ansys sphinx theme in development mode allows you to perform changes to the code | ||
| and see the changes reflected in your environment without having to reinstall | ||
| the library every time you make a change. | ||
|
|
||
| Virtual environment | ||
| ------------------- | ||
|
|
||
| Start by navigating to the project's root directory by running: | ||
|
|
||
| .. code-block:: bash | ||
| cd ansys-sphinx-theme | ||
| Then, create a new virtual environment named ``.venv`` to isolate your system's | ||
| Python environment by running: | ||
|
|
||
| .. code-block:: bash | ||
| python -m venv .venv | ||
| Finally, activate this environment by running: | ||
|
|
||
| .. tab-set:: | ||
|
|
||
| .. tab-item:: Windows | ||
|
|
||
| .. tab-set:: | ||
|
|
||
| .. tab-item:: CMD | ||
|
|
||
| .. code-block:: bash | ||
| .venv\Scripts\activate.bat | ||
| .. tab-item:: PowerShell | ||
|
|
||
| .. code-block:: bash | ||
| .venv\Scripts\Activate.ps1 | ||
| .. tab-item:: macOS/Linux/UNIX | ||
|
|
||
| .. code-block:: bash | ||
| source .venv/bin/activate | ||
| Development mode | ||
| ---------------- | ||
|
|
||
| Now, install Ansys sphinx theme in editable mode by running: | ||
|
|
||
| .. code-block:: bash | ||
| python -m pip install --editable . | ||
| Verify the installation by checking the version of the library: | ||
|
|
||
|
|
||
| .. code-block:: python | ||
| from ansys_sphinx_theme import __version__ | ||
| print(f"Ansys sphinx thenme version is {__version__}") | ||
| .. jinja:: | ||
|
|
||
| .. code-block:: bash | ||
| >>> Ansys sphinx theme version is {{ ANSYS_SPHINX_THEME_VERSION }} | ||
| Install ``Tox`` | ||
| --------------- | ||
|
|
||
| Once the project is installed, you can install `Tox`_. This is a cross-platform | ||
| automation tool. The main advantage of Tox is that it allows you to test your | ||
| project in different environments and configurations in a temporary and | ||
| isolated Python virtual environment. To install Tox, run: | ||
|
|
||
| .. code-block:: bash | ||
| python -m pip install tox | ||
| Finally, verify the installation by listing all the different environments | ||
| (automation rules) for Ansys Sphinx theme: | ||
|
|
||
| .. code-block:: bash | ||
| python -m tox list | ||
| .. jinja:: toxenvs | ||
|
|
||
| .. dropdown:: Default Tox environments | ||
| :animate: fade-in | ||
| :icon: three-bars | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
| :widths: auto | ||
|
|
||
| * - Environment | ||
| - Description | ||
| - usage | ||
| {% for environment in envs %} | ||
| {% set name, description = environment.split("->") %} | ||
| * - {{ name }} | ||
| - {{ description }} | ||
| - python -m tox -e {{ name }} | ||
| {% endfor %} | ||
|
|
||
|
|
||
| Adhere to code style | ||
| -------------------- | ||
|
|
||
| Ansys Sphinx theme follows the PEP8 standard as outlined in | ||
| `PEP 8 <https://dev.docs.pyansys.com/coding-style/pep8.html>`_ in | ||
| the *PyAnsys Developer's Guide* and implements style checking using | ||
| `pre-commit <https://pre-commit.com/>`_. | ||
|
|
||
| To ensure your code meets minimum code styling standards, run these commands:: | ||
|
|
||
| pip install pre-commit | ||
| pre-commit run --all-files | ||
|
|
||
| or use tox as above:: | ||
|
|
||
| tox -e code-style | ||
|
|
||
| You can also install this as a pre-commit hook by running this command:: | ||
|
|
||
| pre-commit install | ||
|
|
||
| This way, it's not possible for you to push code that fails the style checks:: | ||
|
|
||
| $ pre-commit install | ||
| $ git commit -am "added my cool feature" | ||
| ruff.....................................................................Passed | ||
| ruff-format..............................................................Passed | ||
| codespell................................................................Passed | ||
| prettier.................................................................Passed | ||
| check for merge conflicts................................................Passed | ||
| debug statements (python)................................................Passed | ||
| check yaml...............................................................Passed | ||
| trim trailing whitespace.................................................Passed | ||
| Validate GitHub Workflows................................................Passed | ||
| Add License Headers......................................................Passed | ||
|
|
||
|
|
||
| Build the documentation | ||
| ----------------------- | ||
|
|
||
| To build documentation locally, you can either use tox as mentioned above or | ||
Revathyvenugopal162 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| run the following commands: | ||
|
|
||
| 1. Install the required dependencies by running:: | ||
|
|
||
| pip install -e .[doc] | ||
Revathyvenugopal162 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 2. Build the documentation by running:: | ||
|
|
||
| # On Linux or macOS | ||
| make -C doc/ html | ||
|
|
||
| # On Windows | ||
| doc\make.bat html | ||
|
|
||
| 3. The documentation is built in the ``doc/_build/html`` directory. Open the | ||
| ``index.html`` file in your browser to view the documentation. | ||
|
|
||
| You can clean the build directory by running:: | ||
|
|
||
| # On Linux or macOS | ||
| make -C doc/ clean | ||
|
|
||
| # On Windows | ||
| doc\make.bat clean | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.