Skip to content

Commit

Permalink
Doc: Replace basicwebsite tuto by full page on web site programming
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Dec 29, 2023
1 parent fa8015e commit e0b1cf1
Show file tree
Hide file tree
Showing 10 changed files with 1,286 additions and 416 deletions.
631 changes: 631 additions & 0 deletions tutos/7.1/manual/basics-server.wiki

Large diffs are not rendered by default.

34 changes: 8 additions & 26 deletions tutos/7.1/manual/basics.wiki
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=All Ocsigen in one page=
=Client-server applications in one page=

This page describes the main concepts you need to master to become fully operational
with Ocsigen. Use it as your training plan or as a cheatcheet while programming.

Depending on your needs, you may not need to learn all this.
Ocsigen is very flexible and can be used both for very basic page generation
functions (see [[basicwebsite|this tutorial]]) or very complex
client-server Web apps and their mobile counterparts.
Depending on your needs, you may not need to learn all this. Ocsigen is
very flexible and can be used both for Web site programing (see
[[basics-server|this page]]) or more complex client-server Web apps and
their mobile counterparts.

In parallel to the reading of that page,
we recommend to generate your first [[wiki("ocsigen-start"):|Ocsigen Start]] app to see
Expand Down Expand Up @@ -164,6 +164,7 @@ from the corresponding submodule of

<<div id="servicetable"|
|=@@class="row"@@<<a_api project="eliom" subproject="server" text="Html"| module Eliom_registration.Html >>|@@colspan="3"@@Services returning typed HTML pages|
|=@@class="row"@@<<a_api project="eliom" subproject="server" text="Html_text"| module Eliom_registration.Html >>|@@colspan="3"@@Services returning untyped HTML pages as strings|
|=@@class="row"@@<<a_api project="eliom" subproject="server" text="App"| module Eliom_registration.ELIOM_APPL >>|@@colspan="3"@@Apply this functor to generate registration functions for services belonging to an Eliom client/server application. These services also return typed HTML pages, but Eliom will automatically add the client-side program as a JS file, and all the data needed (values of all injections, etc.)|
|=@@class="row"@@<<a_api project="eliom" subproject="server" text="Flow"| module Eliom_registration.Flow5 >>|@@colspan="3"@@Services returning portions of HTML pages.|
|=@@class="row"@@<<a_api project="eliom" subproject="server" text="Action"| module Eliom_registration.Action >>|@@colspan="3"@@Services performing actions (server side effects) with or without reloading the page (e.g. login, logout, payment, modification of user information...)|
Expand Down Expand Up @@ -350,27 +351,8 @@ modules <<a_api project="eliom" subproject="server" text="Eliom_content.Html.F.F
define a typed interface
for form elements. Use this for links (see above), or if you program traditional
server-side Web interaction (with or without client-side program). This will statically check that your forms
match the services. Example:

<<code language="ocaml"|
let open Eliom_content.Html.D in
Form.post_form
~service:connection_service
(fun (name, password) ->
[fieldset
[label ~a:[a_for name] [txt "Name: "];
Form.input ~input_type:`Text ~name:name Form.int;
br ();
Form.input
~a:[a_placeholder "Password"]
~input_type:`Password
~name:password
Form.string;
br ();
Form.input ~input_type:`Submit ~value:"Connect" Form.string
]]) ()

>>
match the services. See more information in the
<<a_manual project="tuto" chapter="basics-server"|server-side programming manual>>.

>>
<<section class="docblock" |
Expand Down
178 changes: 0 additions & 178 deletions tutos/7.1/manual/basicwebsite.wiki

This file was deleted.

4 changes: 2 additions & 2 deletions tutos/7.1/manual/intro.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ documentation.
if you plan to build a client-server Web (and/or mobile) app.
It will help you to build your first app very quickly,
with many code samples to study.
* [[wiki:manual/basicwebsite|Basic web site]] explains how to write a basic
Web site using OCaml functions
* [[wiki:manual/basics-server|Basic web site]] explains how to write a
website in OCaml, if you don't plan to have client-side features yet
* If you are fluent in OCaml and want a quick introduction to
client-server Web programming with Eliom,
read tutorial
Expand Down
4 changes: 2 additions & 2 deletions tutos/7.1/manual/menu.wiki
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
= Programmer's guide
==[[intro|Introduction. Ocsigen: where to start?]]
==[[basics|All Ocsigen in one page]]
==[[basics|Client-server applications in one page]]
==[[basics-server|Server-side Web sites in one page]]
= Main tutorials
==[[site:/install|Install Ocsigen]]
==[[start|Your first app in 5 minutes]]
==[[basicwebsite|A basic Web site in OCaml]]
==[[application|Client/server application: Graffiti]]
==[[tutowidgets|Eliom apps basics: writing client-server widgets]]
==[[how-to-register-session-data|Session data: Eliom references]]
Expand Down
Loading

0 comments on commit e0b1cf1

Please sign in to comment.