-
Notifications
You must be signed in to change notification settings - Fork 341
DOCS: refactor developer docs #538
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 all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c5eb5a0
DOCS: refactor dev docs
choldgraf 2fe7afe
Add http.server reference to quickly serve the built site
damianavila f0fefe9
Update docs/contribute/setup.md
choldgraf 159778e
Merge pull request #4 from damianavila/add_http_server
choldgraf e763a20
Update docs/contribute/topics.md
choldgraf 3a8a8cd
Update noxfile.py
choldgraf d7dbe18
Update docs/contribute/setup.md
choldgraf 2513ba3
Update docs/contribute/setup.md
choldgraf de670a1
Address review comments
choldgraf f7eca0e
Merge branch 'FIX-devdocs' of https://github.com/choldgraf/pydata-sph…
choldgraf 360a762
Address PR comments
choldgraf 503e7f9
Update docs/conf.py
jorisvandenbossche f77c741
Add back custom template
choldgraf 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<div class="sidebar-message"> | ||
This is a community-supported theme. | ||
If you'd like to contribute, | ||
<a href="https://github.com/pydata/pydata-sphinx-theme">check out our GitHub repository</a> | ||
Your contributions are welcome! | ||
This is a community-supported theme. | ||
If you'd like to contribute, | ||
<a href="https://github.com/pydata/pydata-sphinx-theme">check out our GitHub repository</a> | ||
Your contributions are welcome! | ||
</div> |
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 +1,2 @@ | ||
v{{ version }} | ||
<!-- A small template snippet for theme testing --> | ||
TEST: v{{ version }} |
This file was deleted.
Oops, something went wrong.
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,58 @@ | ||
--- | ||
html_meta: | ||
"description lang=en": "How to become a contributor to the pydata-sphinx-theme." | ||
--- | ||
|
||
# Contribute | ||
|
||
These pages contain information about how you can get up-and-running with a development version of this theme, and how you can contribute to the project. | ||
|
||
## Workflow for contributing changes | ||
|
||
We follow a [typical GitHub workflow](https://guides.github.com/introduction/flow/) | ||
of: | ||
|
||
- create a personal fork of this repo | ||
- create a branch | ||
- open a pull request | ||
- fix findings of various linters and checks | ||
- work through code review | ||
|
||
For each pull request, the demo site is built and deployed to make it easier to review | ||
the changes in the PR. To access this, click on the "ReadTheDocs" preview in the CI/CD jobs. | ||
|
||
## Location and structure of documentation | ||
|
||
The documentation for this theme is in the `docs/` folder. | ||
It is structured as a [Sphinx documentation site](https://sphinx-doc.org). | ||
The content is written in a combination of reStructuredText and MyST Markdown. | ||
|
||
## Location and structure of CSS/JS assets | ||
|
||
The CSS and JS for this theme are built for the browser from `src/pydata_sphinx_theme/assets/*` with | ||
[webpack](https://webpack.js.org/). The main entrypoints are: | ||
|
||
- CSS: `src/pydata_sphinx_theme/assets/styles/index.scss` | ||
|
||
- the main part of the theme assets | ||
- customizes [Bootstrap](https://getbootstrap.com/) with [Sass](https://sass-lang.com) | ||
- points to the `font-face` of vendored web fonts, but does not include their | ||
CSS `@font-face` declaration | ||
|
||
- JS: `src/pydata_sphinx_theme/assets/scripts/index.js` | ||
|
||
- provides add-on Bootstrap features, as well as some custom navigation behavior | ||
|
||
- webpack: `webpack.config.js` | ||
|
||
- captures the techniques for transforming the JS and CSS source files in | ||
`src/pydata_sphinx_theme/assets/*` into the production assets in `src/theme/pydata_sphinx_theme/static/` | ||
|
||
**For more information** about developing this theme, see the sections below and in the left sidebar. | ||
|
||
```{toctree} | ||
:maxdepth: 2 | ||
setup | ||
topics | ||
manual | ||
``` |
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,76 @@ | ||
(manual-environment)= | ||
|
||
# Set up a manual development environment | ||
|
||
If you prefer not to use automation tools like `nox`, or want to have more control over the specific version of packages that you'd like like installed, you may also manually set up a development environment locally. | ||
|
||
To do so, follow the instructions on this page. | ||
|
||
## Create a new development environment | ||
|
||
This is optional, but it's best to start with a fresh development environment so that you've isolated the packages that you're using for this repository. | ||
|
||
To do so, use a tool like [conda](https://docs.conda.io/en/latest/), [mamba](https://github.com/mamba-org/mamba), or [virtualenv](https://virtualenv.pypa.io/). | ||
|
||
## Clone the repository locally | ||
|
||
First clone this repository from the `pydata` organization, or from a fork that you have created: | ||
|
||
```console | ||
$ git clone https://github.com/pydata/pydata-sphinx-theme | ||
$ cd pydata-sphinx-theme | ||
``` | ||
|
||
## Install the `sphinx-theme-builder` | ||
|
||
We use the `sphinx-theme-builder` to install `nodejs` locally and to compile all CSS and JS assets needed for the theme. | ||
Install it like so (note the `cli` option so that we can run it from the command line): | ||
|
||
```console | ||
$ pip install sphinx-theme-builder[cli] | ||
``` | ||
|
||
## Install this theme locally | ||
|
||
Next, install this theme locally so that we have the necessary dependencies to build the documentation and testing suite: | ||
|
||
```console | ||
$ pip install -e .[dev] | ||
``` | ||
|
||
Note that the `sphinx-theme-builder` will automatically install a local copy of `nodejs` for building the theme's assets. | ||
This will be placed in a `.nodeenv` folder. | ||
|
||
## Build the documentation | ||
|
||
To manually build the documentation, run the following command: | ||
|
||
```console | ||
$ sphinx-build docs docs/_build/html | ||
``` | ||
|
||
## Compile web assets (JS/CSS) | ||
|
||
To compile the javascript and CSS assets for the theme, run the following command: | ||
|
||
```console | ||
$ stb compile | ||
``` | ||
|
||
This will compile everything in the `src/pydata_sphinx_theme/assets` folder and place them in the appropriate places in our theme's folder structure. | ||
|
||
## Start a live-server to build and serve your documentation | ||
|
||
To manually open a server to watch your documentation for changes, build them, and display them locally in a browser, run this command: | ||
|
||
```console | ||
$ stb serve docs --open-browser | ||
``` | ||
|
||
## Run the tests | ||
|
||
To manually run the tests for this theme, first set up your environment locally, and then run: | ||
|
||
```console | ||
$ pytest | ||
``` |
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.