Skip to content

Commit 9a12f0e

Browse files
committed
Initial setup
0 parents  commit 9a12f0e

Some content is hidden

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

63 files changed

+6891
-0
lines changed

.gitattributes

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Document global line endings settings
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
* text eol=lf
4+
5+
6+
# Denote all files that are truly binary and should not be modified.
7+
*.ai binary
8+
*.jpg binary
9+
*.otf binary
10+
*.png binary
11+
*.eot binary
12+
*.ttf binary
13+
*.whl binary
14+
*.woff binary
15+
*.woff2 binary

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*build/
2+
*.DS_Store
3+
*.sass-cache
4+
*.map
5+
node_modules
6+
npm-debug.log
7+
yarn-error.log
8+
package-lock.json
9+
pytorch_sphinx_theme/static/fonts/Lato/
10+
__pycache__

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.4.0

Gruntfile.js

+170
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
module.exports = function(grunt) {
2+
3+
// load all grunt tasks
4+
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
5+
6+
grunt.initConfig({
7+
// Read package.json
8+
pkg: grunt.file.readJSON("package.json"),
9+
10+
open : {
11+
dev: {
12+
path: 'http://localhost:1919'
13+
}
14+
},
15+
16+
connect: {
17+
server: {
18+
options: {
19+
port: 1919,
20+
base: 'docs/build',
21+
livereload: true
22+
}
23+
}
24+
},
25+
copy: {
26+
fonts: {
27+
files: [
28+
{
29+
expand: true,
30+
flatten: true,
31+
src: ['fonts/Lato/*'],
32+
dest: 'pytorch_sphinx_theme/static/fonts/Lato',
33+
filter: 'isFile'
34+
}
35+
]
36+
}
37+
},
38+
39+
sass: {
40+
dev: {
41+
options: {
42+
style: 'expanded'
43+
},
44+
files: [{
45+
expand: true,
46+
cwd: 'scss',
47+
src: ['*.scss'],
48+
dest: 'pytorch_sphinx_theme/static/css',
49+
ext: '.css'
50+
}]
51+
},
52+
build: {
53+
options: {
54+
style: 'compressed',
55+
sourcemap: 'none'
56+
},
57+
files: [{
58+
expand: true,
59+
cwd: 'scss',
60+
src: ['*.scss'],
61+
dest: 'pytorch_sphinx_theme/static/css',
62+
ext: '.css'
63+
}]
64+
}
65+
},
66+
67+
browserify: {
68+
dev: {
69+
options: {
70+
external: ['jquery'],
71+
alias: {
72+
'pytorch-sphinx-theme': './js/theme.js'
73+
}
74+
},
75+
src: ['js/*.js'],
76+
dest: 'pytorch_sphinx_theme/static/js/theme.js'
77+
},
78+
build: {
79+
options: {
80+
external: ['jquery'],
81+
alias: {
82+
'pytorch-sphinx-theme': './js/theme.js'
83+
}
84+
},
85+
src: ['js/*.js'],
86+
dest: 'pytorch_sphinx_theme/static/js/theme.js'
87+
}
88+
},
89+
uglify: {
90+
dist: {
91+
options: {
92+
sourceMap: false,
93+
mangle: {
94+
reserved: ['jQuery'] // Leave 'jQuery' identifier unchanged
95+
},
96+
ie8: true // compliance with IE 6-8 quirks
97+
},
98+
files: [{
99+
expand: true,
100+
src: ['pytorch_sphinx_theme/static/js/*.js', '!pytorch_sphinx_theme/static/js/*.min.js'],
101+
dest: 'pytorch_sphinx_theme/static/js/',
102+
rename: function (dst, src) {
103+
// Use unminified file name for minified file
104+
return src;
105+
}
106+
}]
107+
}
108+
},
109+
usebanner: {
110+
dist: {
111+
options: {
112+
position: 'top',
113+
banner: '/* <%= pkg.name %> version <%= pkg.version %> | MIT license */\n' +
114+
'/* Built <%= grunt.template.today("yyyymmdd HH:mm") %> */',
115+
linebreak: true
116+
},
117+
files: {
118+
src: [ 'pytorch_sphinx_theme/static/js/theme.js', 'pytorch_sphinx_theme/static/css/theme.css' ]
119+
}
120+
}
121+
},
122+
exec: {
123+
build_sphinx: {
124+
cmd: 'sphinx-build docs/ docs/build'
125+
}
126+
},
127+
clean: {
128+
build: ["docs/build"],
129+
fonts: ["pytorch_sphinx_theme/static/fonts"],
130+
css: ["pytorch_sphinx_theme/static/css"],
131+
js: ["pytorch_sphinx_theme/static/js/*", "!pytorch_sphinx_theme/static/js/modernizr.min.js"]
132+
},
133+
134+
watch: {
135+
/* Compile scss changes into theme directory */
136+
sass: {
137+
files: ['scss/*.scss'],
138+
tasks: ['sass:dev']
139+
},
140+
/* Changes in theme dir rebuild sphinx */
141+
sphinx: {
142+
files: ['pytorch_sphinx_theme/**/*', 'README.rst', 'docs/**/*.rst', 'docs/**/*.py'],
143+
tasks: ['clean:build','exec:build_sphinx']
144+
},
145+
/* JavaScript */
146+
browserify: {
147+
files: ['js/*.js'],
148+
tasks: ['browserify:dev']
149+
},
150+
/* live-reload the docs if sphinx re-builds */
151+
livereload: {
152+
files: ['docs/build/**/*'],
153+
options: { livereload: true }
154+
}
155+
}
156+
157+
});
158+
159+
grunt.loadNpmTasks('grunt-exec');
160+
grunt.loadNpmTasks('grunt-contrib-connect');
161+
grunt.loadNpmTasks('grunt-contrib-watch');
162+
grunt.loadNpmTasks('grunt-contrib-sass');
163+
grunt.loadNpmTasks('grunt-contrib-clean');
164+
grunt.loadNpmTasks('grunt-contrib-copy');
165+
grunt.loadNpmTasks('grunt-open');
166+
grunt.loadNpmTasks('grunt-browserify');
167+
168+
grunt.registerTask('default', ['clean','copy:fonts','sass:dev','browserify:dev','usebanner','exec:build_sphinx','connect','open','watch']);
169+
grunt.registerTask('build', ['clean','copy:fonts','sass:build','browserify:build','uglify','usebanner','exec:build_sphinx']);
170+
}

README.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
**************************
3+
PyTorch Sphinx Theme
4+
**************************
5+
6+
Sphinx theme for PyTorch based on the Read the Docs Sphinx Theme: https://sphinx-rtd-theme.readthedocs.io/en/latest.

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = PyTorchSphinxTheme
8+
SOURCEDIR = .
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/changelog.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
*********
3+
Changelog
4+
*********
5+
6+
v0.0.1

0 commit comments

Comments
 (0)