Skip to content

Commit

Permalink
Run grunt (#522)
Browse files Browse the repository at this point in the history
* Run Grunt

Also fix some errors from recent docs rename

* Upgade grunt contrib sass to 1.0.0

Fixes the following warning:

```
DEPRECATION WARNING: Passing --sourcemap without a value is deprecated.
Sourcemaps are now generated by default, so this flag has no effect.
```

* Revert change to gitignore

* Watch readme file
  • Loading branch information
Blendify committed Dec 28, 2017
1 parent 9f84648 commit 19b22eb
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 46 deletions.
12 changes: 6 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(grunt) {
server: {
options: {
port: 1919,
base: 'demo_docs/build',
base: 'docs/build',
livereload: true
}
}
Expand Down Expand Up @@ -117,11 +117,11 @@ module.exports = function(grunt) {
cmd: 'bower update'
},
build_sphinx: {
cmd: 'sphinx-build demo_docs/source demo_docs/build'
cmd: 'sphinx-build docs/ docs/build'
}
},
clean: {
build: ["demo_docs/build"],
build: ["docs/build"],
fonts: ["sphinx_rtd_theme/static/fonts"],
css: ["sphinx_rtd_theme/static/css"],
js: ["sphinx_rtd_theme/static/js/*", "!sphinx_rtd_theme/static/js/modernizr.min.js"]
Expand All @@ -135,17 +135,17 @@ module.exports = function(grunt) {
},
/* Changes in theme dir rebuild sphinx */
sphinx: {
files: ['sphinx_rtd_theme/**/*', 'demo_docs/**/*.rst', 'demo_docs/**/*.py'],
files: ['sphinx_rtd_theme/**/*', 'README.rst', 'docs/**/*.rst', 'docs/**/*.py'],
tasks: ['clean:build','exec:build_sphinx']
},
/* JavaScript */
browserify: {
files: ['js/*.js'],
tasks: ['browserify:dev']
},
/* live-reload the demo_docs if sphinx re-builds */
/* live-reload the docs if sphinx re-builds */
livereload: {
files: ['demo_docs/build/**/*'],
files: ['docs/build/**/*'],
options: { livereload: true }
}
}
Expand Down
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
],
"ignore": [
"docs",
"demo_docs",
".gitignore",
".DS_Store",
".sass-cache*",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sphinx_rtd_theme",
"version": "0.0.11",
"version": "0.2.5b2",
"private": true,
"dependencies": {},
"devDependencies": {
Expand All @@ -11,7 +11,7 @@
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-sass": "~0.8.0",
"grunt-contrib-sass": "~1.0.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-exec": "~1.0.1",
"grunt-open": "0.2.3",
Expand Down
1 change: 0 additions & 1 deletion sphinx_rtd_theme/static/css/badge_only.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions sphinx_rtd_theme/static/css/badge_only.css.map

This file was deleted.

5 changes: 2 additions & 3 deletions sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions sphinx_rtd_theme/static/css/theme.css.map

This file was deleted.

55 changes: 36 additions & 19 deletions sphinx_rtd_theme/static/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ function ThemeNav () {
isRunning: false
};

nav.enable = function () {
nav.enable = function (withStickyNav) {
var self = this;

if (!self.isRunning) {
self.isRunning = true;
jQuery(function ($) {
self.init($);
if (self.isRunning) {
// Only allow enabling nav logic once
return;
}

self.reset();
self.win.on('hashchange', self.reset);
self.isRunning = true;
jQuery(function ($) {
self.init($);

self.reset();
self.win.on('hashchange', self.reset);

if (withStickyNav) {
// Set scroll monitor
self.win.on('scroll', function () {
if (!self.linkScroll) {
Expand All @@ -36,18 +41,23 @@ function ThemeNav () {
}
}
});
}

// Set resize monitor
self.win.on('resize', function () {
if (!self.winResize) {
self.winResize = true;
requestAnimationFrame(function() { self.onResize(); });
}
});

self.onResize();
// Set resize monitor
self.win.on('resize', function () {
if (!self.winResize) {
self.winResize = true;
requestAnimationFrame(function() { self.onResize(); });
}
});
};

self.onResize();
});

};

nav.enableSticky = function() {
this.enable(true);
};

nav.init = function ($) {
Expand Down Expand Up @@ -80,9 +90,16 @@ function ThemeNav () {
})

// Make tables responsive
$("table.docutils:not(.field-list)")
$("table.docutils:not(.field-list,.footnote,.citation)")
.wrap("<div class='wy-table-responsive'></div>");

// Add extra class to responsive tables that contain
// footnotes or citations so that we can target them for styling
$("table.docutils.footnote")
.wrap("<div class='wy-table-responsive footnote'></div>");
$("table.docutils.citation")
.wrap("<div class='wy-table-responsive citation'></div>");

// Add expand links to all parents of nested ul
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
var link = $(this);
Expand Down Expand Up @@ -170,7 +187,7 @@ function ThemeNav () {
module.exports.ThemeNav = ThemeNav();

if (typeof(window) != 'undefined') {
window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav };
window.SphinxRtdTheme = { Navigation: module.exports.ThemeNav };
}


Expand Down

0 comments on commit 19b22eb

Please sign in to comment.