Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

利用可能なモジュールの一覧ページ

  • Loading branch information...
commit a2ab1c1f354bb8fdeb33737fdf18c6b334aa5148 1 parent a0232d4
@mzp authored
Showing with 69 additions and 2 deletions.
  1. +5 −1 css/style.css
  2. +13 −1 main.ml
  3. +51 −0 templates/available.html
View
6 css/style.css
@@ -1,4 +1,4 @@
-h1,h2,ul,ol,li,p,html,body,address{
+h1,h2,h3,ul,ol,li,p,html,body,address{
margin:0;
border:0;
padding:0;
@@ -138,3 +138,7 @@ em {
iframe {
border: 1px solid black;
}
+
+ul.available-modules li {
+ display: inline;
+}
View
14 main.ml
@@ -44,9 +44,19 @@ let safe_int_of_string s =
let index_page (cgi : cgi) =
cgi#template @@ template "templates/index.html"
+let configs () =
+ Config.read "modules.txt"
+
+let available_page (cgi : cgi) =
+ let t =
+ template "templates/available.html"
+ in
+ set t ("available", (Controller.available @@ configs ()));
+ cgi#template t
+
let search_page (cgi : cgi) =
let configs =
- Config.read "modules.txt"
+ configs ()
in
let modules =
HList.concat_map (fun {Config.modules=m} -> m) configs
@@ -82,6 +92,8 @@ let _ =
q#header ~content_type:"text/html; charset=utf-8" ();
if q#param_exists "q" then
search_page q
+ else if q#param_exists "available" then
+ available_page q
else
index_page q
end
View
51 templates/available.html
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
+<link rel="shortcut icon" href="/favicon.ico" />
+<link rel="index" href="index.html" />
+<link href="css/style.css" type="text/css" rel="stylesheet" />
+<title>Available modules - OCaml API search</title>
+</head>
+<body>
+ <h1><a href="/"><img src="images/logo.png" alt="OCaml API search" /></a></h1>
+ <h2>Available modules</h2>
+::table(available)::
+ <h3>::package_html::</h3>
+ <ul class="available-modules">
+ ::table(modules)::
+ <li><a href="/man/::package::/::name_html::.html">::name_html::</a></li>
+ ::end::
+ </ul>
+::end::
+ <ul>
+ <li>
+ </ul>
+
+ <script type="text/javascript"><!--
+google_ad_client = "pub-8989402149590911";
+google_ad_slot = "2311620786";
+google_ad_width = 728;
+google_ad_height = 90;
+//-->
+ </script>
+ <script type="text/javascript"
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+ </script>
+
+ <address><a href="mailto:mzp_at_ocaml.jp">MIZUNO Hiroki</a> &copy; 2010</address>
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-4439877-4");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+</body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.