'
24 | )
25 | assert search in content
26 | else:
27 | search = (
28 | '
'
29 | )
30 | assert search in content, ('Missing search with builder {0}'
31 | .format(app.builder.name))
32 |
--------------------------------------------------------------------------------
/docs_italia_theme/layouts/lang_switch.html:
--------------------------------------------------------------------------------
1 | {% if READTHEDOCS and translations %}
2 |
23 | {% endif %}
24 |
--------------------------------------------------------------------------------
/docs_italia_theme/forum_italia.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 |
3 | # define custom node
4 | from docutils import nodes
5 |
6 | # define custom directive
7 | from docutils.parsers.rst import Directive
8 | from docutils.parsers.rst import directives
9 |
10 | class ForumItaliaCommentsNode(nodes.Structural, nodes.Element):
11 | @staticmethod
12 | def visit(self, node):
13 | pass
14 | @staticmethod
15 | def depart(self, node):
16 | pass
17 |
18 | class ForumItaliaCommentsDirective(Directive):
19 | # parameters
20 | required_arguments = 0
21 | optional_arguments = 0
22 | option_spec = {
23 | 'topic_id': directives.unchanged_required,
24 | 'scope': directives.unchanged
25 | }
26 | final_argument_whitespace = True
27 |
28 | def run(self):
29 | options = self.options
30 | scope = options['scope'] if 'scope' in options else 'section'
31 |
32 | node = ForumItaliaCommentsNode()
33 |
34 | topic_markup = ' '.join([
35 | ''
39 | ])
40 |
41 | node += nodes.raw(text=topic_markup, format='html')
42 | node['data-topic-id'] = options['topic_id']
43 |
44 | return [ node ]
45 |
--------------------------------------------------------------------------------
/sass/layout/_note.scss:
--------------------------------------------------------------------------------
1 | #doc-content {
2 | .footnote-reference {
3 | color: $dark-blue-border;
4 | border: 1px $dark-blue-border solid;
5 | border-radius: 3px;
6 | padding: 0 0.4rem;
7 | line-height: 1.4;
8 | }
9 |
10 | .note-action {
11 | margin-top: 0.5rem;
12 | }
13 |
14 | .note-close-btn,
15 | .note-back-btn {
16 | background: none;
17 | border: 0;
18 | display: inline-block;
19 | color: $blue;
20 | font-size: 1.2em;
21 | cursor: pointer;
22 | }
23 |
24 | .note-back-btn {
25 | position: relative;
26 |
27 | &::before {
28 | content: '';
29 | top: 0;
30 | bottom: 0;
31 | width: 1px;
32 | position: absolute;
33 | background-color: $blue;
34 | left: 0;
35 | }
36 |
37 | &:hover {
38 | text-decoration: underline;
39 | }
40 | }
41 |
42 | .docutils.footnote {
43 | color: $black;
44 | font-size: 0.8rem;
45 | display: none;
46 | margin-bottom: 2rem;
47 |
48 | td {
49 | width: 100%;
50 | float: left;
51 | }
52 |
53 | .fn-backref {
54 | color: $dark-blue-border;
55 | border: 1px $dark-blue-border solid;
56 | border-radius: 3px;
57 | padding: 0.2rem;
58 | line-height: 1;
59 | display: inline-block;
60 | margin-bottom: 0.5rem;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/docs_italia_theme/layouts/templates/tooltip.html:
--------------------------------------------------------------------------------
1 | {% raw %}
2 |
11 |
12 |
21 |
22 |
31 | {% endraw %}
32 |
--------------------------------------------------------------------------------
/docs_italia_theme/search.html:
--------------------------------------------------------------------------------
1 | {%- extends "layouts/default.html" %}
2 |
3 | {% set title = t.search %}
4 |
5 | {% set script_files = script_files + ['_static/searchtools.js'] %}
6 | {% block scripts %}
7 | {{ super() }}
8 |
11 | {# this is used when loading the search index using $.ajax fails,
12 | such as on Chrome for documents on localhost #}
13 |
14 | {% endblock %}
15 |
16 | {% block body %}
17 |
18 |
19 |
20 | {% trans %}Please activate JavaScript to enable the search
21 | functionality.{% endtrans %}
22 |
23 |
24 |
25 |
26 | {% if search_performed %}
27 |
{{ t.search_results }}
28 | {% if not search_results %}
29 |
{{ t.search_no_results }}
30 | {% endif %}
31 | {% endif %}
32 |
33 | {% if search_results %}
34 |
35 | {% for href, caption, context in search_results %}
36 |
37 | {{ caption }}
38 | {{ context|e }}
39 |
40 | {% endfor %}
41 |
42 | {% endif %}
43 |
44 | {% endblock %}
45 |
--------------------------------------------------------------------------------
/docs_italia_theme/layouts/network.html:
--------------------------------------------------------------------------------
1 |
2 | {{ t.navigation_network_menu_label }}
3 |
4 |
10 |
11 | {% set items = site.data.network_links %}
12 |
13 | {% for item in items %}
14 |
15 | {% set _url = item.url %}
16 | {% set item_name = item.title %}
17 | {{ item.li_markup_pre }}
18 |
19 | {{ _(t[item_name] | default(item_name)) }}
20 |
21 | {{ item.li_markup_post }}
22 |
23 | {% endfor %}
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sass/layout/_general.scss:
--------------------------------------------------------------------------------
1 | body {
2 | color: $grey-mid;
3 | background-color: $dark-blue;
4 |
5 | &.no-scroll {
6 | overflow-y: hidden;
7 | }
8 | }
9 |
10 | p {
11 | font-family: $stack-font;
12 | }
13 |
14 | h1,
15 | h2,
16 | h3,
17 | h4,
18 | h5 {
19 | color: $black;
20 | margin-bottom: 2rem;
21 | }
22 |
23 | img {
24 | max-width: 100%;
25 | height: auto;
26 | }
27 |
28 | .container-fluid--desktop {
29 | max-width: 1450px;
30 | }
31 |
32 | // Show loader when Body has .loading class
33 | @keyframes pulsate {
34 | 0% {
35 | transform: scale(0.1);
36 | opacity: 0;
37 | }
38 |
39 | 50% {
40 | opacity: 1;
41 | }
42 |
43 | 100% {
44 | transform: scale(1.2);
45 | opacity: 0;
46 | }
47 | }
48 |
49 | .loading {
50 | overflow: hidden;
51 |
52 | &::after {
53 | position: absolute;
54 | background: $blue;
55 | height: 100%;
56 | width: 100%;
57 | z-index: 10;
58 | content: '';
59 | left: 0;
60 | top: 0;
61 | }
62 |
63 | &::before {
64 | border: 5px solid white;
65 | margin: -15px 0 0 -15px;
66 | border-radius: 30px;
67 | position: absolute;
68 | content: '';
69 | z-index: 11;
70 | height: 30px;
71 | left: 50%;
72 | top: 50%;
73 | opacity: 0;
74 | width: 30px;
75 | animation: pulsate 1s ease-out;
76 | animation-iteration-count: infinite;
77 | }
78 |
79 | &.no-bg {
80 | &::after {
81 | background: none;
82 | position: relative;
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018, the respective contributors, as shown by the AUTHORS file.
2 |
3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4 |
5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6 |
7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8 |
9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10 |
11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12 |
--------------------------------------------------------------------------------
/sass/base/_normalize.scss:
--------------------------------------------------------------------------------
1 | .small {
2 | font-size: 14px;
3 | }
4 |
5 | .navbar-dark--text-white {
6 | color: white;
7 | }
8 |
9 | .navbar-dark .navbar-nav .nav-link,
10 | .navbar-dark .lang-selector .nav-link {
11 | color: white !important;
12 | }
13 |
14 | .navbar.bg-white {
15 | background-color: $white;
16 | }
17 |
18 | .navbar.primary-bg-a7 {
19 | background-color: #0059b3;
20 | }
21 |
22 | .dropdown-menu.dropdown-menu-right::before {
23 | @include media-breakpoint-up(lg) {
24 | right: 24px;
25 | left: auto;
26 | }
27 | }
28 |
29 | @include media-breakpoint-up(lg) {
30 | .navbar .dropdown-menu.dropdown-menu-right {
31 | left: auto;
32 | right: 0;
33 | }
34 | }
35 |
36 | .dropdown-menu-right {
37 | @include media-breakpoint-down(md) {
38 | right: auto;
39 | left: auto;
40 | }
41 | }
42 |
43 | .dropdown.show .dropdown-menu[x-placement='bottom-start'],
44 | .btn-group.show .dropdown-menu[x-placement='bottom-start'] {
45 | animation: dropdownFadeIn forwards 0.3s;
46 | }
47 |
48 | .dropdown.show .dropdown-menu[x-placement='top-start'],
49 | .btn-group.show .dropdown-menu[x-placement='top-start'] {
50 | animation: dropdownFadeInTop forwards 0.3s;
51 | }
52 |
53 | .dropdown-menu[x-placement^="top"],
54 | .dropdown-menu[x-placement^="right"],
55 | .dropdown-menu[x-placement^="bottom"],
56 | .dropdown-menu[x-placement^="left"] {
57 | right: auto;
58 | bottom: auto;
59 | }
60 |
61 | .dropdown-menu::before {
62 | z-index: -1;
63 | }
64 |
65 | .injected {
66 | display: none;
67 | }
68 |
--------------------------------------------------------------------------------
/docs_italia_theme/layouts/templates/section_navigation.html:
--------------------------------------------------------------------------------
1 | {% raw %}
2 |
29 | {% endraw %}
30 |
--------------------------------------------------------------------------------
/js/getTpl.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is the modified library version of the github user romuleald.
3 | * https://github.com/romuleald/getTpl/blob/master/gettpl.js
4 | *
5 | * Modified because of we use ES5 and `let` keyword isn't.
6 | */
7 | var getTpl = (function () {
8 | "use strict";
9 | var cache = {};
10 | var getCache = function (templateId) {
11 | return cache[templateId];
12 | };
13 | var setCache = function (templateId, html) {
14 | cache[templateId] = html;
15 | };
16 |
17 | /**
18 | *
19 | * @param {Object} data formed object that match in template {foo:'bar'} will replace {{foo}} with bar
20 | * @param {String} templateId HTML attribute id
21 | * @returns {string} HTMl template transformed
22 | */
23 | return function gettpl(data, templateId, debug) {
24 | var templateHTML = getCache(templateId);
25 | if (getCache(templateId)) {
26 | templateHTML = getCache(templateId);
27 | }
28 | else {
29 | var tpl = document.getElementById(templateId);
30 | templateHTML = tpl.innerHTML;
31 | setCache(templateId, templateHTML);
32 | }
33 | return templateHTML.replace(/{{ ?([^}]*) ?}}/g, function (search, result) {
34 | result = result.trim();
35 | if (result.indexOf('.') > 0) {
36 | var obj_prop = result.split('.');
37 | debug && console.info(result, data[obj_prop[0]][obj_prop[1]]);
38 | return data[obj_prop[0]][obj_prop[1]];
39 | }
40 | debug && console.info(result, data[result]);
41 | return data[result] || '';
42 | });
43 | };
44 |
45 | })();
46 | module.exports = getTpl;
47 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "docs-italia-theme",
3 | "description": "Docs Italia theme è il tema Sphinx di riferimento per Docs Italia",
4 | "repository": "https://github.com/italia/docs-italia-theme",
5 | "version": "1.2.0-beta",
6 | "license": "MIT",
7 | "engines": {
8 | "node": ">=6"
9 | },
10 | "author": "Presidenza del Consiglio dei Ministri",
11 | "scripts": {
12 | "start": "grunt",
13 | "build": "grunt build",
14 | "release": "grunt release"
15 | },
16 | "dependencies": {
17 | "grunt-cli": "^1.3.2"
18 | },
19 | "devDependencies": {
20 | "autoprefixer": "^8.5.0",
21 | "bootstrap-italia": "^0.10.3",
22 | "browserify": "^14.5.0",
23 | "connect-livereload": "^0.6.0",
24 | "cssnano": "^4.1.10",
25 | "discourse-client": "^0.1.2",
26 | "grunt": "^1.0.4",
27 | "grunt-browserify": "^5.2.0",
28 | "grunt-cache-bust": "1.4.1",
29 | "grunt-contrib-clean": "^1.1.0",
30 | "grunt-contrib-concat": "^1.0.1",
31 | "grunt-contrib-connect": "^1.0.2",
32 | "grunt-contrib-copy": "^1.0.0",
33 | "grunt-contrib-sass": "^1.0.0",
34 | "grunt-contrib-uglify": "^3.4.0",
35 | "grunt-contrib-watch": "^1.1.0",
36 | "grunt-exec": "^3.0.0",
37 | "grunt-modernizr": "^2.0.1",
38 | "grunt-postcss": "^0.9.0",
39 | "grunt-stylelint": "^0.10.0",
40 | "husky": "^1.2.0",
41 | "matchdep": "^2.0.0",
42 | "modernizr": "^3.7.1",
43 | "pixrem": "^4.0.1",
44 | "stickybits": "^3.5.8",
45 | "stylelint": "^9.10.1",
46 | "stylelint-config-standard": "^18.2.0"
47 | },
48 | "husky": {
49 | "hooks": {
50 | "pre-commit": "grunt build"
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/js/index.js:
--------------------------------------------------------------------------------
1 | global.$ = global.jQuery = require('jquery');
2 | global.Popper = require('popper.js');
3 | require('modernizr');
4 | require('bootstrap-italia');
5 |
6 |
7 | var themeMarkupModifier = require('./markup_modifier.js');
8 | var themeToolTip = require('./tooltip.js');
9 | var themeChapterNav = require('./section_navigation.js');
10 | var themeNote = require('./note.js');
11 | var themeGlossary = require('./get_glossary.js');
12 | var themeAdmonitionToggle = require('./admonition_toggle.js');
13 | var themeActiveVersions = require('./active_versions.js');
14 | var themeCopyToClipboard = require('./copy_to_clipboard.js');
15 | var themeSidebarNav = require('./sidebar_nav.js');
16 | var themeGlossaryPage = require('./glossary_page.js');
17 | var themeScrollProgressBar = require('./scroll_progressbar.js');
18 | var themeStickyHeader = require('./sticky_header.js');
19 | var themeOffcanvasFeature = require('./offcanvas_feature.js');
20 | var themeSearchboxCollapse = require('./searchbox_collapse.js');
21 | var forumItalia = require('./forum_italia.js');
22 |
23 | // Init all
24 | $(document).ready(function() {
25 |
26 | themeGlossary.init(glossaryReady.bind(this));
27 | themeMarkupModifier.init();
28 | themeChapterNav.init();
29 | themeNote.init();
30 | themeAdmonitionToggle.init();
31 | themeSidebarNav.init();
32 | themeGlossaryPage.init();
33 | themeCopyToClipboard.init();
34 | themeActiveVersions.init();
35 | themeScrollProgressBar.init();
36 | themeStickyHeader.init();
37 | themeOffcanvasFeature.init();
38 | themeSearchboxCollapse.init();
39 | forumItalia.init();
40 |
41 | // Load tooltips when the ajax request for glossary terms is completed.
42 | function glossaryReady() {
43 | themeToolTip.init();
44 | }
45 | });
46 |
--------------------------------------------------------------------------------
/sass/layout/_glossary.scss:
--------------------------------------------------------------------------------
1 | #glossary-page {
2 | > .chapter-header {
3 | display: none;
4 | }
5 |
6 | .chapter-header {
7 | padding-top: 2rem;
8 | padding-bottom: 2rem;
9 | padding-left: 0.5rem;
10 | overflow: hidden;
11 |
12 | h2 {
13 | font-size: 8rem;
14 | font-family: $stack-font;
15 | line-height: 1;
16 | }
17 | }
18 |
19 | .glossary-page__btn {
20 | border: 0;
21 | background: none;
22 | cursor: pointer;
23 | color: $blue;
24 | display: block;
25 | width: 100%;
26 | text-align: left;
27 | text-transform: uppercase;
28 | transition: color 0.3s;
29 |
30 | .docs-icon-minus,
31 | .docs-icon-plus {
32 | color: $blue;
33 | }
34 |
35 | .docs-icon-minus {
36 | display: inline-block;
37 | }
38 |
39 | .docs-icon-plus {
40 | display: none;
41 | }
42 |
43 | &.collapsed {
44 | color: $grey-mid;
45 |
46 | .docs-icon-minus {
47 | display: none;
48 | }
49 |
50 | .docs-icon-plus {
51 | display: inline-block;
52 | }
53 | }
54 | }
55 |
56 | .term-content {
57 | padding-left: 2.3rem;
58 | font-family: $titillium-font;
59 |
60 | p {
61 | font-family: $titillium-font;
62 | }
63 |
64 | &:last-of-type {
65 | &.show {
66 | border-bottom: 2px $grey-light-02 solid;
67 | }
68 | }
69 | }
70 |
71 | dt {
72 | &:last-of-type {
73 | .glossary-page__btn {
74 | &.collapsed {
75 | border-bottom: 2px $grey-light-02 solid;
76 | }
77 | }
78 | }
79 | }
80 | }
81 |
82 | .glossary-page__copy-link-wrap {
83 | color: $blue;
84 | }
85 |
86 | .glossary-page__copy-link {
87 | background: none;
88 | border: none;
89 | color: $blue;
90 | cursor: pointer;
91 | }
92 |
--------------------------------------------------------------------------------
/sass/layout/_footer.scss:
--------------------------------------------------------------------------------
1 | .footer {
2 | * {
3 | font-family: $titillium-font;
4 | }
5 |
6 | a:hover {
7 | text-decoration: none;
8 | }
9 |
10 | .in-collaboration {
11 | font-size: 0.8em;
12 | }
13 |
14 | .team-logo--icon {
15 | width: 54px;
16 | }
17 |
18 | .team-logo--text {
19 | font-size: 1rem;
20 | line-height: 18px;
21 | max-width: 160px;
22 | text-transform: uppercase;
23 | }
24 |
25 | .agid-logo--icon {
26 | width: 8em;
27 |
28 | @include media-breakpoint-up(md) {
29 | width: 10em;
30 | }
31 | }
32 |
33 | .agid-logo--separator {
34 | border-left-width: 2px !important;
35 | height: 30px;
36 |
37 | @include media-breakpoint-up(md) {
38 | height: 40px;
39 | }
40 | }
41 |
42 | .agid-logo--text {
43 | width: 7rem;
44 | line-height: 1.2;
45 | font-size: 1em;
46 | display: inline-block;
47 | vertical-align: middle;
48 |
49 | @include media-breakpoint-up(md) {
50 | font-size: 1.1em;
51 | width: 8rem;
52 | }
53 | }
54 |
55 | .small-prints {
56 | color: #00fff8;
57 | font-weight: 600;
58 | }
59 |
60 | .social {
61 | font-size: 1em;
62 | color: #fff;
63 |
64 | .icon {
65 | color: #00264d;
66 | background-color: #fff;
67 | // padding: 0.2em 0.4em;
68 | padding: 0.3em 0.3em;
69 | border-radius: 100%;
70 | // font-size: initial;
71 | font-size: 22px;
72 | }
73 | }
74 |
75 | .colophon {
76 | border-top: 1px solid rgba(255, 255, 255, 0.1);
77 | margin-top: 1.5em;
78 |
79 | @include media-breakpoint-up(lg) {
80 | margin-top: 2em;
81 | }
82 | }
83 | }
84 |
85 | .footer-menu__link {
86 | &:hover {
87 | color: $white;
88 | }
89 | }
90 |
91 | .t_translate-wrap {
92 | display: none;
93 | }
94 |
--------------------------------------------------------------------------------
/sass/layout/_side-menu.scss:
--------------------------------------------------------------------------------
1 | .sidebar-nav {
2 | @media (max-width: 767.98px) {
3 | padding-top: 5.5rem;
4 | }
5 |
6 | a {
7 | text-decoration: none;
8 | color: $grey-mid;
9 | font-size: 0.9rem;
10 | display: block;
11 | line-height: 1.6;
12 | margin-bottom: 1rem;
13 | margin-top: 1rem;
14 |
15 | &.current_item {
16 | position: relative;
17 | z-index: 1;
18 | margin-bottom: 1rem;
19 | margin-top: 1rem;
20 | transition: margin-bottom 0.3s, margin-top 0.3s;
21 |
22 | &::before {
23 | content: '';
24 | position: absolute;
25 | top: -0.5rem;
26 | bottom: -0.5rem;
27 | left: -0.5rem;
28 | right: -0.5rem;
29 | background-color: $sky-blue;
30 | z-index: -1;
31 | }
32 | }
33 |
34 | &:hover,
35 | &:focus {
36 | text-decoration: underline;
37 | }
38 | }
39 |
40 | > .sidebar-list--wrapper {
41 | padding: 1rem;
42 |
43 | @include media-breakpoint-up(md) {
44 | padding: 0;
45 | }
46 |
47 | > ul {
48 | > li {
49 | padding: 0.1rem 3rem 0.1rem 1rem;
50 |
51 | > a {
52 | font-weight: 700;
53 | }
54 | }
55 | }
56 |
57 | ul {
58 | list-style-type: none;
59 | padding-left: 0;
60 | margin-bottom: 0;
61 |
62 | &.current {
63 | > li.current {
64 | background-color: $lighteen-blue;
65 |
66 | a {
67 | color: $mid-dark-blue;
68 | }
69 | }
70 | }
71 |
72 | ul {
73 | padding-left: 1rem;
74 | }
75 | }
76 |
77 | &.figures-index--menu,
78 | &.table-index--menu,
79 | &.glossary-mobile--menu {
80 | padding-top: 1rem;
81 |
82 | > ul {
83 | > li {
84 | padding-bottom: 0;
85 | padding-top: 0.5rem;
86 | }
87 | }
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/tests/util.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 |
3 | import os
4 | import tempfile
5 | import shutil
6 | from contextlib import contextmanager
7 |
8 | import pytest
9 | from sphinx.application import Sphinx
10 |
11 | try:
12 | from StringIO import StringIO
13 | except ImportError:
14 | from io import StringIO
15 |
16 |
17 | @contextmanager
18 | def build(root, builder='html', **kwargs):
19 | tmpdir = tempfile.mkdtemp()
20 |
21 | srcdir = os.path.join(os.path.dirname(__file__), 'roots', root)
22 | destdir = os.path.join(tmpdir, builder)
23 | doctreedir = os.path.join(tmpdir, 'doctree/')
24 |
25 | status = StringIO()
26 | warning = StringIO()
27 |
28 | kwargs.update({
29 | 'status': status,
30 | 'warning': warning,
31 | })
32 |
33 | confoverrides = kwargs.pop('confoverrides', {})
34 | confoverrides['html_theme'] = 'docs_italia_theme'
35 | extensions = confoverrides.get('extensions', [])
36 | extensions.append('readthedocs_ext.readthedocs')
37 | confoverrides['extensions'] = extensions
38 | kwargs['confoverrides'] = confoverrides
39 |
40 | try:
41 | app = Sphinx(srcdir, srcdir, destdir, doctreedir, builder, **kwargs)
42 | app.builder.build_all()
43 | yield (app, status.getvalue(), warning.getvalue())
44 | except Exception as e:
45 | print('# root:', root)
46 | print('# builder:', builder)
47 | print('# source:', srcdir)
48 | print('# destination:', destdir)
49 | print('# status:', '\n' + status.getvalue())
50 | print('# warning:', '\n' + warning.getvalue())
51 | raise
52 | finally:
53 | shutil.rmtree(tmpdir)
54 |
55 |
56 | def build_all(root, **kwargs):
57 | for builder in ['html', 'singlehtml', 'readthedocs', 'readthedocsdirhtml',
58 | 'readthedocssinglehtml', 'readthedocssinglehtmllocalmedia']:
59 | with build(root, builder, **kwargs) as ret:
60 | yield ret
61 |
--------------------------------------------------------------------------------
/js/note.js:
--------------------------------------------------------------------------------
1 | // Notes
2 | module.exports = themeNote = (function ($) {
3 | var that;
4 |
5 | return {
6 |
7 | $: {
8 | $noteBtn: $('.footnote-reference'),
9 | $note: $('.docutils.footnote'),
10 | $noteBackRef: $('.docutils.footnote').find('.fn-backref'),
11 | $noteStandardBtn: {},
12 | $body: $('body'),
13 | $window: $(window),
14 | dataObj: {}
15 | },
16 |
17 | init: function() {
18 | that = this.$;
19 |
20 | that.$noteStandardBtn = that.$noteBtn.filter(function() {
21 | return ($(this).closest('table').length == 0)
22 | });
23 | that.$note.css('display', 'block').slideUp(0);
24 | that.$noteStandardBtn.on('click', themeNote.shownoteStandardBtn);
25 | that.$noteBackRef.on('click', themeNote.backToBtn);
26 | $('.note-close-btn').on('click', themeNote.closeNote);
27 | $('.note-back-btn').on('click', themeNote.backToBtn);
28 | },
29 |
30 | shownoteStandardBtn: function(event) {
31 | event.preventDefault();
32 |
33 | var $btn = $(event.target),
34 | noteid = $btn.attr('href').replace('#', ''),
35 | $note = $('#' + noteid);
36 |
37 | if($note.hasClass('active')) {
38 | $("html, body").animate({ scrollTop: $note.offset().top - 150 }, 300);
39 | } else {
40 | $note.addClass('active').slideDown();
41 | $("html, body").animate({ scrollTop: $note.offset().top - 150 }, 300);
42 | }
43 | },
44 |
45 | closeNote: function(event) {
46 | var $target = $(event.target),
47 | $note = $target.closest('.docutils.footnote.active');
48 |
49 | that.$note.removeClass('active').slideUp();
50 | },
51 |
52 | backToBtn: function(event) {
53 | var $target = $(event.target),
54 | id = $target.closest('.footnote.active').attr('id');
55 |
56 | $("html, body").animate({ scrollTop: $('a[href="#' + id + '"]').offset().top - 150 }, 200);
57 | }
58 |
59 | }
60 | })(jQuery);
61 |
--------------------------------------------------------------------------------
/docs_italia_theme/layouts/document_actions.html:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 | {#
26 |
32 | #}
33 | {% if github_user and page_source_suffix %}
34 | {% set github_url = "https://github.com/" + github_user + "/" + github_repo + "/blob/" + github_version + conf_py_path + pagename + page_source_suffix %}
35 | {% endif %}
36 |
42 |
--------------------------------------------------------------------------------
/sass/abstract/_variables.scss:
--------------------------------------------------------------------------------
1 | /* Color */
2 | $white: #fff;
3 | $black: #000;
4 | $lighteen-blue: #f6fbff;
5 | $light-blue: #e6f3fe; //#bbd8f1; ?
6 | $light-blue-01: #00c4c8;
7 | $blue: #0073e6;
8 | $medium-blue: #06c;
9 | $medium-blue-01: #799ebc;
10 | $medium-blue-02: #bbd8f1;
11 | $mid-dark-blue: #004e95;
12 | $dark-blue: #002b4d;
13 | $darker-blue: #004080;
14 | $sky-blue: #bffffd;
15 | $grey-light: #f9fafb;
16 | $grey-light-01: #eeeff0;
17 | $grey-light-02: #eaebed;
18 | $grey: #ccc;
19 | $grey-mid: #596771;
20 | $grey-mid-01: #8998a5;
21 | $grey-dark: #0b0b0b;
22 | $dark-blue-border: #193e5e;
23 | $red: #d83750;
24 | $red-alt: #d1344c;
25 | $orange: #df7d26;
26 | $teal: #4bd4d6;
27 | $green: #008255;
28 | $green-alt: #00cf86;
29 | $light-green: #efc;
30 |
31 | /* Font */
32 | $stack-font: "Lora", serif;
33 | $titillium-font: "Titillium Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
34 | $docs-font-icon: "docs-icons";
35 |
36 | $chapter-nav-width: 200px;
37 | $sidebar-width: 420px;
38 |
39 | // Icon
40 | $icon-font-path: "../font" !default;
41 |
42 | $docs-icon-more: "\e900";
43 | $docs-icon-expand: "\e901";
44 | $docs-icon-collapse: "\e902";
45 | $docs-icon-plus: "\e903";
46 | $docs-icon-minus: "\e904";
47 | $docs-icon-document: "\e905";
48 | $docs-icon-edit: "\e906";
49 | $docs-icon-download: "\e907";
50 | $docs-icon-info: "\e908";
51 | $docs-icon-compare: "\e909";
52 | $docs-icon-github: "\e90a";
53 | $docs-icon-share: "\e90b";
54 | $docs-icon-search: "\e90c";
55 | $docs-icon-link: "\e90d";
56 | $docs-icon-external-link: "\e90e";
57 | $docs-icon-comment: "\e90f";
58 | $docs-icon-attention: "\e910";
59 | $docs-icon-example: "\e911";
60 | $docs-icon-procedure: "\e912";
61 | $docs-icon-hint: "\e913";
62 | $docs-icon-note: "\e914";
63 | $docs-icon-step: "\e915";
64 | $docs-icon-pdf: "\e916";
65 | $docs-icon-html: "\e917";
66 | $docs-icon-user: "\e918";
67 | $docs-icon-docs: "\e919";
68 | $docs-icon-project: "\e91a";
69 | $docs-icon-publisher: "\e91b";
70 | $docs-icon-check: "\e91c";
71 | $docs-icon-not: "\e91d";
72 |
--------------------------------------------------------------------------------
/js/active_versions.js:
--------------------------------------------------------------------------------
1 | // Active versions
2 | module.exports = activeVersions = (function ($) {
3 | var that;
4 |
5 | return {
6 | $: {
7 | $versionList: $('#version-list').find('.version-list-wrapper'),
8 | $apiBaseUrl: '/docsitalia/api/document/',
9 | $activeVerionsEndpoint: READTHEDOCS_DATA.project + '/active_versions/',
10 | $activeVersions: [],
11 | $projectBaseUrl: [
12 | '',
13 | DOCSITALIA_DATA.publisher_slug,
14 | DOCSITALIA_DATA.publisher_project_slug,
15 | READTHEDOCS_DATA.project,
16 | READTHEDOCS_DATA.language,
17 | ''
18 | ].join('/'),
19 | $versionElement: '
%name% '
20 | },
21 |
22 | init: function() {
23 |
24 | that = this.$;
25 | $.ajax({
26 | dataType: 'json',
27 | url: READTHEDOCS_DATA.api_host + that.$apiBaseUrl + that.$activeVerionsEndpoint,
28 | success: activeVersions.success,
29 | error: activeVersions.error,
30 | complete: activeVersions.updateVersionList,
31 | cache: false
32 | });
33 | },
34 |
35 | success: function(data) {
36 | that.$activeVersions = data.versions.reduce(function(activeVersions, version) {
37 | (version.active == true && version.built == true)
38 | && activeVersions.push({
39 | name: version.verbose_name,
40 | url: that.$projectBaseUrl + version.slug + '/'
41 | });
42 | return activeVersions
43 | }, []);
44 | },
45 |
46 | error: function() {
47 | that.$activeVersions = LOCAL ? [{
48 | name: READTHEDOCS_DATA.version,
49 | url: '#'
50 | }] : [];
51 | },
52 |
53 | updateVersionList: function() {
54 | that.$activeVersions.map(function(version) {
55 | that.$versionList.append(that.$versionElement.replace(/%\w+%/g, function(match) {
56 | return version[match.replace(/%/g, '')] || match;
57 | }));
58 | });
59 | }
60 | }
61 | })(jQuery);
62 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | """Sphinx Docs Italia theme"""
4 |
5 | import codecs
6 | import json
7 |
8 | from setuptools import setup
9 |
10 | package_file = codecs.open('package.json', 'r', 'utf-8')
11 | package_data = json.load(package_file)
12 |
13 |
14 | setup(
15 | name = 'docs_italia_theme',
16 | version = package_data['version'],
17 | license = package_data['license'],
18 | author = 'Team per la Trasformazione Digitale - AgID',
19 | description = __doc__,
20 | long_description = codecs.open('README.md', 'r', 'utf-8').read(),
21 | zip_safe = False,
22 | packages = ['docs_italia_theme', 'docs-italia-theme'],
23 | package_data = {'docs_italia_theme': [
24 | 'theme.conf',
25 | '*.html',
26 | 'static/css/*.css',
27 | 'static/icons/*.*',
28 | 'static/js/*.js',
29 | 'static/*.png',
30 | 'static/*.svg',
31 | 'static/font/*.*',
32 | 'data/*.*',
33 | ]},
34 | include_package_data = True,
35 | # See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
36 | entry_points = {
37 | 'sphinx.html_themes': [
38 | 'docs_italia_theme = docs_italia_theme'
39 | ]
40 | },
41 | classifiers = [
42 | 'Development Status :: 5 - Production/Stable',
43 | 'License :: OSI Approved :: MIT License',
44 | 'Environment :: Console',
45 | 'Environment :: Web Environment',
46 | 'Intended Audience :: Developers',
47 | 'Programming Language :: Python :: 2.7',
48 | 'Programming Language :: Python :: 3',
49 | 'Programming Language :: Python :: 3.3',
50 | 'Programming Language :: Python :: 3.4',
51 | 'Programming Language :: Python :: 3.5',
52 | 'Programming Language :: Python :: 3.6',
53 | 'Operating System :: OS Independent',
54 | 'Topic :: Documentation',
55 | 'Topic :: Software Development :: Documentation'
56 | ],
57 | install_requires = [
58 | 'PyYAML'
59 | ]
60 | )
61 |
--------------------------------------------------------------------------------
/docs_italia_theme/data/_data/tools.yml:
--------------------------------------------------------------------------------
1 | it:
2 | -
3 | title: Codice sorgente
4 | subtitle: Sul nostro GitHub Italia, sviluppiamo con un processo aperto gli SDK e gli esempi di supporto dei progetti, e gestiamo anche le segnalazioni dei problemi.
5 | icon: list
6 | url: https://github.com/italia
7 | -
8 | title: Forum
9 | subtitle: Utilizziamo Discourse come forum per aiutare la comunità a discutere sui progetti, scambiarsi trucchi e consigli, e parlare con i maintainer delle evoluzioni future.
10 | icon: comment
11 | url: https://forum.developers.italia.it
12 | -
13 | title: Documentazione
14 | subtitle: Qui trovi la documentazione tecnica dei progetti, scritta principalmente in Markdown and ReStructured Text, e compilata con Sphinx e ReadTheDocs
15 | url: https://docs.developers.italia.it
16 | -
17 | title: Sandbox per API
18 | subtitle: Gioca direttamente con le API dei progetti, in un ambiente di testing che ti aiuterà ad esplorare e sistemare la tua implementazione.
19 | comingsoon: true
20 | icon: settings
21 |
22 | en:
23 | -
24 | title: Source code
25 | subtitle: On our GitHub Italia, we develop SDK and examples to support our projects, with an open development process, and we also track existing issues.
26 | icon: list
27 | url: https://github.com/italia
28 | -
29 | title: Forum
30 | subtitle: Discourse is our forum of choice, to help the community discuss about the projects, exchange tips and tricks, and discuss with maintainers on the roadmap.
31 | icon: comment
32 | url: https://forum.developers.italia.it
33 | -
34 | title: Docs
35 | subtitle: Here you will find the technical documentation of all the projcets, mainly written in Markdown and ReStructured Text, and compiled with Sphinx and RedTheDocs
36 | url: https://docs.developers.italia.it
37 | -
38 | title: API Sandbox
39 | subtitle: Play with all the APIs exposed by the projects, in a testing environment that will help you exploring and fixing your implementation.
40 | comingsoon: true
41 | icon: settings
42 |
--------------------------------------------------------------------------------
/docs_italia_theme/layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {% include 'layouts/head.html' %}
5 |
6 |
7 | {% include 'layouts/loader_show_script.html' %}
8 | {% include 'layouts/header.html' %}
9 |
10 | {% include 'layouts/templates.html' %}
11 |
12 |
13 |
14 |
15 |
16 | {% include 'layouts/sidebar.html' %}
17 | {% include 'layouts/sidebar_offcanvas.html' %}
18 |
19 |
20 |
24 | {% if prev %}
25 |
28 | {% endif %}
29 | {% block body %}{% endblock %}
30 | {% if next %}
31 |
34 | {% endif %}
35 |
36 |
37 |
38 |
39 |
40 | {% include 'layouts/footer.html' %}
41 | {% include 'layouts/l10n.html' %}
42 | {% include 'layouts/scrolltop.html' %}
43 | {% block scripts %}
44 | {% include 'layouts/scripts.html' %}
45 | {% endblock %}
46 | {% include 'layouts/web-analytics.html' %}
47 | {% if docsitalia_data %}
48 | {% include 'layouts/document_modals.html' %}
49 | {% endif %}
50 |
51 |
52 |
--------------------------------------------------------------------------------
/sass/layout/_dropdown.scss:
--------------------------------------------------------------------------------
1 | .dropdown-menu {
2 | background-color: #fff;
3 | padding: 0.5rem;
4 | margin: 0;
5 | border-radius: 0.2rem;
6 | box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.35);
7 | z-index: 100;
8 |
9 | .dropdown-item {
10 | color: #0073e6;
11 |
12 | &.active,
13 | &:active {
14 | font-weight: 600;
15 | text-decoration: inherit;
16 | background-color: inherit;
17 | }
18 | }
19 | }
20 |
21 | #version-list {
22 | .dropdown-toggle .current-version {
23 | max-width: 8em;
24 | text-overflow: ellipsis;
25 | overflow: hidden;
26 | display: inline-block;
27 | font-size: inherit;
28 | font-weight: 400;
29 | }
30 |
31 | .version-list-wrapper {
32 | max-height: 10.2em;
33 | max-width: 18em;
34 | overflow-y: scroll;
35 | }
36 |
37 | .dropdown-item {
38 | text-overflow: ellipsis;
39 | max-width: 16em;
40 | overflow-x: hidden;
41 | }
42 | }
43 |
44 | .document-actions {
45 | .dropdown-toggle {
46 | &::after {
47 | vertical-align: middle;
48 | line-height: 1.5;
49 | }
50 | }
51 |
52 | @include media-breakpoint-down(sm) {
53 | .dropdown-toggle {
54 | &::after {
55 | /* stylelint-disable */
56 | font-family: "italia-icon-font" !important;
57 | /* stylelint-enable */
58 | border: none;
59 | margin: 0 2em 0 0;
60 | width: auto;
61 | height: auto;
62 | float: right;
63 | content: '\e818';
64 | vertical-align: middle;
65 | font-size: $navigation-dropdown-icon-size;
66 | line-height: $navigation-dropdown-icon-line-height;
67 | transform-origin: center;
68 | transition: all 0.3s;
69 | }
70 |
71 | &[aria-expanded="true"]::after {
72 | transform: scaleY(-1);
73 | }
74 |
75 | &:hover {
76 | text-decoration: none;
77 | }
78 | }
79 |
80 | .dropdown-menu.show {
81 | position: static !important;
82 | transform: none !important;
83 | box-shadow: none;
84 | padding: 0;
85 | margin-top: 16px;
86 | animation: none;
87 |
88 | &::before {
89 | display: none;
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/demo_docs/source/glossario.rst:
--------------------------------------------------------------------------------
1 | Glossario
2 | =========
3 |
4 | A
5 | -
6 |
7 | .. glossary::
8 |
9 | timeam
10 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
11 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
12 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
13 |
14 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
15 | fugiat nulla pariatur.
16 |
17 | antiopam
18 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
19 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
20 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
21 |
22 | voluptatum
23 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
24 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
25 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
26 |
27 | ullamco
28 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
29 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
30 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
31 |
32 | B
33 | -
34 |
35 | .. glossary::
36 |
37 | btimeam
38 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
39 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
40 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
41 |
42 | bantiopam
43 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
44 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
45 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
46 |
47 | bvoluptatum
48 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
49 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
50 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
51 |
52 | BULL_AMCO
53 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
54 | consectetur, adipisci velit, sed quia non numquam eius modi tempora
55 | incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://developersitalia.slack.com/messages/C7658JRJR)
2 | [](https://slack.developers.italia.it/)
3 |
4 | # Docs Italia theme
5 |
6 | This is the official theme for any piece of documentation hosted on the
7 | upcoming Docs Italia.
8 |
9 | ## How to use Sphinx Italia on your documentation
10 |
11 | * Add the following line to your documentation `requirements.txt` file:
12 |
13 | ```
14 | $ pip install git+https://github.com/italia/docs-italia-theme.git
15 | ```
16 |
17 | * In your `conf.py` file, you'll need to specify the theme as follows:
18 |
19 | ```
20 | # Add this line at the top of the file within the "import" section
21 | import docs_italia_theme
22 |
23 | # Add the Sphinx extension 'docs_italia_theme' in the extensions list
24 | extensions = [
25 | # ...,
26 | 'docs_italia_theme'
27 | ]
28 |
29 | # Edit these lines
30 | html_theme = "docs_italia_theme"
31 | html_theme_path = [docs_italia_theme.get_html_theme_path()]
32 | ```
33 |
34 | ## Contributing or modifying the theme
35 |
36 | * Clone the repository:
37 |
38 | ```
39 | git clone git+https://github.com/italia/docs-italia-theme.git
40 | ```
41 |
42 | * If needed, install [Sphinx](http://www.sphinx-doc.org/en/stable/) into a virtual environment:
43 |
44 | ```
45 | pip install sphinx
46 | ```
47 |
48 | * If needed, install [SASS](http://sass-lang.com/):
49 |
50 | ```
51 | gem install sass
52 | ```
53 |
54 | 4. Install [node.js](https://nodejs.org) and grunt:
55 |
56 | ```
57 | // Install node on OS X
58 | brew install node
59 |
60 | // Install grunt
61 | npm install -g grunt-cli
62 |
63 | // Now that everything is installed, let's install the theme dependecies.
64 | npm install
65 | ```
66 |
67 | 5. Run the main script to load a sample docs with the Sphinx Italia theme applied:
68 |
69 | ```
70 | npm start
71 | ```
72 |
73 | This will compile static assets and watch files required for the theme to reload at runtime.
74 |
75 | **TODO:** building a release, handling versioning system to enable automatic update on Docs Italia platform
76 |
--------------------------------------------------------------------------------
/sass/layout/_content-nav.scss:
--------------------------------------------------------------------------------
1 | .chapter-nav__list--hidden {
2 | &:not(.show) {
3 | @include media-breakpoint-down(md) {
4 | display: none;
5 | }
6 | }
7 |
8 | @include media-breakpoint-up(lg) {
9 | visibility: hidden;
10 | opacity: 0;
11 | transition: visibility 0.35s, opacity 0.35s;
12 |
13 | &.active {
14 | visibility: visible;
15 | opacity: 1;
16 | }
17 | }
18 | }
19 |
20 | .chapter-nav__list-wrap {
21 | @include media-breakpoint-down(md) {
22 | max-width: 300px;
23 | margin-left: auto;
24 | margin-right: auto;
25 | border-radius: 4px;
26 | }
27 | }
28 |
29 | .chapter-nav__wrap {
30 | @include media-breakpoint-up(lg) {
31 | position: absolute;
32 | left: 2rem;
33 | top: 1rem;
34 | }
35 | }
36 |
37 | .chapter-link {
38 | background: none;
39 | border: none;
40 | color: $blue;
41 | padding: 0;
42 | display: inline-block;
43 | font-size: 0.9em;
44 | font-weight: 400;
45 | cursor: pointer;
46 | vertical-align: middle;
47 |
48 | &:hover {
49 | text-decoration: underline;
50 | }
51 | }
52 |
53 | .chapter-link__title {
54 | float: left;
55 | }
56 |
57 | .chapter-link__counter {
58 | margin-right: 0.3rem;
59 | display: inline-block;
60 | float: left;
61 | }
62 |
63 | .chapter-nav__list {
64 | list-style-type: none;
65 | margin-bottom: 0;
66 | padding: 1rem;
67 |
68 | @include media-breakpoint-up(lg) {
69 | padding: 0;
70 | }
71 | }
72 |
73 | .chapter-nav__title {
74 | padding: 1rem;
75 | color: $black;
76 | font-size: 0.8rem;
77 | font-weight: 700;
78 | border-bottom: 1px $grey solid;
79 |
80 | .title__chapter {
81 | color: $grey-mid-01;
82 | }
83 |
84 | @include media-breakpoint-up(lg) {
85 | display: none;
86 | }
87 | }
88 |
89 | .chapter-nav__item:not(:last-child) {
90 | margin-bottom: 1rem;
91 |
92 | @include media-breakpoint-up(lg) {
93 | margin-bottom: 0;
94 | }
95 | }
96 |
97 | .chapter-nav__list--visible {
98 | margin-top: 1rem;
99 |
100 | @include media-breakpoint-up(lg) {
101 | margin-top: -0.5rem;
102 | }
103 |
104 | .chapter-nav__item {
105 | display: inline-block;
106 |
107 | @include media-breakpoint-up(lg) {
108 | display: block;
109 | }
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/docs_italia_theme/static/images/may.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
8 |
9 |
11 |
12 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/sass/layout/_navbar-secondary-offcanvas.scss:
--------------------------------------------------------------------------------
1 | .offcanvas-menu {
2 | position: fixed;
3 | z-index: 1000;
4 | width: 100vw;
5 | height: 100vh;
6 | top: 0;
7 | left: 0;
8 | right: 0;
9 | bottom: 0;
10 |
11 | &.animate--left {
12 | transform: translate3d(-100%, 0, 0);
13 | transition: transform 0.4s;
14 | transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
15 | }
16 |
17 | &.js-active {
18 | transform: translate3d(0, 0, 0);
19 | transition: transform 0.8s;
20 | transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
21 | }
22 |
23 | .offcanvas-menu__inner {
24 | width: 80%;
25 | background-color: #fff;
26 | height: 100vh;
27 | transform: translateX(0);
28 | transition: all 0.5s ease-out;
29 |
30 | .offcanvas-menu__header {
31 | padding: 1.5rem 1.8rem 1rem;
32 |
33 | .offcanvas-menu__title {
34 | font-weight: 600;
35 | font-size: 1.2rem;
36 | }
37 | }
38 |
39 | .offcanvas-menu__nav {
40 | padding: 0.5rem 0 0 0;
41 | margin: 0;
42 |
43 | .offcanvas-menu__nav__item {
44 | list-style: none;
45 | margin: 0;
46 | padding: 0.5rem 1rem;
47 |
48 | // Horiontal separators
49 | &:nth-child(1),
50 | &:nth-child(4) {
51 | position: relative;
52 |
53 | &::before {
54 | content: '';
55 | width: 64px;
56 | height: 1px;
57 | left: 2rem;
58 | border-top: 1px solid rgba(0, 102, 204, 0.2);
59 | position: absolute;
60 | top: 0;
61 | }
62 | }
63 |
64 | .offcanvas-menu__nav__link {
65 | padding: 0.5rem 1rem;
66 | font-size: 1rem;
67 | display: block;
68 | }
69 | }
70 | }
71 | }
72 |
73 | &.deactive .offcanvas-menu__inner {
74 | margin-left: -80%;
75 | overflow: hidden;
76 | }
77 |
78 | .offcanvas-menu__extra {
79 | width: 20%;
80 | height: 100vh;
81 | position: fixed;
82 | right: 0;
83 | top: 0;
84 | }
85 | }
86 |
87 | body::before {
88 | position: fixed;
89 | top: 0;
90 | left: 0;
91 | z-index: 999;
92 | bottom: 0;
93 | right: 0;
94 | background: rgba(0, 0, 0, 0.5);
95 | content: '';
96 | opacity: 0;
97 | transform: translate3d(100%, 0, 0);
98 | transition: opacity 0.4s, transform 0s 0.4s;
99 | transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
100 | }
101 |
102 | body.show-menu::before {
103 | opacity: 1;
104 | transition: opacity 0.8s;
105 | transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
106 | transform: translate3d(0, 0, 0);
107 | }
108 |
--------------------------------------------------------------------------------
/js/modernizr.min.js:
--------------------------------------------------------------------------------
1 | /*! modernizr 3.7.1 (Custom Build) | MIT *
2 | * https://modernizr.com/download/?-touchevents-setclasses !*/
3 | !function(e,n,t){function o(e,n){return typeof e===n}function s(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):u?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function a(){var e=n.body;return e||(e=s(u?"svg":"body"),e.fake=!0),e}function i(e,t,o,i){var r,l,f,u,d="modernizr",p=s("div"),h=a();if(parseInt(o,10))for(;o--;)f=s("div"),f.id=i?i[o]:d+(o+1),p.appendChild(f);return r=s("style"),r.type="text/css",r.id="s"+d,(h.fake?h:p).appendChild(r),h.appendChild(p),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(n.createTextNode(e)),p.id=d,h.fake&&(h.style.background="",h.style.overflow="hidden",u=c.style.overflow,c.style.overflow="hidden",c.appendChild(h)),l=t(p,e),h.fake?(h.parentNode.removeChild(h),c.style.overflow=u,c.offsetHeight):p.parentNode.removeChild(p),!!l}var r=[],l={_version:"3.7.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var t=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){r.push({name:e,fn:n,options:t})},addAsyncTest:function(e){r.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=l,Modernizr=new Modernizr;var f=[],c=n.documentElement,u="svg"===c.nodeName.toLowerCase(),d=l._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];l._prefixes=d;var p=function(){var n=e.matchMedia||e.msMatchMedia;return n?function(e){var t=n(e);return t&&t.matches||!1}:function(n){var t=!1;return i("@media "+n+" { #modernizr { position: absolute; } }",function(n){t="absolute"===(e.getComputedStyle?e.getComputedStyle(n,null):n.currentStyle).position}),t}}();l.mq=p,Modernizr.addTest("touchevents",function(){if("ontouchstart"in e||e.TouchEvent||e.DocumentTouch&&n instanceof DocumentTouch)return!0;var t=["(",d.join("touch-enabled),("),"heartz",")"].join("");return p(t)}),function(){var e,n,t,s,a,i,l;for(var c in r)if(r.hasOwnProperty(c)){if(e=[],n=r[c],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t
0&&(n+=" "+t+e.join(" "+t)),u?c.className.baseVal=n:c.className=n)}(f),delete l.addTest,delete l.addAsyncTest;for(var h=0;h