Skip to content
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

Fix build #147

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Main workflow
name: Builds, tests & co

on:
pull_request:
push:
pull_request:
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON
Expand All @@ -13,60 +13,49 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- macos-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "4.14"

- run: opam install . --deps-only

- run: opam exec -- make all

lint-doc:
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "4.14"

- uses: ocaml/setup-ocaml/lint-doc@v3

lint-fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "4.14"

- uses: ocaml/setup-ocaml/lint-fmt@v3

lint-opam:
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "4.14"

- uses: ocaml/setup-ocaml/lint-opam@v3
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.26.2
version=0.27.0
profile=conventional
break-cases=fit-or-vertical
break-separators=before
Expand Down
35 changes: 10 additions & 25 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,41 +1,26 @@
(lang dune 2.0)

(using menhir 2.0)

(lang dune 3.17)
(name html_of_wiki)

(generate_opam_files true)
(implicit_transitive_deps false)

(license "LGPL-2.1 with OCaml linking exception")

(authors "The ocsigen team <dev@ocsigen.org>")

(maintainers
"The ocsigen team <dev@ocsigen.org>"
"Leo Valais <leo.valais97@gmail.com>")

(source
(github ocsigen/html_of_wiki))

(bug_reports "https://github.com/ocsigen/html_of_wiki/issues")

(homepage "https://github.com/ocsigen/html_of_wiki")

(maintainers "The ocsigen team <dev@ocsigen.org>" "Leo Valais <leo.valais97@gmail.com>")
(source (github ocsigen/html_of_wiki))
(documentation "https://ocsigen.org/html_of_wiki/2.0/manual/intro")

(generate_opam_files true)

