Skip to content

Commit

Permalink
👌 IMPROVE: Making class names less generic #170
Browse files Browse the repository at this point in the history
  • Loading branch information
AakashGfude authored Nov 16, 2021
1 parent c688136 commit 9c1414f
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 43 deletions.
46 changes: 23 additions & 23 deletions quantecon_book_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,26 @@

<span id="top"></span>

<div class="wrapper">
<div class="qe-wrapper">

<div class="main">
<div class="qe-main">

<div class="page" id={{pagename}}>
<div class="qe-page" id={{pagename}}>

<div class="page__toc">
<div class="qe-page__toc">

<div class="inner">

{% set page_toc = generate_toc_html() %}

{%- if page_toc | length >= 1 %}
<div class="page__toc-header">
<div class="qe-page__toc-header">
On this page
</div>
{%- endif %}


<nav id="bd-toc-nav" class="page__toc-nav">
<nav id="bd-toc-nav" class="qe-page__toc-nav">
{{ page_toc }}
<p class="logo">
{% if logo %}
Expand All @@ -117,7 +117,7 @@

</nav>

<div class="page__toc-footer">
<div class="qe-page__toc-footer">
{# prev/next buttons #}
{% macro prev_next(prev, next, prev_title='', next_title='') %}
{%- if next %}
Expand All @@ -136,24 +136,24 @@

</div>

<div class="page__header">
<div class="qe-page__header">

<div class="page__header-copy">
<div class="qe-page__header-copy">

<p class="page__header-heading"><a href="{{ master_url }}">{{ docstitle | e }}</a></p>
<p class="qe-page__header-heading"><a href="{{ master_url }}">{{ docstitle | e }}</a></p>

<p class="page__header-subheading">{{ pagetitle | e }}</p>
<p class="qe-page__header-subheading">{{ pagetitle | e }}</p>

</div>

<p class="page__header-authors">{{ author }}</p>
<p class="qe-page__header-authors">{{ author }}</p>

</div> <!-- .page__header -->



{% block docs_main %}
<main class="page__content" role="main">
<main class="qe-page__content" role="main">
{% block docs_body %}
<div>
{% block body %} {% endblock %}
Expand All @@ -163,7 +163,7 @@
{% endblock %}


<footer class="page__footer">
<footer class="qe-page__footer">

<p><a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="https://licensebuttons.net/l/by-sa/4.0/80x15.png"></a></p>

Expand All @@ -176,35 +176,35 @@
{% block docs_sidebar %}

{% if theme_persistent_sidebar is defined and theme_persistent_sidebar is sameas true %}
<div class="sidebar bd-sidebar inactive persistent" id="site-navigation">
<div class="qe-sidebar bd-sidebar inactive persistent" id="site-navigation">
{%- else %}
<div class="sidebar bd-sidebar inactive" id="site-navigation">
<div class="qe-sidebar bd-sidebar inactive" id="site-navigation">
{%- endif %}

<div class="sidebar__header">
<div class="qe-sidebar__header">


Contents

</div>

<nav class="sidebar__nav" id="sidebar-nav" aria-label="Main navigation">
<nav class="qe-sidebar__nav" id="qe-sidebar-nav" aria-label="Main navigation">
{{ sbt_generate_nav_html(include_item_names=False, with_home_page=theme_home_page_in_toc) }}
</nav>

<div class="sidebar__footer">
<div class="qe-sidebar__footer">

</div>

</div> <!-- .sidebar -->
{% endblock %}
</div> <!-- .main -->

<div class="toolbar">
<div class="qe-toolbar">

<div class="toolbar__inner">
<div class="qe-toolbar__inner">

<ul class="toolbar__main">
<ul class="qe-toolbar__main">
<li data-tippy-content="Table of Contents" class="btn__sidebar"><i data-feather="menu"></i></li>
<li data-tippy-content="Home"><a href="{{ master_url }}"><i data-feather="home"></i></a></li>
<li class="btn__qelogo"><a href="{{theme_header_organisation_url}}" title="{{html_title}}"><span class="show-for-sr">{{ theme_header_organisation}}</span></a></li>
Expand All @@ -216,7 +216,7 @@
</li> -->
</ul>

<ul class="toolbar__links">
<ul class="qe-toolbar__links">
<li data-tippy-content="Fullscreen" class="btn__fullscreen"><i data-feather="maximize"></i></li>
<li data-tippy-content="Increase font size" class="btn__plus"><i data-feather="plus-circle"></i></li>
<li data-tippy-content="Decrease font size" class="btn__minus"><i data-feather="minus-circle"></i></li>
Expand Down

Large diffs are not rendered by default.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion quantecon_book_theme/theme.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Note: this should only be changed in src/jinja/theme.conf.j2
[theme]
inherit = pydata_sphinx_theme
stylesheet = quantecon-book-theme.857ff391aaabaeb8c161d2309c375fe6.css
stylesheet = quantecon-book-theme.1ef59f8f4e91ec8319176e8479c6af4e.css

[options]
single_page = False
Expand Down
4 changes: 2 additions & 2 deletions src/js/quantecon-book-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ document.addEventListener("DOMContentLoaded", function(){
var $window = $(window),
$head = $('head'),
$body = $('body'),
$sidebar = $('.sidebar'),
$sidebar = $('.qe-sidebar'),
$sidebarToggle = $('.btn__sidebar');

// Toolbar contrast toggle
Expand Down Expand Up @@ -225,7 +225,7 @@ document.addEventListener("DOMContentLoaded", function(){

/* Wrap container around all tables allowing hirizontal scroll */

const contentTables = document.querySelectorAll('.page__content table');
const contentTables = document.querySelectorAll('.qe-page__content table');
for (var i = 0; i < contentTables.length; i++) {
var wrapper = document.createElement('div');
wrapper.classList.add('table-container');
Expand Down
18 changes: 9 additions & 9 deletions src/scss/quantecon-book-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ body {
}
}

.toolbar,
.qe-toolbar,
.drawer,
.sidebar,
.qe-sidebar,
.drawer .inner {
background: #444;
}
Expand All @@ -151,7 +151,7 @@ body {
}
}

.page__content {
.qe-page__content {
.image-reference img {
filter: invert(100%) hue-rotate(-180deg) !important;
-ms-filter: invert(100%) !important;
Expand Down Expand Up @@ -286,14 +286,14 @@ tt {
overflow-wrap: break-word;
}

.wrapper {
.qe-wrapper {
margin: 0 0 0 0;
display: flex;
flex-direction: column-reverse;
//min-height: 100vh;
}

.main {
.qe-main {
position: relative;
display: flex;
flex-direction: row-reverse;
Expand All @@ -303,7 +303,7 @@ tt {
padding-top: 4rem;
}

.toolbar {
.qe-toolbar {
position: sticky;
top: 0;
width: 100%;
Expand Down Expand Up @@ -447,7 +447,7 @@ tt {
}
}

.page {
.qe-page {
max-width: 800px;
position: relative;
flex-grow: 1;
Expand Down Expand Up @@ -626,7 +626,7 @@ tt {
}
}

.sidebar {
.qe-sidebar {
//position: absolute;
top: 0px;
left: 0px;
Expand Down Expand Up @@ -753,7 +753,7 @@ tt {


/* Custom content styles */
.page__content {
.qe-page__content {

.table-container {
overflow-x: scroll;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_build_book(file_regression, sphinx_build):
assert "Index with code in title" in str(index_html)
# Check navbar numbering
sidebar_ntbk = sphinx_build.get("section1", "ntbk.html").find(
"nav", id="sidebar-nav"
"nav", id="qe-sidebar-nav"
)
# Pages and sub-pages should be numbered
assert "1. Page 1" in str(sidebar_ntbk)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_build/test_build_book.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="sidebar bd-sidebar inactive" id="site-navigation">
<div class="sidebar__header">
<div class="qe-sidebar bd-sidebar inactive" id="site-navigation">
<div class="qe-sidebar__header">
Contents
</div>
<nav aria-label="Main navigation" class="sidebar__nav" id="sidebar-nav">
<nav aria-label="Main navigation" class="qe-sidebar__nav" id="qe-sidebar-nav">
<p class="caption">
<span class="caption-text">
My caption
Expand Down Expand Up @@ -65,6 +65,6 @@
</li>
</ul>
</nav>
<div class="sidebar__footer">
<div class="qe-sidebar__footer">
</div>
</div>

1 comment on commit 9c1414f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.