docs - support prism and reorder some TOC

This commit is contained in:
Cody Glassman 2025-06-20 10:42:35 -07:00
parent 79f18effdd
commit 3bdf57f7c1
11 changed files with 386 additions and 78 deletions

View File

@ -2,34 +2,15 @@
font-family: 'JetBrains Mono', monospace; font-family: 'JetBrains Mono', monospace;
} }
#luadoc pre.example {
background-color: hsl(var(--accent)) !important;
padding: 10px;
margin: 10px 0 10px 0;
overflow-x: auto;
}
#luadoc pre.example code { #luadoc pre.example code {
color: black;
background-color: hsl(var(--accent)) !important;
border: none;
white-space: pre; white-space: pre;
padding: 0px;
} }
@media (prefers-color-scheme: dark) { #luadoc code:not([class*="language-"]) {
#luadoc pre.example,
#luadoc pre.example code {
background-color: hsl(var(--muted));
color: #ffffff;
}
}
#luadoc code {
background-color: unset; background-color: unset;
} }
#luadoc pre { #luadoc pre:not([class*="language-"]) {
background-color: inherit; background-color: inherit;
color: inherit; color: inherit;
border: none; border: none;

View File

@ -0,0 +1,156 @@
@media (prefers-color-scheme: dark) {
/**
* Github Dark theme for Prism.js
* Based on Github: https://github.com
* @author Katorly
*/
/* General */
pre[class*="language-"],
code[class*="language-"] {
color: #c9d1d9;
font-size: 13px;
text-shadow: none;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::selection,
code[class*="language-"]::selection,
pre[class*="language-"]::mozselection,
code[class*="language-"]::mozselection {
text-shadow: none;
background: #234879;
}
@media print {
pre[class*="language-"],
code[class*="language-"] {
text-shadow: none;
}
}
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
background: #161b22;
}
:not(pre)>code[class*="language-"] {
padding: .1em .3em;
border-radius: .3em;
color: #c9d1d9;
background: #343942;
}
/* Line highlighting */
pre[data-line] {
position: relative;
}
pre[class*="language-"]>code[class*="language-"] {
position: relative;
z-index: 1;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em;
background: #2f2a1e;
box-shadow: inset 5px 0 0 #674c16;
z-index: 0;
pointer-events: none;
line-height: inherit;
white-space: pre;
}
/* Tokens */
.namespace {
opacity: .7;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #8b949e;
}
.token.punctuation {
color: #c9d1d9;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #79c0ff;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a5d6ff;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a5d6ff;
background: #161b22;
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #a5d6ff;
}
.token.function {
color: #d2a8ff;
}
.token.regex,
.token.important,
.token.variable {
color: #a8daff;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
}

View File

@ -0,0 +1,152 @@
/**
* Github Light theme for Prism.js
* Based on Github: https://github.com
* @author Katorly
*/
/* General */
pre[class*="language-"],
code[class*="language-"] {
color: #24292f;
font-size: 13px;
text-shadow: none;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::selection,
code[class*="language-"]::selection,
pre[class*="language-"]::mozselection,
code[class*="language-"]::mozselection {
text-shadow: none;
background: #9fc6e9;
}
@media print {
pre[class*="language-"],
code[class*="language-"] {
text-shadow: none;
}
}
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
background: #f6f8fa;
}
:not(pre)>code[class*="language-"] {
padding: .1em .3em;
border-radius: .3em;
color: #24292f;
background: #eff1f3;
}
/* Line highlighting */
pre[data-line] {
position: relative;
}
pre[class*="language-"]>code[class*="language-"] {
position: relative;
z-index: 1;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em;
background: #fff8c5;
box-shadow: inset 5px 0 0 #eed888;
z-index: 0;
pointer-events: none;
line-height: inherit;
white-space: pre;
}
/* Tokens */
.namespace {
opacity: .7;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #6e7781;
}
.token.punctuation {
color: #24292f;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #0550ae;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #0a3069;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #0550ae;
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #cf222e;
}
.token.function {
color: #8250df;
}
.token.regex,
.token.important,
.token.variable {
color: #0a3069;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

File diff suppressed because one or more lines are too long

View File

@ -53,11 +53,17 @@
} }
#content .highlight { #content .highlight {
background-color: hsl(var(--accent)) !important; background-color: #f6f8fa !important;
border-radius: 0.25rem; border-radius: 0.25rem;
font-variant-ligatures: none; font-variant-ligatures: none;
} }
@media (prefers-color-scheme: dark) {
#content .highlight {
background-color: #161b22 !important;
}
}
/* Disables the saturation filter on project icon in dark mode */ /* Disables the saturation filter on project icon in dark mode */
.dark\:invert { .dark\:invert {
--tw-invert: none !important; --tw-invert: none !important;

View File

@ -168,10 +168,16 @@ html_theme_options = asdict(ThemeOptions(
html_permalinks_icon = Icons.permalinks_icon html_permalinks_icon = Icons.permalinks_icon
html_js_files = [
'prism.js'
]
html_css_files = [ html_css_files = [
"theme-override.css", "theme-override.css",
"luadoc.css", "luadoc.css",
"figures.css" "figures.css",
"prism.css",
"prism-dark.css",
] ]
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.

View File

@ -33,7 +33,7 @@ PATH=$PATH:~/luarocks/bin
echo "Install openmwluadocumentor" echo "Install openmwluadocumentor"
git clone https://gitlab.com/ptmikheev/openmw-luadocumentor.git git clone https://gitlab.com/ptmikheev/openmw-luadocumentor.git
cd openmw-luadocumentor cd openmw-luadocumentor
git checkout c3252620eb5f6cd740dadfcb374a20b23b36f1fd git checkout 122e4f55c5f2dd62076135211e03edfb8dec3a55
luarocks make luarocks/openmwluadocumentor-0.2.0-1.rockspec luarocks make luarocks/openmwluadocumentor-0.2.0-1.rockspec
cd ~ cd ~
rm -r openmw-luadocumentor rm -r openmw-luadocumentor

View File

@ -12,13 +12,13 @@ Interfaces
Animation <interface_animation> Animation <interface_animation>
Camera <interface_camera> Camera <interface_camera>
Controls <interface_controls> Controls <interface_controls>
Crimes <interface_crimes>
GamepadControls <interface_gamepadcontrols> GamepadControls <interface_gamepadcontrols>
ItemUsage <interface_item_usage> ItemUsage <interface_item_usage>
MWUI <interface_mwui> MWUI <interface_mwui>
Settings <interface_settings> Settings <interface_settings>
SkillProgression <interface_skill_progression> SkillProgression <interface_skill_progression>
UI <interface_ui> UI <interface_ui>
Crimes <interface_crimes>
**Interfaces of built-in scripts** **Interfaces of built-in scripts**

View File

@ -8,12 +8,12 @@
* - :doc:`calendar </reference/lua-scripting/openmw_aux_calendar>` * - :doc:`calendar </reference/lua-scripting/openmw_aux_calendar>`
- |bdg-ctx-all| - |bdg-ctx-all|
- Game time calendar - Game time calendar
* - :doc:`util </reference/lua-scripting/openmw_aux_util>`
- |bdg-ctx-all|
- Miscellaneous utils
* - :doc:`time </reference/lua-scripting/openmw_aux_time>` * - :doc:`time </reference/lua-scripting/openmw_aux_time>`
- |bdg-ctx-all| - |bdg-ctx-all|
- Timers and game time utils - Timers and game time utils
* - :doc:`ui </reference/lua-scripting/openmw_aux_ui>` * - :doc:`ui </reference/lua-scripting/openmw_aux_ui>`
- |bdg-ctx-menu| |bdg-ctx-player| - |bdg-ctx-menu| |bdg-ctx-player|
- User interface utils - User interface utils
* - :doc:`util </reference/lua-scripting/openmw_aux_util>`
- |bdg-ctx-all|
- Miscellaneous utils

View File

@ -8,36 +8,36 @@
* - :doc:`Activation </reference/lua-scripting/interface_activation>` * - :doc:`Activation </reference/lua-scripting/interface_activation>`
- |bdg-ctx-global| - |bdg-ctx-global|
- Allows to extend or override built-in activation mechanics. - Allows to extend or override built-in activation mechanics.
* - :doc:`ItemUsage </reference/lua-scripting/interface_item_usage>`
- |bdg-ctx-global|
- Allows to extend or override built-in item usage mechanics.
* - :doc:`Crimes </reference/lua-scripting/interface_crimes>`
- |bdg-ctx-global|
- Commit crimes.
* - :doc:`AI </reference/lua-scripting/interface_ai>` * - :doc:`AI </reference/lua-scripting/interface_ai>`
- |bdg-ctx-local| - |bdg-ctx-local|
- Control basic AI of NPCs and creatures. - Control basic AI of NPCs and creatures.
* - :doc:`AnimationController </reference/lua-scripting/interface_animation>` * - :doc:`AnimationController </reference/lua-scripting/interface_animation>`
- |bdg-ctx-local| - |bdg-ctx-local|
- Control animations of NPCs and creatures. - Control animations of NPCs and creatures.
* - :doc:`SkillProgression </reference/lua-scripting/interface_skill_progression>`
- |bdg-ctx-local|
- Control, extend, and override skill progression of the player.
* - :doc:`Camera </reference/lua-scripting/interface_camera>` * - :doc:`Camera </reference/lua-scripting/interface_camera>`
- |bdg-ctx-player| - |bdg-ctx-player|
- Allows to alter behavior of the built-in camera script without overriding the script completely. - Allows to alter behavior of the built-in camera script without overriding the script completely.
* - :doc:`Controls </reference/lua-scripting/interface_controls>` * - :doc:`Controls </reference/lua-scripting/interface_controls>`
- |bdg-ctx-player| - |bdg-ctx-player|
- Allows to alter behavior of the built-in script that handles player controls. - Allows to alter behavior of the built-in script that handles player controls.
* - :doc:`Crimes </reference/lua-scripting/interface_crimes>`
- |bdg-ctx-global|
- Commit crimes.
* - :doc:`GamepadControls </reference/lua-scripting/interface_gamepadcontrols>` * - :doc:`GamepadControls </reference/lua-scripting/interface_gamepadcontrols>`
- |bdg-ctx-player| - |bdg-ctx-player|
- Allows to alter behavior of the built-in script that handles player gamepad controls. - Allows to alter behavior of the built-in script that handles player gamepad controls.
* - :doc:`UI </reference/lua-scripting/interface_ui>` * - :doc:`ItemUsage </reference/lua-scripting/interface_item_usage>`
- |bdg-ctx-player| - |bdg-ctx-global|
- High-level UI modes interface. Allows to override parts of the interface. - Allows to extend or override built-in item usage mechanics.
* - :doc:`Settings </reference/lua-scripting/interface_settings>`
- |bdg-ctx-global| |bdg-ctx-menu| |bdg-ctx-player|
- Save, display and track changes of setting values.
* - :doc:`MWUI </reference/lua-scripting/interface_mwui>` * - :doc:`MWUI </reference/lua-scripting/interface_mwui>`
- |bdg-ctx-menu| |bdg-ctx-player| - |bdg-ctx-menu| |bdg-ctx-player|
- Morrowind-style UI templates. - Morrowind-style UI templates.
* - :doc:`Settings </reference/lua-scripting/interface_settings>`
- |bdg-ctx-global| |bdg-ctx-menu| |bdg-ctx-player|
- Save, display and track changes of setting values.
* - :doc:`SkillProgression </reference/lua-scripting/interface_skill_progression>`
- |bdg-ctx-local|
- Control, extend, and override skill progression of the player.
* - :doc:`UI </reference/lua-scripting/interface_ui>`
- |bdg-ctx-player|
- High-level UI modes interface. Allows to override parts of the interface.

View File

@ -5,24 +5,51 @@
* - Package * - Package
- Context - Context
- Description - Description
* - :doc:`core </reference/lua-scripting/openmw_core>` * - :doc:`ambient </reference/lua-scripting/openmw_ambient>`
- |bdg-ctx-all| - |bdg-ctx-menu| |bdg-ctx-player|
- Functions that are common for both global and local scripts - Controls background sounds for given player.
* - :doc:`animation </reference/lua-scripting/openmw_animation>`
- |bdg-ctx-local|
- Animation controls
* - :doc:`async </reference/lua-scripting/openmw_async>` * - :doc:`async </reference/lua-scripting/openmw_async>`
- |bdg-ctx-all| - |bdg-ctx-all|
- Timers and callbacks. - Timers and callbacks.
* - :ref:`interfaces <Script interfaces>` * - :doc:`camera </reference/lua-scripting/openmw_camera>`
- |bdg-ctx-player|
- Controls camera.
* - :doc:`core </reference/lua-scripting/openmw_core>`
- |bdg-ctx-all| - |bdg-ctx-all|
- Public interfaces of other scripts. - Functions that are common for both global and local scripts
* - :doc:`debug </reference/lua-scripting/openmw_debug>`
- |bdg-ctx-player|
- Collection of debug utils.
* - :doc:`input </reference/lua-scripting/openmw_input>`
- |bdg-ctx-menu| |bdg-ctx-player|
- User input.
* - :doc:`markup </reference/lua-scripting/openmw_markup>` * - :doc:`markup </reference/lua-scripting/openmw_markup>`
- |bdg-ctx-all| - |bdg-ctx-all|
- API to work with markup languages. - API to work with markup languages.
* - :doc:`menu </reference/lua-scripting/openmw_menu>`
- |bdg-ctx-menu|
- Main menu functionality, such as managing game saves
* - :doc:`nearby </reference/lua-scripting/openmw_nearby>`
- |bdg-ctx-local|
- Read-only access to the nearest area of the game world.
* - :doc:`postprocessing </reference/lua-scripting/openmw_postprocessing>`
- |bdg-ctx-player|
- Controls post-process shaders.
* - :doc:`self </reference/lua-scripting/openmw_self>`
- |bdg-ctx-local|
- Full access to the object the script is attached to.
* - :doc:`storage </reference/lua-scripting/openmw_storage>` * - :doc:`storage </reference/lua-scripting/openmw_storage>`
- |bdg-ctx-all| - |bdg-ctx-all|
- Storage API. In particular can be used to store data between game sessions. - Storage API. In particular can be used to store data between game sessions.
* - :doc:`types </reference/lua-scripting/openmw_types>` * - :doc:`types </reference/lua-scripting/openmw_types>`
- |bdg-ctx-all| - |bdg-ctx-all|
- Functions for specific types of game objects. - Functions for specific types of game objects.
* - :doc:`ui </reference/lua-scripting/openmw_ui>`
- |bdg-ctx-menu| |bdg-ctx-player|
- Controls :ref:`user interface <UI reference>`.
* - :doc:`util </reference/lua-scripting/openmw_util>` * - :doc:`util </reference/lua-scripting/openmw_util>`
- |bdg-ctx-all| - |bdg-ctx-all|
- Defines utility functions and classes like 3D vectors, that don't depend on the game world. - Defines utility functions and classes like 3D vectors, that don't depend on the game world.
@ -32,33 +59,6 @@
* - :doc:`world </reference/lua-scripting/openmw_world>` * - :doc:`world </reference/lua-scripting/openmw_world>`
- |bdg-ctx-global| - |bdg-ctx-global|
- Read-write access to the game world. - Read-write access to the game world.
* - :doc:`menu </reference/lua-scripting/openmw_menu>` * - :ref:`interfaces <Script interfaces>`
- |bdg-ctx-menu| - |bdg-ctx-all|
- Main menu functionality, such as managing game saves - Public interfaces of other scripts.
* - :doc:`animation </reference/lua-scripting/openmw_animation>`
- |bdg-ctx-local|
- Animation controls
* - :doc:`nearby </reference/lua-scripting/openmw_nearby>`
- |bdg-ctx-local|
- Read-only access to the nearest area of the game world.
* - :doc:`self </reference/lua-scripting/openmw_self>`
- |bdg-ctx-local|
- Full access to the object the script is attached to.
* - :doc:`camera </reference/lua-scripting/openmw_camera>`
- |bdg-ctx-player|
- Controls camera.
* - :doc:`debug </reference/lua-scripting/openmw_debug>`
- |bdg-ctx-player|
- Collection of debug utils.
* - :doc:`postprocessing </reference/lua-scripting/openmw_postprocessing>`
- |bdg-ctx-player|
- Controls post-process shaders.
* - :doc:`ambient </reference/lua-scripting/openmw_ambient>`
- |bdg-ctx-menu| |bdg-ctx-player|
- Controls background sounds for given player.
* - :doc:`input </reference/lua-scripting/openmw_input>`
- |bdg-ctx-menu| |bdg-ctx-player|
- User input.
* - :doc:`ui </reference/lua-scripting/openmw_ui>`
- |bdg-ctx-menu| |bdg-ctx-player|
- Controls :ref:`user interface <UI reference>`.