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

Books Block Component [Learn Area Redesign] #1481

Merged
merged 16 commits into from
Sep 4, 2023
13 changes: 7 additions & 6 deletions data/books/apprendre-a-programmer-avec-ocaml.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: "Apprendre à programmer avec OCaml"
slug: "apprendre-a-programmer-avec-ocaml"
description: >
This book is organized into three parts. The first one introduces
OCaml and targets beginners, being they programming beginners or
This book is organised into three parts. The first one introduces
OCaml and targets beginners, whether they're programming beginners or
simply new to OCaml. Through small programs, the reader is introduced
to fundamental concepts of programming and of OCaml. The second and
third parts are dedicated to fundamental concepts of algorithmics and
Expand All @@ -24,8 +25,8 @@ difficulty: beginner

Computer programming is hard to learn. Being a skillful programmer
requires imagination, anticipation, knowledge in algorithmics, the
mastery of a programming language, and above all experience, as
difficulties are often hidden in details. This book synthesizes our
mastery of a programming language, and above all, experience, as
difficulties are often hidden in details. This book synthesises our
experience as teachers and programmers.

The programming style is essential. Given a programming language, the
Expand All @@ -34,8 +35,8 @@ be both elegant and efficient. This is what the programmer must seek
at all costs and the reason why we choose a programming language for
this book rather than pseudo-code. Our choice is OCaml.

This book is organized into three parts. The first one introduces
OCaml and targets beginners, being they programming beginners or
This book is organised into three parts. The first one introduces
OCaml and targets beginners, whether they're programming beginners or
simply new to OCaml. Through small programs, the reader is introduced
to fundamental concepts of programming and of OCaml. The second and
third parts are dedicated to fundamental concepts of algorithmics and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Apprentissage de la programmation avec OCaml"
slug: "apprentissage-de-la-programmation-avec-ocaml"
description: >
This book is targeted towards beginner programmers and
provides teaching material for all programmers wishing to learn the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Développement d'applications avec Objective Caml"
slug: "developpement-d-applications-avec-objective-caml"
description: >
"Objective CAML est un langage de programmation : un de plus dira-t-on ! Ils sont en effet déjà nombreux et pourtant il en apparaît constamment de nouveaux. Au delà de leurs disparités, la conception et la genèse de chacun d'eux procèdent d'une motivation partagée : la volonté d'abstraire"
authors:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Initiation à la programmation fonctionnelle en OCaml"
slug: "initiation-a-la-programmation"
description: >
Le but de ce livre est d’initier le lecteur au style fonctionnel de
programmation en utilisant le langage OCaml.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Introduzione alla programmazione funzionale"
slug: "introduzione-alla-programmazione"
description: >
Functional programming introduction with OCaml
authors:
Expand Down
13 changes: 8 additions & 5 deletions data/books/more-ocaml-algorithms-methods-diversions.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
title: "More OCaml: Algorithms, Methods & Diversions"
title: "More OCaml: Algorithms, Methods, & Diversions"
slug: "more-ocaml-algorithms-methods-diversions"
description: >
In "More OCaml" John Whitington takes a meandering tour of functional
In "More OCaml," John Whitington takes a meandering tour of functional
programming with OCaml, introducing various language features and describing
some classic algorithms.
recommendation: >
This book covers topics like laziness, compression, generating PDFs, and more. A basic understanding of OCaml is required.
authors:
- John Whitington
published: 2014-08-26
Expand All @@ -17,15 +20,15 @@ featured: false
difficulty: intermediate
---

In "More OCaml" John Whitington takes a meandering tour of functional
In "More OCaml," John Whitington takes a meandering tour of functional
programming with OCaml, introducing various language features and describing
some classic algorithms. The book ends with a large worked example dealing with
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does "large worked example" mean? A large project?

the production of PDF files. There are questions for each chapter together with
worked answers and hints.

