Permalink
Browse files

Update setup.py to work, rework file structure

- rebase sass files to ./sass
- Place all theme files in ./sphinx_rtd_theme
- Grunt now uses `default` and `build` tasks
- `build` will minify css for committing / dist
- Added Gemfile and requirements.txt for python/ruby requirements
- Cleaned up Gruntfile, copying no longer needed.
- moved compass config to compass.rb

Squashed commits:

- Move out sphinx_rtd_theme to root folder
- Manifest unneeded
- Move out sass to root dir
- Remove dist from git
- Reconfigure paths
- Add requirements for sphinx
- Add gemfile for compass
- Udpate components path
- Move to static/css
- Add line for rbenv
- Require livereload, don't need copy
- Comment static path, update theme path for demo conf.py
- Add css files
- Correct name of .ruby-version...
- Update path to theme.css
- Remove unprefixed badge_only.css
- Update location of theme.js
- Update paths in Gruntfile, tasks
- re-add __init__.py, bump version
- Update setup.py to pick up version easily
- Move config.rb to compass.rb
- Correct compass import paths
- Add debug / production environment
- Commit with production built css
- Add theme.conf, get requires from requirements.txt
- rename tasks, use sphinx-build, add comments
- Fix font path
- Update css files
  • Loading branch information...
Ivoz committed Nov 4, 2013
1 parent 5df0757 commit b99bad47b54e6a90acb86a4776d2d9e99acea722
Showing with 82 additions and 971 deletions.
  1. +1 −0 .gitignore
  2. +4 −0 Gemfile
  3. +16 −0 Gemfile.lock
  4. +22 −42 Gruntfile.js
  5. +0 −12 MANIFEST.in
  6. +14 −13 src/sphinx_rtd_theme/sass/config.rb → compass.rb
  7. +2 −2 demo_docs/source/conf.py
  8. +2 −3 package.json
  9. +1 −0 requirements.txt
  10. 0 {src/sphinx_rtd_theme → }/sass/_theme_badge.sass
  11. 0 {src/sphinx_rtd_theme → }/sass/_theme_badge_fa.sass
  12. 0 {src/sphinx_rtd_theme → }/sass/_theme_breadcrumbs.sass
  13. 0 {src/sphinx_rtd_theme → }/sass/_theme_layout.sass
  14. 0 {src/sphinx_rtd_theme → }/sass/_theme_rst.sass
  15. +2 −0 sass/_theme_variables.sass
  16. 0 {src/sphinx_rtd_theme → }/sass/badge_only.sass
  17. 0 {src/sphinx_rtd_theme → }/sass/theme.sass
  18. +13 −22 setup.py
  19. +1 −1 sphinx_rtd_theme/__init__.py
  20. +1 −1 sphinx_rtd_theme/layout.html
  21. +0 −1 sphinx_rtd_theme/static/badge_only.css
  22. +1 −0 sphinx_rtd_theme/static/css/badge_only.css
  23. +1 −0 sphinx_rtd_theme/static/css/theme.css
  24. BIN sphinx_rtd_theme/static/font/fontawesome_webfont.eot
  25. 0 sphinx_rtd_theme/static/font/fontawesome_webfont.svg
  26. BIN sphinx_rtd_theme/static/font/fontawesome_webfont.ttf
  27. BIN sphinx_rtd_theme/static/font/fontawesome_webfont.woff
  28. 0 {src/sphinx_rtd_theme/static → sphinx_rtd_theme/static/js}/theme.js
  29. +1 −1 sphinx_rtd_theme/theme.conf
  30. +0 −11 src/sphinx_rtd_theme/breadcrumbs.html
  31. +0 −19 src/sphinx_rtd_theme/footer.html
  32. +0 −137 src/sphinx_rtd_theme/layout.html
  33. +0 −205 src/sphinx_rtd_theme/layout_old.html
  34. 0 src/sphinx_rtd_theme/sass/_theme_variables.sass
  35. +0 −50 src/sphinx_rtd_theme/search.html
  36. +0 −5 src/sphinx_rtd_theme/searchbox.html
  37. +0 −1 src/sphinx_rtd_theme/static/badge_only.css
  38. BIN src/sphinx_rtd_theme/static/font/fontawesome_webfont.eot
  39. +0 −399 src/sphinx_rtd_theme/static/font/fontawesome_webfont.svg
  40. BIN src/sphinx_rtd_theme/static/font/fontawesome_webfont.ttf
  41. BIN src/sphinx_rtd_theme/static/font/fontawesome_webfont.woff
  42. +0 −1 src/sphinx_rtd_theme/static/theme.css
  43. +0 −7 src/sphinx_rtd_theme/theme.conf
  44. +0 −38 src/sphinx_rtd_theme/versions.html
