Skip to content

Commit

Permalink
Merge pull request #50 from nabobalis/master
Browse files Browse the repository at this point in the history
Various Fixes
  • Loading branch information
nabobalis authored Apr 17, 2018
2 parents b7f9a8f + 956a0c2 commit a185972
Show file tree
Hide file tree
Showing 13 changed files with 203 additions and 180 deletions.
38 changes: 28 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,55 @@ pip-run: &pip-install
version: 2
jobs:
html-docs:
environment:
- MAIN_CMD: "pip install -e ."
website:
docker:
- image: circleci/python:3.6
steps:
- checkout
- run: *apt-install
- run: *pip-install
- run: pip install -U setuptools
- run: $MAIN_CMD $SETUP_CMD
- run: pip install -e .
- run: git clone https://github.com/sunpy/sunpy.github.io.git
- run: pip install -r $HOME/project/sunpy.github.io/requirements.txt
- run: pip install -U sphinx
- run: pip install -r sunpy.github.io/requirements.txt
- run: make -C $HOME/project/sunpy.github.io html
- run: rm $HOME/project/sunpy.github.io/_build/html/CNAME

- store_artifacts:
path: $HOME/project/sunpy.github.io/_build/html
path: sunpy.github.io/_build/html

- run:
name: "Built documentation is available at:"
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/project/sunpy.github.io/_build/html/index.html"; echo $DOCS_URL

docs:
docker:
- image: circleci/python:3.6
steps:
- checkout
- run: *apt-install
- run: *pip-install
- run: pip install -U setuptools
- run: pip install -e .
- run: git clone --depth 1 https://github.com/sunpy/sunpy.git
- run: cd sunpy && pip install -e .
- run: pip install -r sunpy/requirements/docs.txt
- run: cd sunpy && python setup.py build_docs -w

- store_artifacts:
path: sunpy/docs/_build/html

- run:
name: "Built documentation is available at:"
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/project/sunpy/docs/_build/html/index.html"; echo $DOCS_URL

workflows:
version: 2

test-documentation:
html-builds:
jobs:
- html-docs
- website
- docs

notify:
webhooks:
Expand Down
7 changes: 4 additions & 3 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "stylelint-config-recommended",
"rules": {"no-descending-specificity": null,
"selector-pseudo-element-no-unknown": null
}
"rules": {
"no-descending-specificity": null,
"selector-pseudo-element-no-unknown": null
}
}
23 changes: 1 addition & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,7 @@ language: python
python:
- 3.6

before_install:
script:
- npm install -g stylelint
- npm install stylelint-config-recommended
- stylelint ./sunpy_sphinx_theme/sunpy/static/style.css

install:
- pip install -e .
- git clone https://github.com/sunpy/sunpy.github.io.git
- cd sunpy.github.io
- pip install -r requirements.txt
- pip install -U sphinx

script:
- make html
- rm ./_build/html/CNAME

deploy:
edge:
branch: v1.8.47
provider: pages
skip_cleanup: true
github_token: $mytoken
local_dir: sunpy.github.io/_build/html/
on:
branch: master
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2017, The SunPy Developers
Copyright (c) 2018, The SunPy Developers
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from setuptools import setup, find_packages
from setuptools import setup

