Skip to content

Commit 6b71d7f

Browse files
authored
Merge pull request #201 from dgarcia360/branch-1.0
Add Scylla Sphinx Theme 1.0
2 parents 9e452be + 1b97f8d commit 6b71d7f

File tree

411 files changed

+20795
-14105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

411 files changed

+20795
-14105
lines changed

.babelrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": ["@babel/plugin-proposal-class-properties"]
4+
}

.github/workflows/[email protected]

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Publish docs to GitHub Pages"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "docs/**"
9+
jobs:
10+
release:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
persist-credentials: false
18+
fetch-depth: 0
19+
- name: Set up Python
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: 3.7
23+
- name: Build docs
24+
run: |
25+
export PATH=$PATH:~/.local/bin
26+
cd docs
27+
make multiversion
28+
- name: Deploy
29+
run: ./docs/_utils/deploy.sh
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/[email protected]

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Build docs on pull requests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths:
8+
- "docs/**"
9+
10+
jobs:
11+
release:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
persist-credentials: false
19+
fetch-depth: 0
20+
- name: Set up Python
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: 3.7
24+
- name: Build docs
25+
run: |
26+
export PATH=$PATH:~/.local/bin
27+
cd docs
28+
make test

.github/workflows/pages.yml

-31
This file was deleted.

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ ipython_config.py
173173

174174
# pyenv
175175
.python-version
176-
poetry.lock
177176
# pipenv
178177
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
179178
# However, in case of collaboration, if having platform-specific dependencies or dependencies
@@ -213,4 +212,3 @@ dmypy.json
213212

214213
# Pyre type checker
215214
.pyre/
216-

.postcss.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: {
3+
"postcss-preset-env": {
4+
browsers: "last 2 versions",
5+
},
6+
},
7+
};

.pre-commit-config.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: build-assets
5+
name: build-assets
6+
entry: npm run
7+
args: ["build"]
8+
language: system
9+
pass_filenames: false
10+
11+
- repo: https://github.com/pre-commit/mirrors-prettier
12+
rev: v2.3.0
13+
hooks:
14+
- id: prettier
15+
16+
- repo: https://github.com/psf/black
17+
rev: 21.5b1
18+
hooks:
19+
- id: black
20+
21+
- repo: git://github.com/pre-commit/pre-commit-hooks
22+
rev: v4.0.1
23+
hooks:
24+
- id: check-added-large-files
25+
- id: check-case-conflict
26+
- id: check-json
27+
- id: check-yaml
28+
- id: end-of-file-fixer
29+
exclude: "sphinx_scylladb_theme/static"
30+
- id: forbid-new-submodules
31+
- id: trailing-whitespace

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx_scylladb_theme/static

CHANGELOG.md

+26-9
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,31 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.1.25] - 05 July 2021
8+
## [1.0] - 01 September 2021
9+
10+
### Added
11+
12+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): We’ve made a number of updates to the look and feel of the theme to improve the overall user experience.
13+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The static front end files (CSS, JS, and images) are now managed with `webpack`. For more information, see [Contribute to the Theme](https://sphinx-theme.scylladb.com/stable/contribute/contribute-theme.html).
14+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The promo banner now supports icons with the option theme option `banner_icon_path`. For more information, see [Template Options](https://sphinx-theme.scylladb.com/stable/configuration/template.html).
15+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The contribute button adds the option "Edit on GitHub". To configure your project to support this option, read [Template Options](https://sphinx-theme.scylladb.com/stable/configuration/template.html).
16+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): We run hooks on every commit to automatically point out linting issues.
17+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The new workflow `docs-pr` runs on pull requests to make sure docs build without warnings before being merged. For more information, see [Deployment](https://sphinx-theme.scylladb.com/stable/github-pages.html).
18+
19+
### Changed
20+
21+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): Topics boxes (cards) can be used in other sections, and not just on the home page. We now have different layouts to suit most projects' needs. Check them out at [Topic Boxes](https://sphinx-theme.scylladb.com/stable/examples/topic-box)
922

1023
### Fixed
1124

12-
- [#171](https://github.com/scylladb/sphinx-scylladb-theme/pull/194): FontAwesome 5.0 backwards compatibility.
25+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): We've added more unit tests to the project, especially to extensions.
26+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): We've fixed JavaScript warnings and errors raised by the console.
1327

28+
## [0.1.25] - 05 July 2021
29+
30+
### Fixed
31+
32+
- [#194](https://github.com/scylladb/sphinx-scylladb-theme/pull/194): FontAwesome 5.0 backwards compatibility.
1433

1534
## [0.1.24] - 17 June 2021
1635

@@ -52,20 +71,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5271

5372
### Added
5473

55-
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): ``smv_rename_latest_version`` setting in ``conf.py`` overrides the latest version output directory.
74+
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): `smv_rename_latest_version` setting in `conf.py` overrides the latest version output directory.
5675

5776
### Changed
5877

59-
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): Moved ``smv_latest_version`` from ``github/workflows/pages.yml`` to ``conf.py``.
78+
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): Moved `smv_latest_version` from `github/workflows/pages.yml` to `conf.py`.
6079

6180
### Removed
6281

63-
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): ``_utils/redirects.sh`` script.
82+
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): `_utils/redirects.sh` script.
6483

6584
### Fixed
6685

67-
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): ``make multiversionpreview`` was not redirecting automatically to the latest version.
68-
86+
- [#121](https://github.com/scylladb/sphinx-scylladb-theme/issues/121): `make multiversionpreview` was not redirecting automatically to the latest version.
6987

7088
## [0.1.20] - 19 Jan 2021
7189

@@ -92,7 +110,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
92110

93111
- [#103](https://github.com/scylladb/sphinx-scylladb-theme/issues/103): Report button does not break when the page title has inlines.
94112

95-
96113
## [0.1.18] - 31 Dec 2020
97114

98115
### Added
@@ -112,7 +129,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112129

113130
- [#83](https://github.com/scylladb/sphinx-scylladb-theme/issues/83): Copyright year in the footer is now updated automatically.
114131

115-
116132
## [0.1.15] - 17 Nov 2020
117133

118134
### Added
@@ -152,6 +168,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
152168
- [#59](https://github.com/scylladb/sphinx-scylladb-theme/issues/59): All projects now share a 404 page.
153169
- [#58](https://github.com/scylladb/sphinx-scylladb-theme/issues/58): Support for redirections.
154170

171+
[1.0]: https://github.com/scylladb/sphinx-scylladb-theme/compare/0.1.25...1.0.4
155172
[0.1.25]: https://github.com/scylladb/sphinx-scylladb-theme/compare/0.1.24...0.1.25
156173
[0.1.24]: https://github.com/scylladb/sphinx-scylladb-theme/compare/0.1.23...0.1.24
157174
[0.1.23]: https://github.com/scylladb/sphinx-scylladb-theme/compare/0.1.22...0.1.23

PYPI.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
==========================
2-
Scylla Documentation Theme
3-
==========================
1+
===================
2+
Scylla Sphinx Theme
3+
===================
44

5-
Sphinx theme for ScyllaDB documentation projects.
5+
Sphinx theme for Scylla documentation projects.
66

77
`Read More: <https://github.com/scylladb/sphinx-scylladb-theme>`_

README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
=====================
2-
Sphinx ScyllaDB Theme
3-
=====================
1+
===================
2+
Scylla Sphinx Theme
3+
===================
44

5-
Sphinx theme for ScyllaDB documentation projects.
5+
Sphinx theme for Scylla documentation projects.
66

77
The theme is available as a `PyPI <https://pypi.org/project/sphinx-scylladb-theme/>`_ package, and has been tested with Python 3.7, Sphinx 2.4.4 and Fedora 32.
88

@@ -11,7 +11,7 @@ Features
1111

1212
**Shared Design**
1313

14-
All ScyllaDB documentation sites share a common look and feel.
14+
All Scylla documentation sites share a common look and feel.
1515

1616
**Multiversion Support**
1717

config/paths.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
// Source files
5+
src: path.resolve(__dirname, "../src"),
6+
7+
// Production build files
8+
build: path.resolve(__dirname, "../sphinx_scylladb_theme/static"),
9+
10+
// Static files that get copied to build folder
11+
public: path.resolve(__dirname, "../src/img"),
12+
};

config/webpack.common.js

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
2+
const CopyWebpackPlugin = require("copy-webpack-plugin");
3+
const PrettierPlugin = require("prettier-webpack-plugin");
4+
const ESLintPlugin = require("eslint-webpack-plugin");
5+
const webpack = require("webpack");
6+
const paths = require("./paths");
7+
8+
module.exports = {
9+
// Where webpack looks to start building the bundle
10+
entry: [paths.src + "/js/index.js"],
11+
12+
// Where webpack outputs the assets and bundles
13+
output: {
14+
path: paths.build,
15+
filename: "[name].js?[hash]",
16+
},
17+
18+
// Customize the webpack build process
19+
plugins: [
20+
// Removes/cleans build folders and unused assets when rebuilding
21+
new CleanWebpackPlugin(),
22+
23+
// Copies files from target to destination folder
24+
new CopyWebpackPlugin({
25+
patterns: [
26+
{
27+
from: paths.public,
28+
to: "img",
29+
globOptions: {
30+
ignore: ["*.DS_Store"],
31+
},
32+
noErrorOnMissing: true,
33+
},
34+
],
35+
}),
36+
37+
// ESLint configuration
38+
new ESLintPlugin({
39+
files: [".", "config"],
40+
formatter: "table",
41+
}),
42+
43+
// Prettier configuration
44+
new PrettierPlugin(),
45+
46+
// Prettier configuration
47+
new webpack.ProvidePlugin({
48+
$: "jquery",
49+
jQuery: "jquery",
50+
}),
51+
],
52+
53+
// Determine how modules within the project are treated
54+
module: {
55+
rules: [
56+
// JavaScript: Use Babel to transpile JavaScript files
57+
{ test: /\.js$/, use: ["babel-loader"] },
58+
59+
// Images: Copy image files to build folder
60+
{ test: /\.(?:ico|gif|png|jpg|jpeg)$/i, type: "asset/resource" },
61+
62+
// Fonts and SVGs: Inline files
63+
{ test: /\.(woff(2)?|eot|ttf|otf|svg|)$/, type: "asset/inline" },
64+
],
65+
},
66+
};

config/webpack.dev.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const webpack = require("webpack");
2+
const { merge } = require("webpack-merge");
3+
const common = require("./webpack.common.js");
4+
const paths = require("./paths");
5+
6+
module.exports = merge(common, {
7+
// Set the mode to development or production
8+
mode: "development",
9+
10+
// Control how source maps are generated
11+
devtool: "inline-source-map",
12+
13+
// Spin up a server for quick development
14+
devServer: {
15+
historyApiFallback: true,
16+
contentBase: paths.build,
17+
open: true,
18+
compress: true,
19+
hot: true,
20+
port: 8080,
21+
},
22+
23+
module: {
24+
rules: [
25+
// Styles: Inject CSS into the head with source maps
26+
{
27+
test: /\.(scss|css)$/,
28+
use: [
29+
"style-loader",
30+
{
31+
loader: "css-loader",
32+
options: { sourceMap: true, importLoaders: 1, modules: true },
33+
},
34+
{ loader: "postcss-loader", options: { sourceMap: true } },
35+
{ loader: "sass-loader", options: { sourceMap: true } },
36+
],
37+
},
38+
],
39+
},
40+
41+
plugins: [
42+
// Only update what has changed on hot reload
43+
new webpack.HotModuleReplacementPlugin(),
44+
],
45+
});

0 commit comments

Comments
 (0)