View
@@ -6,6 +6,7 @@
.coverage
*.DS_Store
*.sass-cache
+.ruby-version
bower_components/
node_modules/
npm-debug.log
View
@@ -0,0 +1,4 @@
+# A sample Gemfile
+source "https://rubygems.org"
+
+gem "compass"
View
@@ -0,0 +1,16 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ chunky_png (1.2.9)
+ compass (0.12.2)
+ chunky_png (~> 1.2)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
+ fssm (0.2.10)
+ sass (3.2.12)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ compass
View
@@ -14,88 +14,68 @@ module.exports = function(grunt) {
server: {
options: {
port: 1919,
- base: 'demo_docs/build/html'
+ base: 'demo_docs/build',
+ livereload: true
}
}
},
compass: {
- src: {
+ prod: {
options: {
- config: 'src/sphinx_rtd_theme/sass/config.rb',
- basePath: 'src/sphinx_rtd_theme/sass',
+ config: 'compass.rb',
+ environment: 'production',
force: true
}
},
- dist: {
+ debug: {
options: {
- config: 'src/sphinx_rtd_theme/sass/config.rb',
- basePath: 'src/sphinx_rtd_theme/sass',
- outputStyle: 'compressed',
+ config: 'compass.rb',
force: true
}
}
},
- // I use this to build the sphinx_rtd_theme available at https://github.com/snide/sphinx_rtd_theme
- copy: {
- dist : {
- files: [
- {
- expand: true,
- cwd: 'src/sphinx_rtd_theme',
- src: ['**', '!**/sass/**'],
- dest: 'sphinx_rtd_theme'
- }
- ]
- }
- },
-
exec: {
bower_update: {
cmd: 'bower update'
},
build_sphinx: {
- cmd: 'cd demo_docs && make html'
+ cmd: 'sphinx-build demo_docs/source demo_docs/build'
}
},
clean: {
- src: ['demo_docs/build'],
- // Delete everything but __init__.py
- dist: ['sphinx_rtd_theme/*', 'sphinx_rtd_theme/static/**','sphinx_rtd_theme/sass/**', '!sphinx_rtd_theme/__init__.py']
+ build: ["demo_docs/build"]
},
watch: {
+ /* Compile sass changes into theme directory */
sass: {
- files: ['src/sphinx_rtd_theme/*.sass', 'bower_components/**/*.sass'],
- tasks: ['compass:src']
+ files: ['sass/*.sass', 'bower_components/**/*.sass'],
+ tasks: ['compass:debug']
},
- /* watch and see if our javascript files change, or new packages are installed */
- sphinx_update: {
- files: ['src/sphinx_rtd_theme/static/*.css', 'src/sphinx_rtd_theme/*.js', 'demo_docs/source/*.rst', 'src/sphinx_rtd_theme/*.html'],
- tasks: ['clean:src','exec:build_sphinx']
+ /* Changes in theme dir rebuild sphinx */
+ sphinx: {
+ files: ['sphinx_rtd_theme/**/*'],
+ tasks: ['exec:build_sphinx']
},
- /* watch our files for change, reload */
+ /* live-reload the demo_docs if sphinx re-builds */
livereload: {
- files: ['demo_docs/build/html/**/*.html', 'demo_docs/build/html/_static/*.css', 'demo_docs/build/html/_static/*.js'],
- options: {
- livereload: true
- }
- },
+ files: ['demo_docs/build/**/*'],
+ options: { livereload: true }
+ }
}
});
- grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-open');
- grunt.registerTask('default', ['exec:bower_update','clean:src','exec:build_sphinx','connect','open','watch']);
- grunt.registerTask('dist', ['clean:dist','compass:dist','copy:dist']);
-
+ grunt.registerTask('default', ['exec:bower_update','clean:build','compass:debug','exec:build_sphinx','connect','open','watch']);
+ grunt.registerTask('build', ['exec:bower_update','clean:build','compass:prod','exec:build_sphinx']);
}
View
@@ -1,12 +0,0 @@
-# Top level.
-include *.rst
-
-exclude *.png
-
-# Non-python files.
-recursive-include sphinx_rtd_theme *
-recursive-exclude sass *
-
-# Extraneous files.
-global-exclude .DS_Store
-global-exclude *.pyc
@@ -4,35 +4,36 @@
#path = File.dirname(__FILE__)
-http_path = "/"
-css_dir = "../static"
-sass_dir = ""
-images_dir = "../static"
-fonts_dir = "../static/font"
-javascripts_dir = "../static"
-line_comments = false
-preferred_syntax = :sass
+project_path = "sphinx_rtd_theme/static"
+http_path = "static"
+sass_path = "sass"
+
+css_dir = "css"
+javascripts_dir = "js"
+images_dir = "img"
+fonts_dir = "font"
# To enable relative paths to assets via compass helper functions. Uncomment:
#relative_assets = true
-add_import_path "../../../bower_components/bourbon/app/assets/stylesheets"
-add_import_path "../../../bower_components/neat/app/assets/stylesheets"
-add_import_path "../../../bower_components/wyrm/sass"
+add_import_path "../../bower_components/bourbon/app/assets/stylesheets"
+add_import_path "../../bower_components/neat/app/assets/stylesheets"
+add_import_path "../../bower_components/wyrm/sass"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
+output_style = (environment == :production) ? :compressed : :expanded
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
+line_comments = (environment == :production) ? false : true
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
-
-
+preferred_syntax = :sass
View
@@ -99,7 +99,7 @@
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ["../../src/", ]
+html_theme_path = ["../.."]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
@@ -120,7 +120,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+#html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
View
@@ -6,12 +6,11 @@
"grunt": "~0.4.1",
"grunt-contrib-compass": "~0.2.0",
"grunt-contrib-watch": "~0.4.3",
- "grunt-exec": "~0.4.2",
"grunt-contrib-connect": "0.5.0",
- "grunt-contrib-copy": "0.4.1",
"grunt-contrib-clean": "0.5.0",
+ "connect-livereload": "~0.3.0",
+ "grunt-exec": "~0.4.2",
"grunt-open": "0.2.2",
"matchdep": "~0.1.2"
}
}
-
View
@@ -0,0 +1 @@
+sphinx>=1.1
File renamed without changes.
@@ -0,0 +1,2 @@
+$font-awesome-dir: "../font/"
+$static-img: "../img/"
File renamed without changes.
File renamed without changes.
View
@@ -4,39 +4,30 @@
.. _github: https://www.github.com/snide/sphinx_rtd_theme
"""
-from setuptools import setup, find_packages
-
-version = {}
-with open("sphinx_rtd_theme/__init__.py") as fp:
- exec(fp.read(), version)
-
-try:
- from pip.req import parse_requirements
-except ImportError:
- def requirements(f):
- reqs = open(f, 'r').read().splitlines()
- reqs = [r for r in reqs if not r.strip().startswith('#')]
- return reqs
-else:
- def requirements(f):
- install_reqs = parse_requirements(f)
- reqs = [str(r.req) for r in install_reqs]
- return reqs
+from setuptools import setup
+from sphinx_rtd_theme import __version__
setup(
name='sphinx_rtd_theme',
- version=version['__version__'],
+ version=__version__,
url='https://github.com/snide/sphinx_rtd_theme/',
license='MIT',
author='Dave Snider',
author_email='dave.snider@gmail.com',
description='ReadTheDocs.org theme for Sphinx, 2013 version.',
long_description=open('README.rst').read(),
zip_safe=False,
- packages=find_packages(),
- package_data = { "sphinx_rtd_theme": ['*.*', 'static/*.*', 'static/*/*.*'] },
- install_requires=['sphinx>=1.1'],
+ packages=['sphinx_rtd_theme'],
+ package_data={'sphinx_rtd_theme': [
+ 'theme.conf',
+ '*.html',
+ 'static/css/*.css',
+ 'static/js/*.js',
+ 'static/font/*.*'
+ ]},
+ include_package_data=True,
+ install_requires=open('requirements.txt').read().splitlines(),
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: BSD License',
@@ -5,7 +5,7 @@
"""
import os
-VERSION = (0, 1, 1)
+VERSION = (0, 1, 3)
__version__ = ".".join(str(v) for v in VERSION)
__version_full__ = __version__
@@ -50,7 +50,7 @@
{# RTD hosts these file themselves, so just load on non RTD builds #}
{% if not READTHEDOCS %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
- <script type="text/javascript" src="_static/theme.js"></script>
+ <script type="text/javascript" src="_static/js/theme.js"></script>
{% endif %}
{% for cssfile in css_files %}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
No changes.
No changes.
No changes.
No changes.
@@ -1,6 +1,6 @@
[theme]
inherit = basic
-stylesheet = theme.css
+stylesheet = css/theme.css
[options]
typekit_id = hiw1hhg
@@ -1,11 +0,0 @@
-<ul class="wy-breadcrumbs">
- <li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
- <li><a href="">{{ title }}</a></li>
- {% if display_github %}
- <li class="wy-breadcrumbs-aside">
- <a href="https://github.com/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}.rst" class="icon icon-github"> Edit on GitHub</a>
- </li>
- {% endif %}
-</ul>
-<hr/>
-
@@ -1,19 +0,0 @@
-<footer>
- <hr/>
-
- <p>
- {%- if show_copyright %}
- {%- if hasdoc('copyright') %}
- {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
- {%- else %}
- {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
- {%- endif %}
- {%- endif %}
-
- {%- if last_updated %}
- {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
- {%- endif %}
- </p>
-
- {% trans %}<a href="https://www.github.com/snide/sphinx_rtd_theme">Sphinx theme</a> provided by <a href="http://www.readthedocs.org">Read the Docs</a>{% endtrans %}
-</footer>
Oops, something went wrong.

0 comments on commit b99bad4

Please sign in to comment.