Add support for HTML books#16
Conversation
Took 10 hours 1 minute
Took 47 minutes
Cleaned up scss Took 3 hours 22 minutes
Took 17 minutes
Took 4 minutes
Took 2 hours 15 minutes
Took 55 minutes
Took 1 hour 2 minutes
Took 29 minutes
Fixed page-material padding incorrectly applying to the title Took 10 minutes
Took 2 hours 27 minutes
Took 15 minutes
Took 26 minutes
Took 15 minutes
Took 41 minutes
|
Something important to note: I don't want to replace the existing picture based books with HTML ones. I would rather have both. The reason is the image ones are way more likely to be stable on the chance the HTML updater breaks in the future, and are way more likely to be accurate across devices. You will likely want a separate home page for HTML books vs image books, with links between the two as relevant. |
|
Would it be better for the HTML books to be the primary, and the image books to be the fallback in case of any issues? |
|
Neither is really primary or fallback. They are just different pages. The book index can link them both: Icon Key thing is I want to have both. I find images works very nicely on mobile notably. |
Took 59 minutes
Took 5 minutes
Took 1 hour 9 minutes
Took 7 seconds
Took 2 minutes
Took 31 minutes
Took 11 minutes Took 7 minutes
| margin-top: 0.25em; | ||
| } | ||
|
|
||
| .spacing { |
There was a problem hiding this comment.
What is the purpose of spacing? Name is a little generic for how specific of a number it provides.
There was a problem hiding this comment.
it was just easier to change the css than a style when figure out how much padding I needed
There was a problem hiding this comment.
Well, if its worth keeping name it something like book-spacing. If its no longer needed then lets clean it up.
tbh, anything that common shows up is probably worth a class over a style as that allows us to fix it without regenerating all the files.
There was a problem hiding this comment.
This can probably be replaced with CSS that just makes a 16x16 bit of padding. Though low priority to swap out.
| {%- endcapture -%} | ||
| <div class="uk-width uk-margin mc-font-black book-page-html"> | ||
| <img src="{{pagePath}}" alt=""/> | ||
| {% include book/{{include.book.path}}/page_{{pageIndex}}.html %} |
There was a problem hiding this comment.
The reason for the weird book paths is meant as a sort of cache buster for images. However, on the HTML pages that is not needed as those are not cached in the same way (if they are cached, doesn't matter where you fetch this from).
I guess the hard part is we don't really have another string to suggest the location to fetch these from. I'm inclined to say add a second string like include.book.html since that will save effort updating books in the future. The HTML can then just be stored under _book/tinkers/1.20/encyclopedia and alike. The _ before book ensures Jekyll doesn't generate pages for each html file, since they will not be usable directly.
Took 1 hour 2 minutes
Took 30 minutes
Took 12 minutes
Took 7 minutes
| } | ||
|
|
||
| .content-list-links { | ||
| > div { |
There was a problem hiding this comment.
this file needs to be scss to use sassy css features. Jekyll will compile that to CSS so you still reference it as .css elsewhere.
There was a problem hiding this comment.
what scss features does it use? looks like plain css to me
| @@ -0,0 +1,183 @@ | |||
| /** from https://minecraft.wiki/w/MediaWiki:common.css */ | |||
There was a problem hiding this comment.
Put this file in _sass and just include it in slimeknights.scss, like we do with treeview.
There was a problem hiding this comment.
Should also change the extension to scss as I believe its using scss features.
Took 16 minutes
Took 32 minutes
Took 27 minutes
Took 38 minutes
Took 1 hour 25 minutes
I think I'm pretty close to being done, so here's what I have. There's definitely even more that can be done, like the tooltips we talked about, but that will have to be for later.
Preview: https://paypur.github.io/docs/books/1.20/
Tinkers' PR: SlimeKnights/TinkersConstruct#5456
Mantle PR: SlimeKnights/Mantle#231
Notes
PageContent's should overridetoHTMLscale = 2, but this should be easy to change/mantle book export_htmlThe book "chapters" feel kinda redundant now that we can just link to a specific page on an imageStill TODOs
FixContentListings overflowingCompress the .png'sAdd back the previous page layout for old versionsFix issues on mobileRebase before we merge