Skip to content

Commit

Permalink
Let manual/src/html_processing/src/common.ml be generated by configure
Browse files Browse the repository at this point in the history
  • Loading branch information
shindere committed Sep 29, 2021
1 parent 457a69b commit 33b7b9e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ _build
/lex/parser.output

/manual/src/cmds/warnings-help.etex
/manual/src/html_processing/src/common.ml
/manual/src/warnings-help.etex

/api_docgen/build
Expand Down
3 changes: 3 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ AC_CONFIG_FILES([Makefile.build_config])
AC_CONFIG_FILES([Makefile.config])
AC_CONFIG_FILES([stdlib/sys.ml])
AC_CONFIG_FILES([manual/src/version.tex])
AC_CONFIG_FILES([manual/src/html_processing/src/common.ml])
AC_CONFIG_FILES([tools/eventlog_metadata])
AC_CONFIG_HEADERS([runtime/caml/m.h])
AC_CONFIG_HEADERS([runtime/caml/s.h])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(* ------------ Ocaml Web-manual -------------- *)
(* @configure_input@ *)
#2 "manual/src/html_processing/src/common.ml.in"
(* ------------ OCaml Web-manual -------------- *)

(* Copyright San Vu Ngoc, 2020

Expand Down Expand Up @@ -120,12 +122,7 @@ let add_sidebar_button body =
|> prepend_child btn;
prepend_child body btn

(* Detect OCaml version from VERSION file *)
let find_version () =
let pp = Filename.parent_dir_name in
let version_file = pp // pp // pp // "VERSION" in
let major, minor = Scanf.bscanf (Scanf.Scanning.from_file version_file) "%u.%u" (fun x y -> x,y) in
sprintf "%u.%u" major minor
let find_version () = "@OCAML_VERSION_SHORT@"

(*
Local Variables:
Expand Down

0 comments on commit 33b7b9e

Please sign in to comment.