-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Add light-theme and use users preferred theme #268
Conversation
Amazing! It seems fitting to review it on stream tomorrow, then! Thank you! |
Also removed the shadow on the <h1> element. It was probably left over from an early version of the dark theme, before Dream's alpha 1 release.
Success 🎉
✅ `soupault` not foundSolved by running ❯ make docs
make -C docs/web --no-print-directory
dune build @doc --root ../.. --no-print-directory --build-dir `pwd`/odoc \
--only-packages dream-pure,dream-httpaf,dream
rm -f site/index.html
dune exec -- postprocess/index.exe \
odoc/default/_doc/_html/dream/Dream/index.html site/index.html
Entering directory '/Users/ekander/dev/oss/dream'
Done: 50% (6/12, 6 left) (jobs: 0)rm -f site/status/index.html
soupault
Error: Program "soupault" not found! <-- Error is here
make[1]: *** [build] Error 1
make: *** [docs] Error 2 ✅ odoc version mismatchEDIT 3: I think I'm close, but it fails with an exception from an assertion in Solved by running ❯ make docs
make -C docs/web --no-print-directory
dune build @doc --root ../.. --no-print-directory --build-dir `pwd`/odoc \
--only-packages dream-pure,dream-httpaf,dream
rm -f site/index.html
dune exec -- postprocess/index.exe \
odoc/default/_doc/_html/dream/Dream/index.html site/index.html
Entering directory '/Users/ekander/dev/oss/dream'
Done: 50% (6/12, 6 left) (jobs: 0)Fatal error: exception Failure("Mismatch; wrote /Users/ekander/dev/oss/dream/docs/web/actual")
make[1]: *** [build] Error 2
make: *** [docs] Error 2 ✅ Opam Switch + Sub-modulesEDIT 2: I then ran into the following issue upon running [ERROR] Package conflict!
* No agreement on the version of ocaml-base-compiler:
- (invariant) → ocaml-base-compiler = 4.14.0
- web → ocaml-base-compiler = 4.14.1
You can temporarily relax the switch invariant with
`--update-invariant' Which I found a bit confusing, because when running [NOTE] Current switch has been selected based on the current
directory.
The current global system switch is 4.14.1. And so I followed the alternative instruction which seems to have done the trick: ❯ opam install --deps-only . --locked --update-invariant Lastly(?), I then hit the following error which I have not yet resolved ❯ make docs
make -C docs/web --no-print-directory
dune build @doc --root ../.. --no-print-directory --build-dir `pwd`/odoc \
--only-packages dream-pure,dream-httpaf,dream
File "src/vendor/gluten/lwt-unix/_unknown_", line 1, characters 0-0:
Error: No rule found for src/vendor/gluten/lwt-unix/ssl_io.real.ml
File "src/vendor/gluten/lwt-unix/_unknown_", line 1, characters 0-0:
Error: No rule found for src/vendor/gluten/lwt-unix/tls_io.dummy.ml
File "src/vendor/httpaf/lib/httpaf.mli", line 46, characters 0-11:
46 | open Result
^^^^^^^^^^^
Error (warning 33 [unused-open]): unused open Stdlib.Result.
File "src/vendor/gluten/lwt/gluten_lwt_intf.ml", line 63, characters 19-33:
63 | -> protocol:'t Gluten.runtime
^^^^^^^^^^^^^^
Error: Unbound module Gluten
File "src/vendor/httpaf/lib/reqd.ml", line 235, characters 31-44:
235 | let try_with t f : (unit, exn) Result.result =
^^^^^^^^^^^^^
Error: Unbound type constructor Result.result
make[1]: *** [build] Error 1
make: *** [docs] Error 2 ✅ OpenSSLEDIT: Oops. Seems like I hadn't actually installed in on this machine. I ran into this issue upon running ❯ opam install --deps-only ./dream.opam --with-test
The following actions will be performed:
∗ install conf-libssl 4
∗ install ssl 0.5.13
∗ install lwt_ssl 1.2.0
∗ install dream-httpaf 1.0.0~alpha2
===== ∗ 4 =====
Do you want to continue? [Y/n] y
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
⬇ retrieved ssl.0.5.13 (cached)
⬇ retrieved lwt_ssl.1.2.0 (cached)
⬇ retrieved dream-httpaf.1.0.0~alpha2 (cached)
[ERROR] The compilation of conf-libssl.4 failed at "sh -ex ./homebrew.sh check".
#=== ERROR while compiling conf-libssl.4 ======================================#
# context 2.1.4 | macos/x86_64 | ocaml-base-compiler.4.12.0 | https://opam.ocaml.org#88362781
# path ~/dev/oss/dream/_opam/.opam-switch/build/conf-libssl.4
# command ~/.opam/opam-init/hooks/sandbox.sh build sh -ex ./homebrew.sh check
# exit-code 1
# env-file ~/.opam/log/conf-libssl-46563-ea0c79.env
# output-file ~/.opam/log/conf-libssl-46563-ea0c79.out
### output ###
# ++ brew --prefix openssl
# + brew_pkg_config=/usr/local/opt/openssl@3/lib/pkgconfig
# + case "$1" in
# + test 1 '!=' 1
# + export PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig:/Users/ekander/dev/oss/dream/_opam/lib/pkgconfig:
# + PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig:/Users/ekander/dev/oss/dream/_opam/lib/pkgconfig:
# + pkg-config --print-errors --exists openssl
# Package openssl was not found in the pkg-config search path.
# Perhaps you should add the directory containing `openssl.pc'
# to the PKG_CONFIG_PATH environment variable
# No package 'openssl' found
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build conf-libssl 4
└─
╶─ No changes have been performed |
The docs error is a mismatch during the rewriting of the docs (fixing up odoc's output). Are you on odoc 2.0.2? The switch has to be less than 5.0.0, because odoc 2.0.2's deps are incompatible with 5.0.0 IIRC. So I use 4.14.1. You shouldn't have to do It looks like you solved the submodule issue. Not sure what is still left not working. OpenSSL? |
I better add some notes to CONTRIBUTING.md. |
Ah, right. Let me try that! 🙂 EDIT: I'm on odoc
Yeah, I'm not too familiar with Opam, but as far as I could tell, I was using
All solved except for the probable odoc mismatch! |
Was definitely not meant as critique, just thought it'd be helpful to myself and others to document any issues! |
@lessp, thank you! Looks and works great. I added b55d191, which initializes the theme earlier, to avoid a flicker for users that have chosen the light theme. Without the earlier initialization, users with a light theme first see the page load with a dark theme, and then it flips to light. I'm also slightly concerned about the appearance of the sun icon. But it looks a bit like a settings gear, which caused me to click it anyway, so that's probably fine. |
I had actually meant to come back to this and find a better spot for the toggle, but haven't really got around to it due to work. Not sure what state this was in! 😬 |
It's in a pretty neat state. You can see it live. If you have a good idea for where to move the toggle, you can ping this issue or maybe even PR it :) By the way, should the theme button show the icon for the theme you would switch to (as now), or the current theme? The latter seems more intuitive to me, but I'm not sure if there is some kind of usability convention I am not aware of. |
No idea, the former seemed more intuitive to me (the only reference that popped up was |
Also removed the shadow on the <h1> element. It was probably left over from an early version of the dark theme, before Dream's alpha 1 release. Resolves aantron#235. Co-authored-by: Anton Bachin <antonbachin@yahoo.com>
I wasn't able to build the complete documentation, but manually checked what I could.
(disclaimer, I fed the
CSS
to ChatGPT and asked it to extract all the colors into a theme, I then asked it to generate a light theme based on the dark theme colors. From what I could see, the theme looks nice, IMO, of course.)Screen.Recording.2023-04-26.at.16.44.55.mov
Would close: #235