Skip to content

Commit

Permalink
Update Sphinx theme re move to latest bootstrap #493
Browse files Browse the repository at this point in the history
In updating from a now very old bootstrap of v3.3.4/5,
to v5.3.3, we have a number of changes required. Modify
our custom 'rockstor' theme files accordingly.

Includes:
- Removal of redundant jslibs & css files.
- Update project metadata and syntax highlighting.
The existing pygments_style in conf.py was not listed in comment
reference added. Move to `native` as this is found in all themes.
- Re-enables highlight background override (in theme) for .highlight.
- Remove JQuery dependant _blank modifier for external links.
This has been non-functional in production for some time now;
removing, in the interests of minimising our doc html dependencies.
- Move Search element from maincontent to new/updated navbar configuration.
Simplifies layout and saves space.
- Minor vertical tweak re logo positioning.
- Move all unspecified code-block:: elements to `console`.
Unspecified code-block:: elements displayed suboptimally.
Thus far we use `console`, `text`, 'bash', and `yaml` in order
of frequency of use. All appear to format acceptably.
- Improve warnings format element: scrutiny.rst.
  • Loading branch information
phillxnet committed Oct 9, 2024
1 parent cb5651b commit a454624
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 2,947 deletions.
11 changes: 6 additions & 5 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# General information about the project.
project = u'Rockstor'
copyright = u'2015, Rockstor, Inc'
copyright = u'The Rockstor Project'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -88,7 +88,8 @@
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# https://www.florian-diesch.de/doc/sphinx/themes-and-pygments-styles/index.html#theme-sphinxdoc
pygments_style = 'native'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
Expand Down Expand Up @@ -202,7 +203,7 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'Rockstor.tex', u'Rockstor Documentation',
u'Rockstor, Inc', 'manual'),
u'The Rockstor Project', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -232,7 +233,7 @@
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'rockstor', u'Rockstor Documentation',
[u'Rockstor, Inc'], 1)
[u'The Rockstor Project'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -246,7 +247,7 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Rockstor', u'Rockstor Documentation',
u'Rockstor, Inc', 'Rockstor', 'One line description of project.',
u'The Rockstor Project', 'Rockstor', 'An Open Source Linux & BTRFS DIY NAS',
'Miscellaneous'),
]

Expand Down
2 changes: 1 addition & 1 deletion howtos/15-3_to_15-4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ So ensure that you have at least 2 GB free on your system disk ('ROOT' Pool), be
To reboot from the command line once the above "zypper ... dup ..." command has finished,
enter the following commands as root:

.. code-block::
.. code-block:: console
sync
reboot
Expand Down
2 changes: 1 addition & 1 deletion howtos/15-4_to_15-5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ So ensure that you have at least 2 GB free on your system disk ('ROOT' Pool), be
To reboot from the command line once the above "zypper ... dup ..." command has finished,
enter the following commands as root:

.. code-block::
.. code-block:: console
sync
reboot
Expand Down
2 changes: 1 addition & 1 deletion howtos/15-5_to_15-6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ I.e. don't install things like manuals etc and other 'extra' packages.
To reboot from the command line once the above "zypper ... dup ..." command has finished,
enter the following commands as root:

