#+title: How this site worksthe primary function to use is =htmlize-buffer=. the equivalent for files does not do syntax highlighting, sadly. So, we have to open a file in its buffer, fix all the links without saving, export that html into a _new_ buffer, and save /that/ to its final resting place. Seems simple enough right?
*wrong*
at least, the way i've been handling it as an outgrowth of my vimwiki imitation hastn't quite worked yet, at least not all the way thru. in fact, im writing this out in ordr to simplify the task and thereby solve my issues with this project.
Time to work on hyperbole!
*** just kidding it might have been important
while assembling my hyperbole stuff, i realized that my approach of just turning say =word= into =[[word.org][word]]= is pretty flawed. much better to make it into =[[/architecture/site/word/][word]]= that way when it exports you don't get name.html... and that export would then have to be like =[[word/][word]]= and that's fine but it raises the question of what to do when a sub-article references another word - that's awhat happens when i made the word "checked" in the hyperbole page a link. does it go to /checked/index.html? maybe /hyperbole/checked.html? obviously neither of those are correct. should be /hyperbole/checked/index.html !
im going to try being slightly more robust, and in the lead-up to that i figure may as well add the dreaded /export folder/...
okay we gotta rewrite a whole bunch of stuff
... and done!
code at mirwiki.el
:3
okay now i wanna use =org-indent-mode=, which basically creates wider margins on more nested headings. it's nice for visual hierarchy, but htmlize doesn't seem to support it directly... so that's a small bummer
perhaps i can add it back in somehow using the function =org-outline-level= ? infiltrating htmlize's processing loop is probably the tricky part of that.
screw this. might be easier to just uh.. mine all possible css from the htmlize of an org file with all the markups. then export the orgs more normally? like ugh but i want more actual structure than htmlize is willing to give
*** a new approach to structure
Thank you @zyd! per https://tenforward.social/@zyd/113026816328040914 im going to be adding a pass to =mirwiki-export-file= and then alongside =mir/customize-css= and =mir/fix-page-title=!
well that's done, it took a few tries to to figure out (ended up sticking tons of ~%org-level-0%~ all over everything in the meantime) but it's fine now.
this is, however, one of those things that i really wish didn't need such a hacky solution. like this was the best way to do it and consisted of looping over two different buffers making procedural line by line changes.
irregardless, it works now, mostly.
*** Custom css and buttons
**** custom css
you may notice that a large part of mirwiki.el sets custom css. this i have injected into the =<style>= block in the html header for each page. globally sourcing it might be better, but i refuse to bother with that for now.
**** 88x31 buttons for my friends
at the bottom of the root index and nowhere else, there are buttons for cool entities. these are added with some simple programmatic html injection: the plist for each button is declared in elisp, the function =mir/render-88x31-from-plist= expands that into a html image link, and we iterate thru each of them in the footer.
you may notice an additional section for cool concepts, which has not yet been populated. hatsune miku, piracy, and the like will probably end up here eventually.
* a looming worry
someone said once that every website should have a light mode as well as a dark mode, in case some readers prefer that, for accessibilty reasons. this is a good idea, but my current method of styling, based purely on copying its actual appearance in Emacs, is insufficient for such a requirement.
in order to do this properly, i probably must
- come up with one big css file of all the org faces that actually get exported,
- export that in a dark and a light theme,
- in generated pages, rip out the initial css and replace it with a smart link to said css file,
- make sure both themes work with the style im going for and that it actually takes browser's preference into account.