Skip to content
Permalink
Browse files

Merge branch 'master' into agj/setup-webpack-commands

  • Loading branch information...
agjohnson committed Oct 3, 2019
2 parents 9fee2a2 + feb0beb commit 6947fea9c04c4f73db8b18cf6de7c0da9d966da1
Showing with 145 additions and 61 deletions.
  1. +0 −1 .gitignore
  2. +20 −0 bin/preinstall.js
  3. +67 −0 docs/demo/api.rst
  4. +2 −1 package.json
  5. +0 −4 sphinx_rtd_theme/versions.html
  6. +36 −32 webpack.common.js
  7. +13 −16 webpack.dev.js
  8. +7 −7 webpack.prod.js
@@ -9,7 +9,6 @@
*.map
.ropeproject/
.ruby-version
bin/
dist/
bower_components/
include/
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const package = require('../package.json');

// Sorry everyone, this is the closest we can get to commenting on package.json
// dependencies :(
if (package.devDependencies['bourbon-neat'] !== '~1.9') {
// Wyrm is not compatible with Neat 2.0+, and Neat 1.9 at least pins a
// node-sass version that doesn't require Python 2. The changes to Wyrm to
// support Neat 2.0+ are all fairly minor changes, but it deeply affects the
// grid system and might be more of a liability than an old release of Neat.
// See: https://github.com/readthedocs/sphinx_rtd_theme/pull/771
console.error(
'bourbon-neat 1.9 is required, Wyrm is not compatible with Neat 2.0+.'
);
console.error(
'The expected selector for the bourbon-neat dependency in package.json is "~1.9".'
);
process.exit(1);
}
@@ -28,6 +28,73 @@ C++ API

Some cpp class

.. cpp:member:: float Sphinx::version

The description of Sphinx::version.

.. cpp:var:: int version

The description of version.

.. cpp:type:: std::vector<int> List

The description of List type.

.. cpp:enum:: MyEnum

An unscoped enum.

.. cpp:enumerator:: A

.. cpp:enum-class:: MyScopedEnum

A scoped enum.

.. cpp:enumerator:: B

.. cpp:enum-struct:: protected MyScopedVisibilityEnum : std::underlying_type<MySpecificEnum>::type

A scoped enum with non-default visibility, and with a specified underlying type.

.. cpp:enumerator:: B


JavaScript API
==============

.. Copied from sphinx-doc/sphinx/tests/roots
.. js:module:: module_a.submodule

* Link to :js:class:`ModTopLevel`

.. js:class:: ModTopLevel

* Link to :js:meth:`mod_child_1`
* Link to :js:meth:`ModTopLevel.mod_child_1`

.. js:method:: ModTopLevel.mod_child_1

* Link to :js:meth:`mod_child_2`

.. js:method:: ModTopLevel.mod_child_2

* Link to :js:meth:`module_a.submodule.ModTopLevel.mod_child_1`

.. js:module:: module_b.submodule

* Link to :js:class:`ModTopLevel`

.. js:class:: ModNested

.. js:method:: nested_child_1

* Link to :js:meth:`nested_child_2`

.. js:method:: nested_child_2

* Link to :js:meth:`nested_child_1`


Generated Index
===============
@@ -5,7 +5,8 @@
"private": true,
"scripts": {
"dev": "webpack-dev-server --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js"
"build": "webpack --config webpack.prod.js",
"preinstall": "bin/preinstall.js"
},
"dependencies": {},
"devDependencies": {
@@ -29,10 +29,6 @@
<a href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}">{{ _('Builds') }}</a>
</dd>
</dl>
<hr/>
{% trans %}Free document hosting provided by{% endtrans %} <a href="http://www.readthedocs.org">Read the Docs</a>.

</div>
</div>
{% endif %}

@@ -1,56 +1,60 @@
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
entry: './src/index.js',
entry: "./src/index.js",
output: {
filename: 'js/theme.js',
path: path.resolve(__dirname, 'sphinx_rtd_theme/static')
filename: "js/theme.js",
path: path.resolve(__dirname, "sphinx_rtd_theme/static")
},
module: {
rules: [
{
test: require.resolve('./src/theme.js'),
use: 'imports-loader?this=>window'
test: require.resolve("./src/theme.js"),
use: "imports-loader?this=>window"
},
{
test: /\.sass$/,
use: [{
loader: MiniCssExtractPlugin.loader
},
{
loader: "css-loader"
},
{
loader: "sass-loader?indentedSyntax",
options: {
includePaths: [
'node_modules/bourbon/app/assets/stylesheets',
'node_modules/bourbon-neat/app/assets/stylesheets',
'node_modules/font-awesome/scss',
'node_modules/wyrm/sass'
]
use: [
{
loader: MiniCssExtractPlugin.loader
},
{
loader: "css-loader"
},
{
loader: "sass-loader?indentedSyntax",
options: {
includePaths: [
"node_modules/bourbon/app/assets/stylesheets",
"node_modules/bourbon-neat/app/assets/stylesheets",
"node_modules/font-awesome/scss",
"node_modules/wyrm/sass"
]
}
}
}]
]
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]',
outputPath: 'fonts/',
publicPath: '../fonts/',
use: [
{
loader: "file-loader",
options: {
name: "[name].[ext]?[hash]",
outputPath: "fonts/",
publicPath: "../fonts/"
}
}
}]
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: 'css/theme.css'
filename: "css/theme.css"
})
],
]
};
@@ -1,34 +1,31 @@
const path = require('path');
const merge = require('webpack-merge');
const exec = require('child_process').exec;
const WatchPlugin = require('webpack-watch-files-plugin').default;
const ShellPlugin = require('webpack-shell-plugin');
const common = require('./webpack.common.js');
const path = require("path");
const merge = require("webpack-merge");
const exec = require("child_process").exec;
const WatchPlugin = require("webpack-watch-files-plugin").default;
const ShellPlugin = require("webpack-shell-plugin");
const common = require("./webpack.common.js");

module.exports = merge(common, {
mode: 'development',
mode: "development",
watch: true,
devServer: {
contentBase: path.join(__dirname, 'docs/build/html'),
contentBase: path.join(__dirname, "docs/build/html"),
watchContentBase: true,
compress: false,
port: 1919,
hot: false,
liveReload: true,
publicPath: '/_static/'
publicPath: "/_static/"
},
plugins: [
new WatchPlugin({
files: [
'./docs/**/*.rst',
'./docs/**/*.py',
]
files: ["./docs/**/*.rst", "./docs/**/*.py"]
}),
new ShellPlugin({
onBuildEnd: ['make -C docs clean html'],
onBuildEnd: ["make -C docs clean html"],
// dev=false here to force every build to trigger make, the default is
// first build only.
dev: false,
}),
dev: false
})
]
});
@@ -1,11 +1,11 @@
const merge = require('webpack-merge');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const common = require('./webpack.common.js');
const merge = require("webpack-merge");
const OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const common = require("./webpack.common.js");

module.exports = merge(common, {
mode: 'production',
mode: "production",
optimization: {
minimizer: [new TerserPlugin(), new OptimizeCssAssetsPlugin({})],
},
minimizer: [new TerserPlugin(), new OptimizeCssAssetsPlugin({})]
}
});

0 comments on commit 6947fea

Please sign in to comment.
You can’t perform that action at this time.