"More OCaml" will appeal both to existing OCaml programmers who wish to brush up
their skills, and to experienced programmers eager to explore functional
languages such as OCaml. It is hoped that each reader will find something new,
their skills and to experienced programmers eager to explore functional
languages such as OCaml. It is hoped that each reader will find something new
or see an old thing in a new light. For the more casual reader, or those who are
used to a different functional language, a summary of basic OCaml is provided at
the front of the book.
1 change: 1 addition & 0 deletions data/books/nyumon-ocaml.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "入門OCaml ~プログラミング基礎と実践理解~"
slug: "nyumon-ocaml"
description: ""
authors:
- OCaml-Nagoya
Expand Down
2 changes: 2 additions & 0 deletions data/books/ocaml-from-the-very-beginning.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
title: "OCaml From the Very Beginning"
slug: "ocaml-from-the-very-beginning"
description: >
In "OCaml from the Very Beginning" John Whitington takes a
no-prerequisites approach to teaching a modern general-purpose
programming language.
recommendation: "Suitable for formal use within an academic curriculum, and for the interested amateur."
authors:
- John Whitington
published: 2013-06-07
Expand Down
2 changes: 2 additions & 0 deletions data/books/ocaml-programming-correct-beautiful-efficient.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
title: "OCaml Programming: Correct + Efficient + Beautiful"
slug: "ocaml-programming-cs3110"
description: >
A textbook on functional programming and data structures in OCaml, with an
emphasis on semantics and software engineering. This book is the textbook for
CS 3110 Data Structures and Functional Programming at Cornell University.
recommendation: "Basic experience in some imperative programming language is helpful. Includes over 200 videos."
authors:
- Michael R. Clarkson
published: 2021-09-01
Expand Down
1 change: 1 addition & 0 deletions data/books/ocaml-scientific-computing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "OCaml Scientific Computing"
slug: "ocaml-scientific-computing"
description: >
Shows how the expressiveness of OCaml allows for fast and safe
development of data science applications.
Expand Down
1 change: 1 addition & 0 deletions data/books/ocaml-yuyan-biancheng-jichu-jiaocheng.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "OCaml语言编程基础教程"
slug: "ocaml-yuyan-biancheng"
description: ""
authors:
- G. Chen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Programmation de droite à gauche et vice-versa"
slug: "programmation-de-droite-a-gauche"
description: >
Programming with OCaml
authors:
Expand Down
1 change: 1 addition & 0 deletions data/books/puroguramingu-in-ocaml.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "プログラミング in OCaml ~関数型プログラミングの基礎からGUI構築まで~"
slug: "puroguramingu-in-ocaml"
description: ""
authors:
- A. Igarashi (五十嵐 淳)
Expand Down
7 changes: 6 additions & 1 deletion data/books/real-world-ocaml.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
title: "Real World OCaml"
slug: "real-world-ocaml"
description: >
Learn how to solve day-to-day problems in data processing, numerical
computation, system scripting, and database-driven web applications with
the OCaml multi-paradigm programming language.
recommendation: >
Suitable for people with some imperative programming experience. Hands-on code examples using real world scenerios.
authors:
- Anil Madhavapeddy
- Yaron Minsky
Expand All @@ -15,7 +18,7 @@ links:
uri: https://realworldocaml.org/
rating: 4
featured: true
difficulty: beginner
difficulty: intermediate
---

Learn how to solve day-to-day problems in data processing, numerical
Expand All @@ -30,3 +33,5 @@ environment, and move toward more advanced topics such as the module
system, foreign-function interface, macro language, and the OCaml tools.
Quickly learn how to put OCaml to work for writing succinct and
readable code.

