Permalink
Browse files

rename OCamlWeb_Main to Main

The OCamlWeb_ prefix was following the convention sometimes used of
starting module names with the library name. This is unnecessary in
this project because the library is never intended to be installed; it
is only for internal use by the build scripts. Thus, we might as well
use simpler module names.
  • Loading branch information...
1 parent 602630e commit a8f42afe2a27658cf9fdfe3504c1e270c1600372 @agarwal agarwal committed Sep 29, 2012
View
@@ -7,8 +7,8 @@ configure
*.native
*.byte
doclib.docdir
-src/lib/OCamlWeb_Main.ml
-src/lib/OCamlWeb_Main.mli
+src/lib/main.ml
+src/lib/main.mli
src/lib/META
src/lib/ocamlweb.mllib
src/lib/doclib.odocl
View
@@ -1,6 +1,6 @@
# auto-generated files, deleted by distclean
-AUTOFILES = src/lib/OCamlWeb_Main.ml \
- src/lib/OCamlWeb_Main.mli \
+AUTOFILES = src/lib/main.ml \
+ src/lib/main.mli \
setup.ml
# build the website
@@ -16,20 +16,20 @@ web: build
cp -a src/html/img $(WWW)
cp -a src/html/ext/bootstrap/img/*.png $(WWW)/img/
-src/lib/OCamlWeb_Main.ml src/lib/OCamlWeb_Main.mli: src/lib/OCamlWeb_Main.html src/lib/OCamlWeb_Main.html.ml src/lib/OCamlWeb_Main.html.mli
- cd src/lib; weberizer_compile OCamlWeb_Main.html
+src/lib/main.ml src/lib/main.mli: src/lib/main.html src/lib/main.html.ml src/lib/main.html.mli
+ cd src/lib; weberizer_compile main.html
setup.ml: _oasis
oasis setup -setup-update dynamic
SETUP = ocaml setup.ml
-setup.data: setup.ml src/lib/OCamlWeb_Main.html src/lib/OCamlWeb_Main.html.ml src/lib/OCamlWeb_Main.html.mli
+setup.data: setup.ml src/lib/main.html src/lib/main.html.ml src/lib/main.html.mli
$(SETUP) -configure $(CONFIGUREFLAGS)
configure: setup.data
-build: setup.data src/lib/OCamlWeb_Main.ml src/lib/OCamlWeb_Main.mli
+build: setup.data src/lib/main.ml src/lib/main.mli
$(SETUP) -build $(BUILDFLAGS)
doc: setup.data build
View
2 _oasis
@@ -13,7 +13,7 @@ Library ocamlorg
FindlibName: ocamlweb
BuildDepends: weberizer (>= 0.6.5), netstring, netclient, rss
Install: false
- Modules: OCamlWeb_Main
+ Modules: Main
Executable build
Path: src/app
View
@@ -4,7 +4,7 @@ module Path = Weberizer.Path
(* Settings common to all pages. *)
-let tpl = OCamlWeb_Main.shortcut_icon OCamlWeb_Main.empty
+let tpl = Main.shortcut_icon Main.empty
"https://static.ocamlcore.org/official/images/favicon.ico"
(* more = <li class="active"><a href="#">Tutorial</a></li>
@@ -15,7 +15,7 @@ let add_menu ?(more=[]) tpl lang p =
else "src/html/menu." ^ lang ^ ".html" in
let m = Weberizer.body_of(Weberizer.read menu) @ more in
let m = Weberizer.relative_url_are_from_base p m in
- OCamlWeb_Main.menu tpl m
+ Main.menu tpl m
(* To avoid symlinks for the images but still share them accross the
various translations of the website, one need to change the paths
@@ -155,28 +155,28 @@ let () =
else "../" ^ l2 in
let process_html lang p =
eprintf "Processing %s\n" (Path.full p);
- let tpl = OCamlWeb_Main.lang tpl lang in
- let tpl = OCamlWeb_Main.url_base tpl (Weberizer.Path.to_base p) in
+ let tpl = Main.lang tpl lang in
+ let tpl = Main.url_base tpl (Weberizer.Path.to_base p) in
let url_base = if Path.in_base p then "" else Path.to_base p in
Weberizer.Binding.string b "url_base" url_base;
let page = Weberizer.read (Path.full p) ~bindings:b in
- let tpl = OCamlWeb_Main.title tpl (Weberizer.title_of page) in
+ let tpl = Main.title tpl (Weberizer.title_of page) in
let prefix = if lang = "en" then "" else "../" in
let img_dir = url_base ^ prefix ^ "img/" in
- let tpl = OCamlWeb_Main.img_dir tpl img_dir in
- let tpl = OCamlWeb_Main.css_dir tpl (url_base ^ prefix ^ "css/") in
- let tpl = OCamlWeb_Main.javascript_dir tpl (url_base ^ prefix ^ "js/") in
+ let tpl = Main.img_dir tpl img_dir in
+ let tpl = Main.css_dir tpl (url_base ^ prefix ^ "css/") in
+ let tpl = Main.javascript_dir tpl (url_base ^ prefix ^ "js/") in
let body = Weberizer.body_of page in
let body = Weberizer.protect_emails body in
let body = img_path_translations p body ~img_dir in
- let tpl = OCamlWeb_Main.main tpl body in
+ let tpl = Main.main tpl body in
let tpl = add_menu tpl lang p in
- let tpl = OCamlWeb_Main.navigation_of_path tpl p in
- let tpl = OCamlWeb_Main.languages tpl
+ let tpl = Main.navigation_of_path tpl p in
+ let tpl = Main.languages tpl
(Path.translations p ~langs ~rel_dir) in
- OCamlWeb_Main.render tpl
+ Main.render tpl
in
Weberizer.iter_html ~filter ~langs "src/html" ~out_dir process_html
~perm:0o755
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a8f42af

Please sign in to comment.