Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actual mobile toc; dark mode; speed up site loading #3950

Merged
merged 36 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
18f7b8f
Remove extraneous padding and javascript, add dark mode; todo: mobile…
nathan-contino Oct 22, 2024
0da2ebf
refactor to left side toc and right side page nav, need to make left …
nathan-contino Oct 23, 2024
2bbe65f
Remove checkboxes, make on this page visible on smaller screens, star…
nathan-contino Oct 25, 2024
90e30af
mobile menu working; todo: open and close toc folders
nathan-contino Nov 27, 2024
2881b23
Bold and expand to current page; optimise theme loading time to preve…
nathan-contino Dec 3, 2024
b161535
Merge branch 'develop' into reduce-padding
nathan-contino Dec 3, 2024
32dcbc5
Swap barred logo for solid colored logo
nathan-contino Dec 3, 2024
d3b7019
Refactored the toc and theme javascript into separate files; cleaned …
nathan-contino Dec 3, 2024
f71186f
Tweak accent colour for dark theme, add padding to bottom of docs con…
nathan-contino Dec 4, 2024
da42c69
Improve appearance of side toc; stop on-this-page v footer conflicts;…
nathan-contino Dec 4, 2024
49d898d
improve table appearance in dark mode; fix toc highlight bug with dup…
nathan-contino Dec 4, 2024
d2ccf7c
Add box shadow to searchbar to make toc scrolling hidden bits more ob…
nathan-contino Dec 4, 2024
cb1bd36
Incorporate updated rpi header and footer; improve footer appearance;…
nathan-contino Dec 9, 2024
0103af0
Hide on-this-page until a slightly larger screen size for better Safa…
nathan-contino Dec 9, 2024
72da5ec
Restore legal, copyright, and contribution bits to footer top; preven…
nathan-contino Dec 9, 2024
0be1310
Remove explicit width from container and top-title elements to preven…
nathan-contino Dec 9, 2024
50ba5b6
Maybe fix small-triangles mobile issue
nathan-contino Dec 9, 2024
54f5e4d
Switch to SVG category icon to improve mobile compatibility; improve …
nathan-contino Dec 9, 2024
a28a588
Tweak sidebar size and padding
nathan-contino Dec 10, 2024
0d43af2
Tweak footer to consume all available horizontal width
nathan-contino Dec 10, 2024
673a53c
Improve toc element alignment, boxes landing page search bar appearan…
nathan-contino Dec 10, 2024
49bf5b8
Increase mobile menu button size
nathan-contino Dec 10, 2024
6716e93
Position on-this-page behind footer
nathan-contino Dec 10, 2024
c82e538
improve theme button alignment in sidebar
nathan-contino Dec 10, 2024
ec51bb4
Add highlighting for current anchor point, and anchor parent, in toc
nathan-contino Dec 10, 2024
182494f
UI improvements, including centered content on ultrawide screens and …
nathan-contino Dec 10, 2024
09738a5
Give SoC additional room on flagship table, reduce padding for lists
nathan-contino Dec 10, 2024
f55d1e0
Align search bar on mobile site layout
nathan-contino Dec 11, 2024
1bc73ff
Unify landing page styling and add some slight spacing to tabs on lan…
nathan-contino Dec 11, 2024
f9e443f
Enable tabs on mobile landing pages
nathan-contino Dec 11, 2024
5ec4770
Add small gap between on-this-page highlighting and docs content
nathan-contino Dec 11, 2024
11c7bcb
Constrain size of search bar on landing page
nathan-contino Dec 11, 2024
2bb249a
Lighten code blocks and accent background in light mode; set max page…
nathan-contino Dec 11, 2024
f945ba9
Tweak tab colour for better contrast with code blocks and monospace t…
nathan-contino Dec 11, 2024
fd41a86
Update toc hover colour for new sidebar colour
nathan-contino Dec 11, 2024
2ed5d08
Tweak footer background color to better mesh with new colour palette
nathan-contino Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/asciidoc/accessories/sense-hat/software.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ After installation, example code can be found under `/usr/src/sense-hat/examples

Complete documentation for the library can be found at https://sense-hat.readthedocs.io/en/latest/[sense-hat.readthedocs.io].

=== Use the Sense HAT with {cpp}
=== Use the Sense HAT with C++

https://github.com/RPi-Distro/RTIMULib[RTIMULib] is a {cpp} and Python library that makes it easy to use 9-dof and 10-dof IMUs with embedded Linux systems. A pre-calibrated settings file is provided in `/etc/RTIMULib.ini`, which is also copied and used by `sense-hat`. The included examples look for `RTIMULib.ini` in the current working directory, so you may wish to copy the file there to get more accurate data.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== Raspberry Pi Pico C/{cpp} SDK
== Raspberry Pi Pico C/C++ SDK

lurch marked this conversation as resolved.
Show resolved Hide resolved
Our official C SDK can be used from the command line, or from popular integrated development environments like Visual Studio Code, Eclipse, and CLion. To get started, download our C/{cpp} SDK and Examples, and take a look at our 'https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf[getting started]' documentation. Or for a quick setup see the next section.

Expand Down
79 changes: 8 additions & 71 deletions jekyll-assets/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta property="og:title" content="{{ page.title }}">
<meta property="og:description" content="The official documentation for Raspberry Pi computers and microcontrollers">
<meta property="og:url" content="https://www.raspberrypi.com{{ page.url | relative_url }}">
<meta property="og:image" content="https://www.raspberrypi.com{{ "/images/opensocial.png" | relative_url }}">
<meta property="og:image" content="https://www.raspberrypi.com{{ '/images/opensocial.png' | relative_url }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@Raspberry_Pi">
<meta name="twitter:title" content="{{ page.title }}">
Expand All @@ -20,76 +20,13 @@
<link rel="stylesheet" href="{{ site.baseurl }}/css/style.css?ver={{ site.time | date: '%s' }}">
<link rel="stylesheet" href="{{ site.baseurl }}/css/asciidoctor-tabs.css?ver={{ site.time | date: '%s' }}">
<link rel="stylesheet" href="{{ site.baseurl }}/css/syntax-highlighting.css?ver={{ site.time | date: '%s' }}">
<link rel="stylesheet" href="{{ site.baseurl }}/css/tocbot.css">
<script src="{{ site.baseurl }}/scripts/tocbot.js"></script>
<script>
/* Trigger Tocbot dynamic TOC, works with tocbot 3.0.2 */
function makeToc() {
var oldtoc = document.getElementById('toc').nextElementSibling;
var newtoc = document.getElementById('tocbot');
newtoc.setAttribute('id', 'tocbot');
newtoc.setAttribute('class', 'js-toc');
oldtoc.parentNode.replaceChild(newtoc, oldtoc);
tocbot.init({ contentSelector: '#content',
headingSelector: 'h1, h2, h3, h4',
smoothScroll: true,
includeHtml: true
});
var handleTocOnResize = function() {
var width = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
if (width < 768) {
tocbot.refresh({ contentSelector: '#content',
headingSelector: 'h1, h2, h3, h4',
collapseDepth: 6,
activeLinkClass: 'ignoreactive',
throttleTimeout: 1000,
smoothScroll: true });
}
else {
tocbot.refresh({ contentSelector: '#content',
headingSelector: 'h1, h2, h3, h4',
smoothScroll: true });
}
};
window.addEventListener('resize', handleTocOnResize);
handleTocOnResize();
}

// toggles the site theme between dark and light
function toggleTheme() {
// fetch the theme from local storage (if it exists)
var theme = localStorage.getItem('theme');
// if theme them has never been set, or is light, set the theme to the dark symbol in local storage to change it
if (localStorage.getItem('theme') !== null && theme == '🌝' ) {
localStorage.setItem('theme', '🌚');
} else {
// otherwise, the theme is currently set to dark, so set the theme to the light symbol in local storage to change it
localStorage.setItem('theme', '🌝');
}
// finally, toggle the light option off or on the body to change the display of the theme
document.body.classList.toggle('light');
}

// initialises the site theme display
// of key interest here: from the user's perspective, the site defaults to the light theme...
// ...unless your browser uses prefers-color-scheme to ask for a dark theme
// from the site's perspective, we default to a dark theme, but toggle it to a light theme on load if the user doesn't ask for dark.
// why do this? To prevent an annoying light 'flash' for dark theme users. light theme users don't really notice or care if there's a dark anti-flash.
function initTheme() {
// fetch the theme from local storage (if it exists)
var theme = localStorage.getItem('theme');
// if the theme has been set to light (null check to short circuit if not set)
if(theme !== null && theme === '🌝'
// if we can use matchMedia and the browser supports the dark color scheme
|| (window.matchMedia && !window.matchMedia('(prefers-color-scheme: dark)').matches)
&& theme !== '🌚') {
// toggles the theme from the default dark mode to the light version (which actually _shows_ by default to many users)
document.body.classList.toggle('light');
}
}
</script>
<link rel="stylesheet" href="{{ site.baseurl }}/css/tocbot.css?ver={{ site.time | date: '%s' }}">
<script type="text/javascript" src="{{ site.baseurl }}/scripts/theme.js?ver={{ site.time | date: '%s' }}"></script>
<script type="text/javascript" src="{{ site.baseurl }}/scripts/tocbot.js?ver={{ site.time | date: '%s' }}"></script>
<script type="text/javascript" src="{{ site.baseurl }}/scripts/toc.js?ver={{ site.time | date: '%s' }}"></script>
<script type="text/javascript" src="{{ site.baseurl }}/scripts/asciidoctor-tabs.js?ver={{ site.time | date: '%s' }}"></script>
<script async src="{{ site.baseurl }}/scripts/clipboard.min.js?ver={{ site.time | date: '%s' }}"></script>
<script async src="{{ site.baseurl }}/scripts/copy-to-clipboard.js?ver={{ site.time | date: '%s' }}"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-V8TFXM3BKJ"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand Down
9 changes: 0 additions & 9 deletions jekyll-assets/_includes/scripts.html

This file was deleted.

7 changes: 3 additions & 4 deletions jekyll-assets/_layouts/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h1 id="docs-header-title">
<a class="level3" href="{{ site.baseurl }}{{ item.path }}#{{ entry.anchor }}" >
<a id="{{ item.path }}#{{entry.anchor}}-toc" class="toc-item" alt="expand documentation category" title="expand documentation category"
>
<style onload="if (window.location.hash.includes('{{ entry.anchor }}')) { document.getElementById('{{ item.path }}#{{entry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); document.getElementById('{{ item.path }}#{{ entry.anchor }}').checked = true; }"></style>
<script type="text/javascript">if (window.location.hash.includes('{{ entry.anchor }}')) { document.getElementById('{{ item.path }}#{{entry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); document.getElementById('{{ item.path }}#{{ entry.anchor }}').checked = true; }</script>
{{ entry.heading | markdownify }}
</a>
</a>
Expand All @@ -110,7 +110,7 @@ <h1 id="docs-header-title">
onclick="document.getElementById('mobile-toggle').checked = false;"
class="toc-item no-dropdown"
>
<style onload="if (window.location.hash.includes('{{ entry.anchor }}')) { document.getElementById('{{ item.path }}#{{entry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); document.getElementById('{{ item.path }}#{{ entry.anchor }}').checked = true; }"> </style>
<script type="text/javascript">if (window.location.hash.includes('{{ entry.anchor }}')) { document.getElementById('{{ item.path }}#{{entry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); document.getElementById('{{ item.path }}#{{ entry.anchor }}').checked = true; }</script>
{{ entry.heading | markdownify }}
</a>
</a>
Expand All @@ -132,7 +132,7 @@ <h1 id="docs-header-title">
href="{{ site.baseurl }}{{ item.path }}#{{ subentry.anchor }}" onclick="document.getElementById('mobile-toggle').checked = false;"
id="{{ item.path }}#{{subentry.anchor}}-toc"
>
<style onload="if (window.location.hash.includes('{{ subentry.anchor }}')) { document.getElementById('{{ item.path }}#{{subentry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); document.getElementById('{{ item.path }}#{{ entry.anchor }}').checked = true; document.getElementById('{{ item.path }}#{{entry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); }"></style>
<script type="text/javascript">if (window.location.hash.includes('{{ subentry.anchor }}')) { document.getElementById('{{ item.path }}#{{subentry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); document.getElementById('{{ item.path }}#{{ entry.anchor }}').checked = true; document.getElementById('{{ item.path }}#{{entry.anchor}}-toc').setAttribute('style', 'font-weight:bold'); }</script>
{{ subentry.heading | markdownify }}
</a>
</a>
Expand Down Expand Up @@ -176,7 +176,6 @@ <h5>On this page</h5>
</div>

{% include footer.html %}
{% include scripts.html %}
{% include search.html %}

</body>
Expand Down
10 changes: 5 additions & 5 deletions jekyll-assets/css/syntax-highlighting.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
.highlight .na { color: #bbbbbb } /* Name.Attribute */
.highlight .nb { color: var(--brand-colour) } /* Name.Builtin */
.highlight .nc { color: #447fcf; text-decoration: underline } /* Name.Class */
.highlight .no { color: #40ffff } /* Name.Constant */
.highlight .no { color: #40aaaa } /* Name.Constant */
.highlight .nd { color: #ffa500 } /* Name.Decorator */
.highlight .ni { color: var(--textcolor) } /* Name.Entity */
.highlight .ne { color: #bbbbbb } /* Name.Exception */
Expand All @@ -45,7 +45,7 @@
.highlight .nx { color: var(--textcolor) } /* Name.Other */
.highlight .py { color: var(--textcolor) } /* Name.Property */
.highlight .nt { color: #6ab825; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #40ffff } /* Name.Variable */
.highlight .nv { color: #40aaaa } /* Name.Variable */
.highlight .ow { color: #6ab825; font-weight: bold } /* Operator.Word */
.highlight .w { color: #666666 } /* Text.Whitespace */
.highlight .mf { color: #3677a9 } /* Literal.Number.Float */
Expand All @@ -64,9 +64,9 @@
.highlight .s1 { color: #ed9d13 } /* Literal.String.Single */
.highlight .ss { color: #ed9d13 } /* Literal.String.Symbol */
.highlight .bp { color: #24909d } /* Name.Builtin.Pseudo */
.highlight .vc { color: #40ffff } /* Name.Variable.Class */
.highlight .vg { color: #40ffff } /* Name.Variable.Global */
.highlight .vi { color: #40ffff } /* Name.Variable.Instance */
.highlight .vc { color: #40aaaa } /* Name.Variable.Class */
.highlight .vg { color: #40aaaa } /* Name.Variable.Global */
.highlight .vi { color: #40aaaa } /* Name.Variable.Instance */
.highlight .il { color: #3677a9 } /* Literal.Number.Integer.Long */

.highlight .gp, .highlight .gp + .w {
Expand Down
83 changes: 0 additions & 83 deletions jekyll-assets/scripts/nav.js

This file was deleted.

Loading
Loading