.. code-block::
.. code-block:: console
sync
reboot
Expand Down
7 changes: 3 additions & 4 deletions interface/docker-based-rock-ons/scrutiny.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ project repository `here <https://github.com/AnalogJ/scrutiny/blob/master/exampl
You can modify the file `scrutiny.yaml` located in the share
"Scrutiny-Config-Share".

**Warning!**

If :code:`smartd` is not working or doesn't list any device, (like in a VM) the
dashboard will remain empty!
.. warning::
**WARNING** If :code:`smartd` is not working or doesn't list any device,
(like in a VM) the dashboard will remain empty!
2 changes: 1 addition & 1 deletion interface/storage/file_sharing/nfs_ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The Rockstor Share named *share01* is now accessible on the Linux laptop at the
If you would like your Linux laptop to automatically mount this NFS export at startup,
you can manually edit your :code:`/etc/fstab` file to contain the following line:

.. code-block::
.. code-block:: console
rockstable:/export/share01 $HOME/share01 nfs4 rw 0 0
Expand Down
69 changes: 34 additions & 35 deletions themes/rockstor/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@

{%- block extrahead %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rockstor | Linux and BTRFS powered Open Source NAS appliance</title>
<script src="{{ pathto('_static/' + 'js/libs/bootstrap.js', 1) }}"></script>
<script type="text/javascript">
<!-- Adds target=_blank to external links -->
$(document).ready(function () {$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');});
</script>
<script src="{{ pathto('_static/' + 'js/libs/bootstrap.bundle.min.js', 1) }}"></script>
<link rel="shortcut icon" href="{{ pathto('_static/' + 'img/ico/favicon.ico', 1) }}" type="image/x-icon" />
<link rel="me" href="https://mastodon.world/@TheRockstorProject">
{%- endblock %}
Expand All @@ -35,42 +31,44 @@

{%- block content %}

<nav class="navbar navbar-inverse" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="/docs"><img src="{{ pathto('_static/' + 'img/rockstorlogo-font2.png', 1) }}" style="padding-top: 8px;" width="150px">
</a>
</div>

<div class="collapse navbar-collapse navbar-right" id="togglebar">
<ul class="nav navbar-nav">
<li><a href="https://rockstor.com/" target="_blank">Website</a></li>
<li><a href="https://opencollective.com/the-rockstor-project" target="_blank">Open Collective</a></li>
<nav class="navbar bg-dark navbar-expand-lg bg-body-tertiary" data-bs-theme="dark" role="navigation">
<div class="container-fluid">
<a class="navbar-brand" href="/docs">
<img src="{{ pathto('_static/' + 'img/rockstorlogo-font2.png', 1) }}" alt="Bootstrap"
style="padding-bottom: 6px;" width="150px">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li>
<a class="nav-link active" href="https://rockstor.com/" target="_blank">Website</a>
</li>
<li>
<a class="nav-link active" href="https://opencollective.com/the-rockstor-project" target="_blank">Open
Collective</a>
</li>
</ul>

<form class="form-inline" id="top-search" method="get" action="{{ pathto('search.html', 1) }}">
<label>
<input type="text" value="" name="q"></input>
</label>
<input class="btn btn-primary-main-story" type="submit" value="Search"></input>
<span id="search-progress" style="padding-left: 10px"></span>
</form>
</div>
</div>
</nav>


<div id="maincontent">
<div class="container">
<span style="padding-left: 20px;" class="h1">Documentation</span>

<div class="pull-right">
<form class="form-inline" id="top-search" method="get" action="{{ pathto('search.html', 1) }}">
<input type="text" value="" name="q"></input>
&nbsp;
<input class="btn btn-primary-main-story" type="submit" value="Search"></input>
<span id="search-progress" style="padding-left: 10px"></span>
</form>
</div>
<div class="row-fluid">
<!-- https://getbootstrap.com/docs/5.2/layout/grid/#how-it-works-->
<div class="row">
<div class="col-lg-4 col-xs-12">
<div class="sphinxsidebarwrapper">
<a href="/docs"><h3>Table of contents</h3></a>
Expand All @@ -91,16 +89,17 @@
<div role="main">
{% block body %}{% endblock %}
</div>
<div class="pull-left">
<div class="float-start">
{% if prev %}
<a href="{{ prev.link|e }}">{{ prev.title }} <-</a>&nbsp;&nbsp;
{% endif %}
</div>
<div class="pull-right">
<div class="float-end">
{% if next %}
<a href="{{ next.link|e }}">-> {{ next.title }}</a>
{% endif %}
</div>
<br>
</div>
</div>

Expand Down
11 changes: 6 additions & 5 deletions themes/rockstor/static/css/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions themes/rockstor/static/css/bootstrap.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/rockstor/static/css/syntax.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

.highlight .hll { background-color: #49483e }
.highlight { /*background: #272822;*/ color: #f8f8f2 }
.highlight { background: #272822; color: #f8f8f2 }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
Expand Down
7 changes: 7 additions & 0 deletions themes/rockstor/static/js/libs/bootstrap.bundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions themes/rockstor/static/js/libs/bootstrap.bundle.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit a454624

Please sign in to comment.