Skip to content

Commit

Permalink
Initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
brsoff committed Aug 13, 2018
0 parents commit 9a12f0e
Show file tree
Hide file tree
Showing 63 changed files with 6,891 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Document global line endings settings
# https://help.github.com/articles/dealing-with-line-endings/
* text eol=lf


# Denote all files that are truly binary and should not be modified.
*.ai binary
*.jpg binary
*.otf binary
*.png binary
*.eot binary
*.ttf binary
*.whl binary
*.woff binary
*.woff2 binary
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*build/
*.DS_Store
*.sass-cache
*.map
node_modules
npm-debug.log
yarn-error.log
package-lock.json
pytorch_sphinx_theme/static/fonts/Lato/
__pycache__
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.4.0
170 changes: 170 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
module.exports = function(grunt) {

// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

grunt.initConfig({
// Read package.json
pkg: grunt.file.readJSON("package.json"),

open : {
dev: {
path: 'http://localhost:1919'
}
},

connect: {
server: {
options: {
port: 1919,
base: 'docs/build',
livereload: true
}
}
},
copy: {
fonts: {
files: [
{
expand: true,
flatten: true,
src: ['fonts/Lato/*'],
dest: 'pytorch_sphinx_theme/static/fonts/Lato',
filter: 'isFile'
}
]
}
},

sass: {
dev: {
options: {
style: 'expanded'
},
files: [{
expand: true,
cwd: 'scss',
src: ['*.scss'],
dest: 'pytorch_sphinx_theme/static/css',
ext: '.css'
}]
},
build: {
options: {
style: 'compressed',
sourcemap: 'none'
},
files: [{
expand: true,
cwd: 'scss',
src: ['*.scss'],
dest: 'pytorch_sphinx_theme/static/css',
ext: '.css'
}]
}
},

browserify: {
dev: {
options: {
external: ['jquery'],
alias: {
'pytorch-sphinx-theme': './js/theme.js'
}
},
src: ['js/*.js'],
dest: 'pytorch_sphinx_theme/static/js/theme.js'
},
build: {
options: {
external: ['jquery'],
alias: {
'pytorch-sphinx-theme': './js/theme.js'
}
},
src: ['js/*.js'],
dest: 'pytorch_sphinx_theme/static/js/theme.js'
}
},
uglify: {
dist: {
options: {
sourceMap: false,
mangle: {
reserved: ['jQuery'] // Leave 'jQuery' identifier unchanged
},
ie8: true // compliance with IE 6-8 quirks
},
files: [{
expand: true,
src: ['pytorch_sphinx_theme/static/js/*.js', '!pytorch_sphinx_theme/static/js/*.min.js'],
dest: 'pytorch_sphinx_theme/static/js/',
rename: function (dst, src) {
// Use unminified file name for minified file
return src;
}
}]
}
},
usebanner: {
dist: {
options: {
position: 'top',
banner: '/* <%= pkg.name %> version <%= pkg.version %> | MIT license */\n' +
'/* Built <%= grunt.template.today("yyyymmdd HH:mm") %> */',
linebreak: true
},
files: {
src: [ 'pytorch_sphinx_theme/static/js/theme.js', 'pytorch_sphinx_theme/static/css/theme.css' ]
}
}
},
exec: {
build_sphinx: {
cmd: 'sphinx-build docs/ docs/build'
}
},
clean: {
build: ["docs/build"],
fonts: ["pytorch_sphinx_theme/static/fonts"],
css: ["pytorch_sphinx_theme/static/css"],
js: ["pytorch_sphinx_theme/static/js/*", "!pytorch_sphinx_theme/static/js/modernizr.min.js"]
},

watch: {
/* Compile scss changes into theme directory */
sass: {
files: ['scss/*.scss'],
tasks: ['sass:dev']
},
/* Changes in theme dir rebuild sphinx */
sphinx: {
files: ['pytorch_sphinx_theme/**/*', 'README.rst', 'docs/**/*.rst', 'docs/**/*.py'],
tasks: ['clean:build','exec:build_sphinx']
},
/* JavaScript */
browserify: {
files: ['js/*.js'],
tasks: ['browserify:dev']
},
/* live-reload the docs if sphinx re-builds */
livereload: {
files: ['docs/build/**/*'],
options: { livereload: true }
}
}

});

grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-browserify');

grunt.registerTask('default', ['clean','copy:fonts','sass:dev','browserify:dev','usebanner','exec:build_sphinx','connect','open','watch']);
grunt.registerTask('build', ['clean','copy:fonts','sass:build','browserify:build','uglify','usebanner','exec:build_sphinx']);
}
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

**************************
PyTorch Sphinx Theme
**************************

Sphinx theme for PyTorch based on the Read the Docs Sphinx Theme: https://sphinx-rtd-theme.readthedocs.io/en/latest.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = PyTorchSphinxTheme
SOURCEDIR = .
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

*********
Changelog
*********

v0.0.1
Loading

0 comments on commit 9a12f0e

Please sign in to comment.