From 48bfdb243b45351086e7fcb3d706c1b3dd7d5cd9 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 19 Mar 2022 16:04:12 -0300 Subject: [PATCH] Move custom CSS and default highlight language away from include.rst --- _static/css/86box.css | 48 +++++++++++++++++++++++++++++++++++++++++++ conf.py | 8 +++++++- dev/api/device.rst | 4 +--- dev/api/dma.rst | 2 -- dev/api/io.rst | 2 -- dev/api/thread.rst | 2 -- dev/api/timer.rst | 2 -- include.rst | 40 ------------------------------------ usage/menubar.rst | 2 -- 9 files changed, 56 insertions(+), 54 deletions(-) create mode 100644 _static/css/86box.css diff --git a/_static/css/86box.css b/_static/css/86box.css new file mode 100644 index 0000000..f2af5bd --- /dev/null +++ b/_static/css/86box.css @@ -0,0 +1,48 @@ +/* Give some spacing to icons in headings. */ +h1 > img { + padding-right: 5px; +} +h2 > img { + padding-right: 5px; +} + +/* Remove bottom spacing from lists in tables and admonitions. */ +table.docutils > tbody > tr > td > ul, table.docutils > tbody > tr > td > ol { + margin-bottom: 0 !important; +} +div.admonition > p:nth-child(2) { + margin-bottom: 0; +} + +/* Avoid horizontal scrolling of API documentation tables. */ +.wy-table-responsive table td { + white-space: normal; +} + +/* Make API documentation table titles normal-monospace, and give them less spacing. */ +.rst-content table.docutils caption { + padding-top: 0; + font-family: monospace; + font-style: normal; +} + +/* Fix font size for lists in table cells. */ +table.docutils > tbody > tr > td > ul > li > p, table.docutils > tbody > tr > td > ol > li > p { + font-size: inherit; +} + +/* Tweak top and bottom spacing for tables in table cells. */ +table.docutils > tbody > tr > td > div.wy-table-responsive { + margin-top: 0.5em; + margin-bottom: 0; +} + +/* Fix odd row background on tables in table cells. */ +tr.row-odd > td { + background-color: #fcfcfc !important; +} + +/* Vertical text for tables. */ +div.vertical-text { + transform: rotate(270deg); +} diff --git a/conf.py b/conf.py index aaa7589..151c435 100644 --- a/conf.py +++ b/conf.py @@ -55,4 +55,10 @@ html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] \ No newline at end of file +html_static_path = ['_static'] + +html_css_files = [ + 'css/86box.css', +] + +highlight_language = 'c' diff --git a/dev/api/device.rst b/dev/api/device.rst index 4e6cafb..bfe4608 100644 --- a/dev/api/device.rst +++ b/dev/api/device.rst @@ -1,5 +1,3 @@ -.. include:: /include.rst - Devices ======= @@ -113,7 +111,7 @@ Most devices need a place to store their internal state. We discourage the use o typedef struct { uint32_t type; /* example: copied from device_t.local */ - uint8_t regs[256]; /* example: 256*8-bit registers */ + uint8_t regs[256]; /* example: 256*8-bit registers */ } foo_t; /* ... */ diff --git a/dev/api/dma.rst b/dev/api/dma.rst index 5a9abd4..0fe81bc 100644 --- a/dev/api/dma.rst +++ b/dev/api/dma.rst @@ -1,5 +1,3 @@ -.. include:: /include.rst - DMA === diff --git a/dev/api/io.rst b/dev/api/io.rst index eb17100..0111545 100644 --- a/dev/api/io.rst +++ b/dev/api/io.rst @@ -1,5 +1,3 @@ -.. include:: /include.rst - Port I/O ======== diff --git a/dev/api/thread.rst b/dev/api/thread.rst index 6efe36e..07bc2b1 100644 --- a/dev/api/thread.rst +++ b/dev/api/thread.rst @@ -1,5 +1,3 @@ -.. include:: /include.rst - Threads ======= diff --git a/dev/api/timer.rst b/dev/api/timer.rst index fdbb364..3ead940 100644 --- a/dev/api/timer.rst +++ b/dev/api/timer.rst @@ -1,5 +1,3 @@ -.. include:: /include.rst - Timers ====== diff --git a/include.rst b/include.rst index 48505bd..1ec2de8 100644 --- a/include.rst +++ b/include.rst @@ -54,43 +54,3 @@ .. |storage_controllers_small| image:: /usage/images/storage_controllers_small.png .. |zip| image:: /usage/images/zip.png .. |zip_small| image:: /usage/images/zip_small.png - -.. raw:: html - - - -.. highlight:: c diff --git a/usage/menubar.rst b/usage/menubar.rst index 7c74c01..9447b90 100644 --- a/usage/menubar.rst +++ b/usage/menubar.rst @@ -1,5 +1,3 @@ -.. include:: /include.rst - Menu bar ========