setup(
name="sunpy-sphinx-theme",
version="1.0.7",
version="1.1.0",
use_2to3=False,
description="The sphinx theme for the SunPy website and documentation.",
long_description="",
long_description="The sphinx theme for the SunPy website and documentation.",
author="The SunPy Developers",
install_requires=[
"setuptools",
Expand Down
7 changes: 4 additions & 3 deletions sunpy_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
""" SunPy Sphinx Theme """
"""SunPy Sphinx Theme"""
import os

__version__ = "1.0.7"

import sphinx_bootstrap_theme

__version__ = "1.1.0"


def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dirname(__file__))
Expand Down
25 changes: 19 additions & 6 deletions sunpy_sphinx_theme/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,33 @@
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from . import get_html_theme_path
import socket

from sunpy_sphinx_theme import get_html_theme_path

html_theme_path = get_html_theme_path()
html_theme = "sunpy"
html_favicon = os.path.join(html_theme_path[0], html_theme, "static", "img", "favicon-32.ico")
html_static_path = [os.path.join(html_theme_path[0], html_theme, "static")]
html_favicon = os.path.join(html_static_path[0], "img", "favicon-32.ico")

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if on_rtd:
sunpy_website_url_base = 'http://sunpy.org'
else:
sunpy_website_url_base = socket.gethostname()


def page_url(page):
sunpy_website_url_base = "http://sunpy.org/"
return urljoin(sunpy_website_url_base, page)


html_sidebars = {'**': ['docsidebar.html']}
html_theme_options = {
'navbar_links': [
'navbar_links': [ # About and documentation is hard coded due to drop down
("Blog", page_url("blog.html"), 1),
("Support Us", page_url("contribute.html"), 1),
("Get Help", page_url("help.html"), 1),
("SunPy Project", page_url("team.html"), 1),
]
("SunPy Project", page_url("team.html"), 1)
]
}
11 changes: 5 additions & 6 deletions sunpy_sphinx_theme/sunpy/layout.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{# Import the theme's layout. #}
{# Import the theme's layout #}
{% extends "bootstrap/layout.html" %}
{# Custom CSS overrides #}
{% set css_files = css_files + ['_static/style.css'] %}
{# Extra JS files #}
{% set script_files = script_files + ['_static/copybutton.js'] + ['_static/version.js']%}
{# Add some extra stuff before and use existing with 'super()' call. #}

{# Custom CSS overrides #}
{% set css_files = css_files + ['_static/sunpy_style.css'] %}
{# Add some extra stuff before and use existing with 'super()' call #}
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and sidebars %}

{%- set bs_content_width2 = render_sidebar and "8" or "12"%}

{% macro seo_title() -%}
Expand Down
97 changes: 48 additions & 49 deletions sunpy_sphinx_theme/sunpy/navbar.html
Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@
<div id="navbar" class="{{ theme_navbar_class }} navbar-default {% if theme_navbar_fixed_top|tobool -%} navbar-fixed-top{%- endif -%}">
<div id="navbar" class="{{ theme_navbar_class }} navbar-default {% if theme_navbar_fixed_top|tobool %} navbar-fixed-top {% endif %}">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ theme_logo_url }}">SunPy</a>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
{% if theme_navbar_links %}
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav navbar-left">
<li class="dropdown">
<a role="button" id="dLabelGlobalToc" data-toggle="dropdown" data-target="#" href="#">About<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a href="http://sunpy.org/about.html">About</a>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ theme_logo_url }}">SunPy</a>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
{% if theme_navbar_links %}
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav navbar-left">
<li class="dropdown">
<a role="button" id="dLabelGlobalToc" data-toggle="dropdown" data-target="#" href="#" }}>About<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a href="{{ pathto("about") }}">About</a>
</li>
<li class="dropdown-submenu">
<a href="{{ pathto("about") }}#acknowledging-sunpy">Acknowledge SunPy</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/en/stable/coc.html">Code of Conduct</a>
</li>
</ul>
</li>
<li class="dropdown">
<a role="button" id="dLabelGlobalToc" data-toggle="dropdown" data-target="" href="">Documentation<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/en/stable/">SunPy</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/projects/ndcube">ndcube</a>
</li>
<li class="dropdown-submenu">
<a href="http://sunpy.org/about.html#acknowledging-sunpy">Acknowledge</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/en/stable/coc.html">Code of Conduct</a>
</li>
</ul>
</li>
<li><a href="http://sunpy.org/blog.html">Blog</a></li>
<li class="dropdown">
<a role="button" id="dLabelGlobalToc" data-toggle="dropdown" data-target="#" href="#">Documentation<b class="caret"></b></a>
<ul class="dropdown-menu">
<a href="http://docs.sunpy.org/projects/drms">drms</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/en/stable/">SunPy</a>
<a href="http://docs.sunpy.org/projects/radiospectra/en/latest/index.html">radiospectra</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/projects/irispy/en/latest/">IRISPy</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/projects/solarbextrapolation/en/latest/">SolarBExtrapolation</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/projects/sunkit-sst/en/latest/index.html">sunkit-sst</a>
</li>
<li class="dropdown-submenu">
<a href="http://docs.sunpy.org/projects/radiospectra/en/latest/index.html">radiospectra</a>
</li>
</li>
</ul>
</li>
{%- for link in theme_navbar_links %}
<li><a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a></li>
{%- endfor %}
{% endif %}
</ul>
</div>
</li>
{% for link in theme_navbar_links %}
<li><a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a></li>
{% endfor %}
{% endif %}
</ul>
</div>
</ul>
</div>
</div>
</div>
</div>
Loading

0 comments on commit a185972

Please sign in to comment.