diff --git a/_static/css/86box.css b/_static/css/86box.css index d7e7e9d..3f01c5e 100644 --- a/_static/css/86box.css +++ b/_static/css/86box.css @@ -55,8 +55,9 @@ div.bit-table > div.wy-table-responsive > table > thead > tr > th:not(.stub), di padding: 0; } -/* Toggle containers. */ -.toggle { +/* Toggle containers. toggle-always-show is a class that takes + on the look of a toggle container, but is always shown. */ +.toggle, .toggle-always-show { background: #f3f6f6; border: 1px solid #e1e4e5; padding: 1em; @@ -65,17 +66,45 @@ div.bit-table > div.wy-table-responsive > table > thead > tr > th:not(.stub), di .toggle-closed > .toggle-header, .toggle-open > .toggle-header { cursor: pointer; } -.toggle > .toggle-header > p { +@media screen { /* show toggle arrows on screen only */ + .toggle-closed > .toggle-header > p:before { + content: "\0025B6 "; + } + .toggle-open > .toggle-header > p:before { + content: "\0025BC "; + } +} +.toggle-header > p { font-weight: bold; margin-bottom: 0; } -.toggle > div:nth-child(2) { +.toggle > div:nth-child(2), .toggle-always-show > div:nth-child(2) { margin-top: 12px; margin-bottom: 0; } -.toggle-closed > .toggle-header > p:before { - content: "\0025B6 "; +@media screen { + .toggle-closed > div:nth-child(2) { + display: none; + } } -.toggle-open > .toggle-header > p:before { - content: "\0025BC "; +@media print { + .toggle-closed > div:nth-child(2) { + display: block !important; + } +} + +/* Print stuff. */ +@media print { + /* Allow page breaks in the middle of code. */ + pre { + break-inside: auto; + } + + /* Fix theme bug where code blocks have blank space at the end. */ + .rst-content div[class^=highlight] { + white-space: nowrap; + } + div[class*="highlight-"] { + white-space: pre-wrap; + } } diff --git a/_static/js/86box.js b/_static/js/86box.js index b806184..2ce4914 100644 --- a/_static/js/86box.js +++ b/_static/js/86box.js @@ -1,14 +1,13 @@ /* Toggle containers, modified from: https://stackoverflow.com/questions/2454577/sphinx-restructuredtext-show-hide-code-snippets */ $(document).ready(function() { /* Hide all toggle containers. */ - $('.toggle').children().not('.toggle-header').hide(); $('.toggle').toggleClass('toggle-closed'); /* Add click handlers for the header. */ - $('.toggle-header').click(function() { + $('.toggle > .toggle-header').click(function() { /* Toggle the container. */ $(this).parent().children().not('.toggle-header').toggle(400); - $(this).parent().toggleClass('toggle-open toggle-closed'); + $(this).parent().toggleClass('toggle-open toggle-closed'); }); /* Fix scroll position if a heading is provided in the URL. diff --git a/hardware/network.rst b/hardware/network.rst index 6fbdaf8..a218292 100644 --- a/hardware/network.rst +++ b/hardware/network.rst @@ -56,12 +56,16 @@ MAC address With the exception of **[LPT] Parallel Port Internet Protocol**, every emulated network card stores its MAC address in the ``mac`` directive of its respective configuration file section. Only the suffix (last three octets) of the MAC address can be edited; the prefix (first three octets) will always be the card manufacturer's `Organizationally Unique Identifier `_, such as 00:E0:4C for Realtek. -.. rubric:: Example: MAC address 00:E0:4C:35:F4:C2 for the Realtek RTL8029AS +.. container:: toggle-always-show -.. code-block:: none + .. container:: toggle-header - [Realtek RTL8029AS] - mac = 35:f4:c2 + Example: MAC address 00:E0:4C:35:F4:C2 for the Realtek RTL8029AS + + .. code-block:: none + + [Realtek RTL8029AS] + mac = 35:f4:c2 SLiRP port forwarding ^^^^^^^^^^^^^^^^^^^^^ @@ -78,12 +82,16 @@ The host system can access forwarded ports through 127.0.0.1 or its own IP addre .. note:: The emulated machine's IP address must be set to 10.0.2.15 (the default IP provided through DHCP) for port forwarding to work. -.. rubric:: Example: forward host TCP port 8080 to emulated machine port 80, and host UDP port 5555 to emulated machine port 5555 +.. container:: toggle-always-show -.. code-block:: none - - [SLiRP Port Forwarding] - 0_external = 8080 - 0_internal = 80 - 1_protocol = udp - 1_external = 5555 \ No newline at end of file + .. container:: toggle-header + + Example: forward host TCP port 8080 to emulated machine port 80, and host UDP port 5555 to emulated machine port 5555 + + .. code-block:: none + + [SLiRP Port Forwarding] + 0_external = 8080 + 0_internal = 80 + 1_protocol = udp + 1_external = 5555