Skip to content

Commit

Permalink
Restore HLJS and remove profil
Browse files Browse the repository at this point in the history
  • Loading branch information
xvw committed Nov 9, 2023
1 parent 471ec2a commit a18c6e1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pfioooouuuu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- run: opam install yourbones yourbones-ppx yourbones_js yourbones_js-beacon
- run: opam install yocaml
- run: opam install yocaml_unix yocaml_yaml yocaml_jingoo yocaml_syndication
- run: opam exec -- dune build --profile=release
- run: opam exec -- dune build
- run: opam exec -- dune exec bin/capsule_cli/capsule.exe -- build

- name: Deploy
Expand Down
15 changes: 15 additions & 0 deletions bin/capsule_client/capsule_client.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
open Js_of_ocaml
open Nightmare_js

module Hljs = struct
let get () = Js.Unsafe.global##.hljs

let mount () =
let hljs = get () in
let () = hljs##highlightAll in
Lwt.return ()
end

let () = Suspension.allow ()

let () =
Expand All @@ -10,3 +19,9 @@ let () =
let id = Js.to_string container_id in
Dapp_transfer.mount id
end)

let () =
Js.export "capsule_hljs"
(object%js
method run = Hljs.mount ()
end)
1 change: 0 additions & 1 deletion capsule.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ depends: [
"yocaml_jingoo" {pinned}
"yocaml_syndication" {pinned}
"nightmare" {pinned}
"nightmare-dream" {pinned}
"nightmare-tyxml" {pinned}
"nightmare_js" {pinned}
"nightmare_js-vdom" {pinned}
Expand Down
3 changes: 3 additions & 0 deletions templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
</div>
</footer>
<script>
nightmare_js.suspend(function () {
capsule_hljs.run();
});
nightmare_js.mount();
</script>
</body>
Expand Down

0 comments on commit a18c6e1

Please sign in to comment.