Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mentors4EDU committed Feb 7, 2021
2 parents 71caf19 + 533fb78 commit 5015b96
Show file tree
Hide file tree
Showing 179 changed files with 24,589 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/pytorch_sphinx_theme/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:7.10

working_directory: ~/repo

steps:
- add_ssh_keys:
fingerprints:
- "e0:f1:7b:8c:b1:4c:49:6f:b9:bd:af:84:6d:dd:93:cb"
- checkout

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: cp .circleci/mock.env.json .env.json
- run: sudo npm install -g grunt sass
- run: grunt build
- run: git config credential.helper 'cache --timeout=120'
- run: git config user.email "ericnakagawa@gmail.com"
- run: git config user.name "CircleCI Bot"
- run: git add .
- run: git commit -m "Deploying theme build via CircleCI"
- run: git push -q git@github.com:pytorch/pytorch_sphinx_theme.git master

workflows:
version: 2
commit-and-build:
jobs:
- build
4 changes: 4 additions & 0 deletions docs/pytorch_sphinx_theme/.circleci/mock.env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"TUTORIALS_DIR": "../tutorials",
"DOCS_DIR": "../pytorch/docs/source"
}
15 changes: 15 additions & 0 deletions docs/pytorch_sphinx_theme/.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
1 change: 1 addition & 0 deletions docs/pytorch_sphinx_theme/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.4.0
227 changes: 227 additions & 0 deletions docs/pytorch_sphinx_theme/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

var envJSON = grunt.file.readJSON(".env.json");
var PROJECT_DIR = "docs/";

switch (grunt.option('project')) {
case "docs":
PROJECT_DIR = envJSON.DOCS_DIR;
break;
case "tutorials":
PROJECT_DIR = envJSON.TUTORIALS_DIR;
break;
}

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/FreightSans/*'],
dest: 'pytorch_sphinx_theme/static/fonts/FreightSans',
filter: 'isFile'
},

{
expand: true,
flatten: true,
src: ['fonts/IBMPlexMono/*'],
dest: 'pytorch_sphinx_theme/static/fonts/IBMPlexMono',
filter: 'isFile'
}
]
},

images: {
files: [
{
expand: true,
flatten: true,
src: ['images/*'],
dest: 'pytorch_sphinx_theme/static/images',
filter: 'isFile'
}
]
},

vendor: {
files: [
{
expand: true,
cwd: 'node_modules/bootstrap/scss/',
src: "**/*",
dest: 'scss/vendor/bootstrap',
filter: 'isFile'
},

{
expand: true,
flatten: true,
src: [
'node_modules/popper.js/dist/umd/popper.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/anchor-js/anchor.min.js'
],
dest: 'pytorch_sphinx_theme/static/js/vendor',
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'
},
files: [{
expand: true,
cwd: 'scss',
src: ['*.scss'],
dest: 'pytorch_sphinx_theme/static/css',
ext: '.css'
}]
}
},

postcss: {
options: {
map: true,
processors: [
require("autoprefixer")({browsers: ["last 2 versions"]}),
]
},

dist: {
files: {
"pytorch_sphinx_theme/static/css/theme.css": "pytorch_sphinx_theme/static/css/theme.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;
}
}]
}
},
exec: {
build_sphinx: {
cmd: 'sphinx-build ' + PROJECT_DIR + ' docs/build'
}
},
clean: {
build: ["docs/build"],
fonts: ["pytorch_sphinx_theme/static/fonts"],
images: ["pytorch_sphinx_theme/static/images"],
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', 'postcss:dist']
},
/* 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', 'copy:images', 'copy:vendor', 'sass:dev', 'postcss:dist', 'browserify:dev','exec:build_sphinx','connect','open','watch']);
grunt.registerTask('build', ['clean','copy:fonts', 'copy:images', 'copy:vendor', 'sass:build', 'postcss:dist', 'browserify:build', 'uglify']);
}
20 changes: 20 additions & 0 deletions docs/pytorch_sphinx_theme/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2013-2019 PyTorch Team, Dave Snider, Read the Docs, Inc. & contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit 5015b96

Please sign in to comment.