My aggregated monorepo of OCaml code, automaintained
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix margin-note CSS not loading

The inline-extensions CSS (margin-note, kbd) was registered as a
separate support file (extensions/inline-extensions.css) but the
shell's page <link> only referenced extensions/jon-shell.css — so
margin notes rendered with no styling.

Fix: concatenate inline_extensions_css into the jon-shell.css support
file at registration time. The shell's existing <link> now picks up
both the shell styles and the inline-extension styles in one request.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+11 -10
+11 -10
odoc-jons-plugins/src/odoc_jons_plugins.ml
··· 6 6 module Url = Odoc_document.Url 7 7 8 8 (* Register CSS and JS as support files *) 9 + (* The jon-shell.css support file is registered later, after all 10 + stylesheet fragments (including the inline-extension CSS for 11 + {&margin}, {&kbd}, etc.) are in scope so we can concatenate 12 + everything into one file that the page's <link> already pulls. *) 13 + 9 14 let () = 10 - Odoc_extension_registry.register_support_file ~prefix:"jon-shell" 11 - { 12 - filename = "extensions/jon-shell.css"; 13 - content = Inline Odoc_jons_plugins_css.css; 14 - }; 15 15 Odoc_extension_registry.register_support_file ~prefix:"jon-shell" 16 16 { 17 17 filename = "extensions/jon-shell.js"; ··· 977 977 Api.Registry.register_inline (module Kbd); 978 978 Api.Registry.register_inline (module Image_inline); 979 979 Api.Registry.register_inline (module Linked_image_inline); 980 - (* Inline extensions don't have a per-page resource hook; ship their 981 - CSS via the shell plugin's support-file mechanism so it is 982 - available wherever the shell runs. *) 980 + (* Now that inline_extensions_css is in scope, register 981 + jon-shell.css with the combined stylesheet — the shell's page 982 + <link> already references this file, so no per-page hook needed. *) 983 983 Odoc_extension_registry.register_support_file ~prefix:"jon-shell" 984 984 { 985 - filename = "extensions/inline-extensions.css"; 986 - content = Inline inline_extensions_css; 985 + filename = "extensions/jon-shell.css"; 986 + content = Inline 987 + (Odoc_jons_plugins_css.css ^ "\n" ^ inline_extensions_css); 987 988 } 988 989 989 990 (* --- Recent posts extension --- *)