(package
(name html_of_wiki)
(synopsis "A wikicreole to HTML compiler")
(description
"a static website generator for software projects, using wikicreole syntax.")
(description "a static website generator for software projects, using wikicreole syntax.")
(depends
(ocaml (< 5.0))
("cmdliner" (>= 1.1.1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seem to be the only significant change in this large diff. Why is it not compatible with ocaml 5 ? It would be more useful to fix the build. The rest of changes don't seem related to fixing the build. I don't understand the motivation behind all this.

"js_of_ocaml-ppx_deriving_json"
("tyxml"(>= 4.6.0))
"base64"
"js_of_ocaml-ppx"
"js_of_ocaml-ppx_deriving_json"
"ocamlfind"
"re"
"base64"
"reason"
("tyxml"(>= 4.6.0))))
"reason"))
12 changes: 7 additions & 5 deletions html_of_wiki.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ homepage: "https://github.com/ocsigen/html_of_wiki"
doc: "https://ocsigen.org/html_of_wiki/2.0/manual/intro"
bug-reports: "https://github.com/ocsigen/html_of_wiki/issues"
depends: [
"dune" {>= "2.0"}
"dune" {>= "3.17"}
"ocaml" {< "5.0"}
"cmdliner" {>= "1.1.1"}
"js_of_ocaml-ppx_deriving_json"
"tyxml" {>= "4.6.0"}
"base64"
"js_of_ocaml-ppx"
"js_of_ocaml-ppx_deriving_json"
"ocamlfind"
"re"
"base64"
"reason"
"tyxml" {>= "4.6.0"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand Down
5 changes: 3 additions & 2 deletions ohow-help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ OPTIONS
-r, --hl, --headless
Produces raw HTML without head tag and not inside a body tag.

--root=DIR (absent=/home/hugo/html_of_wiki/_build/default)
--root=DIR
(absent=/Users/smorimoto/src/github.com/ocsigen/html_of_wiki/_build/default)
Use the given root directory.

-t FILE, --template=FILE
Expand All @@ -134,7 +135,7 @@ COMMON OPTIONS
Show version information.

EXIT STATUS
ohow exits with the following status:
ohow exits with:

0 on success.

Expand Down
5 changes: 3 additions & 2 deletions src/client/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ let convert pre =

let remove_error_message n =
let p = Js.Unsafe.coerce n in
if Js.string p##.firstChild == Js.string "[object Text]"
&& p##.firstChild##.data == Js.string reason_error
if
Js.string p##.firstChild == Js.string "[object Text]"
&& p##.firstChild##.data == Js.string reason_error
then Js.Opt.iter n##.firstChild (fun c -> ignore (n##removeChild c))

let add_error_message n =
Expand Down
6 changes: 3 additions & 3 deletions src/ohow/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(executables
(names ohow)
(public_names ohow)
(executable
(name ohow)
(public_name ohow)
(package html_of_wiki)
(libraries tyxml tyxml.functor re cmdliner unix common base64)
(modules_without_implementation wiki_syntax_types))
Expand Down
4 changes: 2 additions & 2 deletions src/ohow/global.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ let ref_menu_file : menu_file option ref = ref None

let with_menu_file mf k =
ignore
( (!ref_menu_file >>= function
| Manual s | Api s -> Some s)
( ( !ref_menu_file >>= function
| Manual s | Api s -> Some s )
>>= fun s -> failwith @@ "menu_file " ^ s ^ "already set. Abort." );
ref_menu_file := Some mf;
let r = k () in
Expand Down
3 changes: 2 additions & 1 deletion src/ohow/global.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Unsets the [current_file] after [k] finishes and returns its value. *)
val with_current_file : string -> (unit -> 'a) -> 'a

(** [using_current_file k] calls [k @@ current_file ()] and returns its value. *)
(** [using_current_file k] calls [k @@ current_file ()] and returns its value.
*)
val using_current_file : (string -> 'a) -> 'a

(** Returns the current file path. *)
Expand Down
9 changes: 6 additions & 3 deletions src/ohow/paths.mli
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ val path_of_list : string list -> string
(** Splits the given path in a list of basenames *)
val list_of_path : string -> string list

(** Returns the absolute path of the given path (returns it if already absolute) *)
(** Returns the absolute path of the given path (returns it if already absolute)
*)
val realpath : string -> string

(** Checks whether two absolute path or two relative path are equal. *)
Expand All @@ -24,7 +25,8 @@ val rewind : string -> string -> string
(** [is_inside_dir dir file] returns whether [file] is located inside [dir]. *)
val is_inside_dir : string -> string -> bool

(** [remove_prefixl l l'] returns the l or l' with the prefix l' or l removed. *)
(** [remove_prefixl l l'] returns the l or l' with the prefix l' or l removed.
*)
val remove_prefixl : 'a list -> 'a list -> 'a list

(** Does the same work thab remove_prefixl but for paths. *)
Expand All @@ -33,7 +35,8 @@ val path_rm_prefix : string -> string -> string
(** [is_visible d] returns whether [d] is a visible file (unix only). *)
val is_visible : string -> bool

(** [is_visible_dir d] returns whether [d] is a visible directory (unix only). *)
(** [is_visible_dir d] returns whether [d] is a visible directory (unix only).
*)
val is_visible_dir : string -> bool

(** [concat_uri_suffix s u] concatenates [u] with [s] if [u] doesn't ends with a
Expand Down
6 changes: 3 additions & 3 deletions src/ohow/wiki_ext.ml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ let do_when_project _ _ args c =
in
(Global.options ()).project
>>= (fun current ->
if predicate project current
then Some (`Flow5 (c <$> Wiki_syntax.compile |? []))
else None)
if predicate project current
then Some (`Flow5 (c <$> Wiki_syntax.compile |? []))
else None)
|? `Flow5 []

let do_when_local _ _ _ c =
Expand Down
41 changes: 13 additions & 28 deletions src/ohow/wiki_syntax.ml
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ open Wiki_syntax_types.ExtParser
let cast_wp (type a b c) wp =
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
(module P : Parser with type res = a)
Expand All @@ -267,9 +265,7 @@ let cast_wp (type a b c) wp =
let cast_niwp (type a b c) wp =
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
(module struct
Expand All @@ -284,29 +280,23 @@ let cast_niwp (type a b c) wp =
let get_plugin_resolver (type a b c) wp =
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
P.plugin_resolver

let preparse_string (type a b c) wp =
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
P.preparse_string

let desugar_string (type a b c) wp =
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
P.desugar_string
Expand Down Expand Up @@ -1173,7 +1163,10 @@ module FlowBuilder = struct

let img_elem attribs href alt =
let a = opt_of_list (parse_common_attribs attribs) in
let src = uri_of_href href (* CCC https ? *) in
let src =
uri_of_href href
(* CCC https ? *)
in
[ (Html.img ~src ~alt ?a () : [> `Img ] Html.elt) ]

let tt_elem attribs content =
Expand Down Expand Up @@ -1729,9 +1722,7 @@ let register_simple_extension (type a b c)
~(wp : (a, b, c) ext_wikicreole_parser) ~name ?preparser ?ni_plugin plugin =
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
let open Parser in
Expand Down Expand Up @@ -1899,9 +1890,7 @@ let register_wiki_extension (type a b c a' b' c') ~wp ~name ~wp_rec ?preparser
(plugin : (_, _, _) wiki_plugin) =
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
let module Plugin = struct
Expand Down Expand Up @@ -1935,9 +1924,7 @@ let register_link_extension (type a b c a' b' c') ~wp ~name ~wp_rec ?preparser
?(context = fun bi _ -> bi) (plugin : (_, _, _) link_plugin) =
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
let module Plugin = struct
Expand All @@ -1956,9 +1943,7 @@ let register_raw_wiki_extension (type a b c a' b' c') ~wp ~name ~wp_rec
?preparser ?ni_plugin plugin =
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
: ExtParser with type res = a and type res_without_interactive = b
and type link_content = c)
in
let open Parser in
Expand Down
3 changes: 2 additions & 1 deletion src/ohow/wiki_syntax_types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module type Preprocessor = sig
-> string
end

(** Module type for representing wikicreole parser whose return type id [ret]. *)
(** Module type for representing wikicreole parser whose return type id [ret].
*)
module type Parser = sig
include Preprocessor

Expand Down
Loading
Loading