Use evil CSS tricks to fix wiki books looking awful (#94738)

## About The Pull Request

The [MediaWiki "printable" version of pages][p] was at some point
deprecated in favor of standard print stylesheets, making wiki books
look rather ugly, even uglier than if they weren't using the parameter.
However, there seems to be no way to command an iframe to opt in to or
simulate the print stylesheet. What we really want is to suppress the
sidebar and header. Therefore: position the iframe off of the page to
the left and top by the size of the elements we want to hide.

Hiding the left sidebar seems fully clean. However, hiding the top
header also hides the first bit of the scrollbar, which is a little
odd-looking.

Also, fix wiki books not giving book nerd moodlets.

[p]: https://wiki.tgstation13.org/Guide_to_drinks?printable=yes

Before:
<img width="984" height="790" alt="SS13 wiki book before"
src="https://github.com/user-attachments/assets/1eb6e961-bc35-418b-a015-868d7269e2f5"
/>

After:
<img width="985" height="752" alt="SS13 wiki book after"
src="https://github.com/user-attachments/assets/39a63ad3-bc99-4c71-a5e7-ff06ae1b6852"
/>

## Why It's Good For The Game

Less offensively ugly UI.

## Changelog
🆑
fix: Wiki books such as "Barman Recipes" and "Space Law" no longer have
terrible formatting.
fix: Wiki books now properly give book nerd moodlets.
/🆑
This commit is contained in:
Tad Hardesty
2026-01-06 17:37:29 -05:00
committed by GitHub
parent 2fadefe6a5
commit ddc7bfa4c4
3 changed files with 33 additions and 21 deletions
+1 -1
View File
@@ -86,7 +86,6 @@
/// Proc that handles sending the book information to the user, as well as some housekeeping stuff.
/obj/item/book/proc/display_content(mob/living/user)
credit_book_to_reader(user)
ui_interact(user)
/// Proc that checks if the user is capable of reading the book, for UI interactions and otherwise. Returns TRUE if they can, FALSE if they can't.
@@ -125,6 +124,7 @@
return
user.visible_message(span_notice("[user] opens a book titled \"[book_data.title]\" and begins reading intently."))
credit_book_to_reader(user)
display_content(user)
/obj/item/book/proc/is_carving_tool(obj/item/tool)