The code examples in this books uses Jane Street [core library](https://ocaml.org/p/core/latest).
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Think OCaml: How to Think Like a Functional Programmer"
slug: "think-ocaml"
description: >
Introductory programming textbook based on the OCaml language
authors:
Expand Down
1 change: 1 addition & 0 deletions src/ocamlorg_data/data.mli
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module Book : sig
title : string;
slug : string;
description : string;
recommendation : string option;
authors : string list;
language : string;
published : string;
Expand Down
58 changes: 56 additions & 2 deletions src/ocamlorg_frontend/components/learn_components.eml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ let left_tutorial_block
~see_more
class_
=
<div class="<%s class_ %> md:w-1/2">
<div class="<%s class_ %>">
<div class="flex justify-center h-full p-4 lg:justify-end lg:pr-20">
<%s! tutorial_block_content ~title ~heading ~description ~tutorial_links ~see_more %>
</div>
Expand All @@ -120,8 +120,62 @@ let right_tutorial_block
~see_more
class_
=
<div class="<%s class_ %> md:w-1/2">
<div class="<%s class_ %>">
<div class="flex h-full justify-center p-4 lg:justify-start lg:pl-20">
<%s! tutorial_block_content ~title ~heading ~description ~tutorial_links ~see_more %>
</div>
</div>

let book_tile
books
=
<div class="mt-2 flex flex-col flex-grow gap-12 lg:gap-6 md:flex-row xl:gap-12">
<% books |> List.rev |> List.iteri (fun index (item : Data.Book.t) -> if (index < 2) then ( %>
<div class="flex flex-col w-full gap-4 lg:w-60">
<img src="<%s Ocamlorg_static.Media.url item.cover %>"
class="mt-2 w-60 h-80 lg:w-52 lg:h-72 xl:w-60 xl:h-80
<%s if item.difficulty = Some "intermediate" then "bg-[#040113]" else "bg-teal-700" %> object-contain"
alt="">
<%s! skill_tag item.difficulty "mt-2 grow-0 w-28" %>
<h4 class="mt-1 text-default text-lg font-normal leading-6"> <%s item.title %> </h4>
<% (match item.recommendation with None -> () | Some recommendation -> %>
<p class="mt-1 text-gray-700 text-sm font-normal whitespace-normal max-w-prose"> <%s recommendation %> </p>
<% ); %>
</div>
<% ) else %>
<% ); %>
</div>

let left_books_content_block
books
~title
~(link : link )
=
<div class="w-full bg-default flex h-full p-4">
<div class="max-w-sm md:max-w-none sm:w-96 md:w-auto ml-auto flex flex-col mr-auto lg:ml-auto lg:mr-0 lg:pr-4 md:pl-20 lg:pl-0">
<div class="pt-4 text-default text-sm font-medium leading-7 tracking-widest"> BOOKS </div>
<h2 class="mt-2 text-default text-2xl font-normal leading-7"> <%s title %> </h2>
<%s! book_tile books %>
<a href="<%s link.href %>" class="flex gap-4 mt-4 text-primary-700 text-lg font-bold inline-flex items-center underline leading-10">
<%s link.title %>
<%s! Icons.arrow_small_right "h-6 w-6" %>
</a>
</div>
</div>

let right_books_content_block
books
~title
~(link : link )
=
<div class="w-full bg-default flex h-full p-4">
<div class="max-w-sm md:max-w-none sm:w-96 md:w-auto ml-auto mr-auto flex flex-col lg:ml-0 lg:mr-auto lg:pl-6 md:pl-20 lg:pl-0">
<div class="pt-4 text-default text-sm font-medium leading-7 tracking-widest"> BOOKS </div>
<h2 class="mt-2 text-default text-2xl font-normal leading-7"> <%s title %> </h2>
<%s! book_tile books %>
<a href="<%s link.href %>" class="flex gap-4 mt-4 text-primary-700 text-lg font-bold inline-flex items-center underline leading-10">
<%s link.title %>
<%s! Icons.arrow_small_right "h-6 w-6" %>
</a>
</div>
</div>
50 changes: 15 additions & 35 deletions src/ocamlorg_frontend/pages/learn.eml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
let intermediate_books =
let book_slugs_to_retrieve = ["more-ocaml-algorithms-methods-diversions"; "real-world-ocaml"] in
let book_options = List.map Data.Book.get_by_slug book_slugs_to_retrieve in
let books = List.filter_map (fun opt -> opt) book_options in
books

let render
~(papers : Data.Paper.t list)
~(books : Data.Book.t list)
Expand All @@ -11,14 +17,14 @@ Learn_layout.overview_render
~left_sidebar_html:None
~right_sidebar_html:None
~current:Overview @@
<div class="container-fluid">
<div class="container-fluid wide pt-10">
<h1 class="font-bold mb-8">Learn OCaml</h1>
<div class="w-full">
<%s! Learn_components.api_card_block latest_version %>
</div>
</div>

<div class="flex flex-col mt-8 md:flex-row">
<div class="mt-8 grid md:grid-cols-2">
<%s! Learn_components.left_tutorial_block ~title:"GET STARTED" ~heading:"Introduction To OCaml"
~description:"Install OCaml and gain a high-level understanding of language features"
~tutorial_links:[
Expand All @@ -27,7 +33,7 @@ Learn_layout.overview_render
{href = Url.tutorial "ocaml-on-windows"; title = "OCaml On Windows"}
]
~see_more:{href = Url.getting_started; title = "Get Started"}
"bg-learn-area-dark-green"
"bg-teal-700"
%>
<%s! Learn_components.right_tutorial_block ~title:"LANGUAGE" ~heading:"The OCaml Language"
~description:"An in-depth explanation of language features and data structures from the Standard Library"
Expand All @@ -42,7 +48,7 @@ Learn_layout.overview_render
%>
</div>

<div class="flex flex-col grow md:flex-row">
<div class="grid md:grid-cols-2">
<%s! Learn_components.left_tutorial_block ~title:"GUIDES" ~heading:"Practical-Minded Tutorials and Guides"
~description:"How to solve real-world problems in OCaml"
~tutorial_links:[
Expand All @@ -66,6 +72,11 @@ Learn_layout.overview_render
"bg-[#040113]"
%>
</div>

<div class="grid lg:grid-cols-2">
<%s! Learn_components.left_books_content_block books ~title:"Recommended For Beginners" ~link:{href = Url.books; title = "See More Books"} %>
<%s! Learn_components.right_books_content_block intermediate_books ~title:"For Intermediate Users" ~link:{href = Url.books; title = "See More Books"} %>
</div>
<div class="container-fluid">
<div class="mt-10 lg:mt-20 border-b border-gray-200 pb-10">
<h3 class="font-bold">Papers</h3>
Expand Down Expand Up @@ -100,35 +111,4 @@ Learn_layout.overview_render
</a>
</div>

<div class="mt-10 lg:mt-20">
<h3 class="font-bold">Recommended Books</h3>
<div class="mt-6 text-lighter mb-12 text-lg">
What experts programmers and researchers are saying about OCaml, from the beginner level to the more advanced topics.
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-20">
<% books |> List.iter (fun (item : Data.Book.t) -> %>
<a href="<%s item.links |> List.hd |> (fun x -> x.uri) %>" class="flex-1 card-hover">
<img
src="<%s Ocamlorg_static.Media.url item.cover %>"
class="rounded-2xl lg:w-full max-h-96 border border-gray-200"
alt="<%s item.title %> cover"
>
<div class="font-semibold mt-6 mb-3"><%s item.title %></div>
<% (match item.rating with | None -> () | Some rating -> %>
<div class="flex space-x-1 mb-6 text-primary-600">
<% List.init rating (fun _ -> ()) |> List.iter (fun () -> %>
<%s! Icons.star_2 "h-6 w-6 text-yellow-300" %>
<% ); %> <% List.init (5 - rating) (fun _ -> ()) |> List.iter (fun () -> %>
<%s! Icons.star_2 "h-6 w-6 text-gray-300" %>
<% ); %>
</div>
<% ); %>
</a>
<% ); %>
</div>
<a href="<%s Url.books %>" class="btn btn-lg btn-secondary mt-12">
<span>See all Books</span>
<%s! Icons.chevron_right "h-5 w-5" %>
</a>
</div>
</div>
2 changes: 1 addition & 1 deletion src/ocamlorg_frontend/pages/outreachy.eml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Layout.render
</div>
<% ); %>
</div>
</div>
</div>
1 change: 0 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ module.exports = {
"search-term-highlight": "rgb(221, 232, 251)",
"learn-area-orange": "#C34711",
"learn-area-light-blue": "rgba(211, 213, 249, 0.60)",
"learn-area-dark-green": "rgba(6, 112, 101, 1)",

transparent: "transparent",

Expand Down
Loading