From 833018c295d36c2a7548c0a5db13cf7314476d55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Am=C3=A9lia=20Coutard-Sander?= Date: Sun, 15 Feb 2026 02:01:18 +0100 Subject: [PATCH] =?utf8?q?OCaml=20tr=C3=A8s=20basique=20pour=20le=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .ocamlformat | 41 +++++++++++++++++++++++++++ dune-project | 20 +++++++++++++ f4mnq/dune | 22 ++++++++++++++ f4mnq/{index.html => index.ml} | 21 +++++++++++++- f4mnq/style.css | 33 --------------------- f4mnq/style.ml | 52 ++++++++++++++++++++++++++++++++++ guix/site-web-pro.scm | 9 ++---- mpring/dune | 5 ++++ 9 files changed, 164 insertions(+), 40 deletions(-) create mode 100644 .gitignore create mode 100644 .ocamlformat create mode 100644 dune-project create mode 100644 f4mnq/dune rename f4mnq/{index.html => index.ml} (60%) delete mode 100644 f4mnq/style.css create mode 100644 f4mnq/style.ml create mode 100644 mpring/dune diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e35d885 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +_build diff --git a/.ocamlformat b/.ocamlformat new file mode 100644 index 0000000..a7d9f56 --- /dev/null +++ b/.ocamlformat @@ -0,0 +1,41 @@ +assignment-operator = end-line +break-before-in = fit-or-vertical +break-cases = fit-or-vertical +break-collection-expressions = fit-or-vertical +break-fun-decl = fit-or-vertical +break-fun-sig = fit-or-vertical +break-infix = fit-or-vertical +break-separators = after +break-string-literals = auto +break-struct = force +cases-exp-indent = 8 +cases-matching-exp-indent = normal +doc-comments = before +dock-collection-brackets +exp-grouping = preserve +extension-indent = 8 +field-space = tight-decl +function-indent = 8 +function-indent-nested = auto +if-then-else = keyword-first +indent-after-in = 0 +indicate-nested-or-patterns = space +infix-precedence = indent +let-and = sparse +let-binding-indent = 8 +let-binding-spacing = compact +let-module = sparse +line-endings = lf +margin = 120 +match-indent = 0 +match-indent-nested = never +module-item-spacing = sparse +nested-match = wrap +parens-tuple = always +parens-tuple-patterns = multi-line-only +sequence-style = terminator +single-case = compact +space-around-arrays=false +space-around-lists=false +space-around-records +type-decl-indent = 8 diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..e77f33f --- /dev/null +++ b/dune-project @@ -0,0 +1,20 @@ +(lang dune 3.19) + +(name site-web-pro) + +(generate_opam_files false) + +(source (uri https://git.f4mnq.fr/site-web-pro.git)) + +(authors "Amélia COUTARD-SANDER ") + +(maintainers "Amélia COUTARD-SANDER ") + +(license AGPL-3.0-or-later) + +(package + (name site-web-pro) + (synopsis "Site web professionnel") + (description "Le site web professionnel d'Amélia COUTARD-SANDER, écrit en OCaml") + (depends ocaml) + (tags ("site web" "ocaml"))) diff --git a/f4mnq/dune b/f4mnq/dune new file mode 100644 index 0000000..4d37451 --- /dev/null +++ b/f4mnq/dune @@ -0,0 +1,22 @@ +(executables + (public_names index style)) + +(install + (files + (index.html as f4mnq/index.html) + (style.css as f4mnq/style.css) + (glob_files + (mpring/* with_prefix f4mnq/mpring))) + (section share)) + +(rule + (action + (with-stdout-to + "index.html" + (run index)))) + +(rule + (action + (with-stdout-to + "style.css" + (run style)))) diff --git a/f4mnq/index.html b/f4mnq/index.ml similarity index 60% rename from f4mnq/index.html rename to f4mnq/index.ml index 7b63a15..f2dd5f0 100644 --- a/f4mnq/index.html +++ b/f4mnq/index.ml @@ -1,4 +1,22 @@ - +(* f4mnq.fr + * Copyright 2026 Amélia COUTARD-SANDER . + + * This website is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + + * This website is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License + * for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with this website. If not, see . + *) + +Printf.printf "%s" + {| @@ -28,3 +46,4 @@ Son contenu est sous la licence CC BY-SA 4.0, ou une version ultérieure +|} diff --git a/f4mnq/style.css b/f4mnq/style.css deleted file mode 100644 index 47b678b..0000000 --- a/f4mnq/style.css +++ /dev/null @@ -1,33 +0,0 @@ -@media (prefers-color-scheme: light) { -body { - background-color: #ffc; - color: #000; -} -a { - color: #099; -} -a:visited { - color: #c3c; -} -} -@media (prefers-color-scheme: dark) { -body { - background-color: #003; - color: #fff; -} -a { - color: #ff9; -} -a:visited { - color: #f99; -} -} - -#content { - min-height: calc(100vh - 200px); -} - -#mpring { - margin-left: calc(50% - 100px); - border: 0; -} diff --git a/f4mnq/style.ml b/f4mnq/style.ml new file mode 100644 index 0000000..2c79b04 --- /dev/null +++ b/f4mnq/style.ml @@ -0,0 +1,52 @@ +(* f4mnq.fr + * Copyright 2026 Amélia COUTARD-SANDER . + + * This website is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + + * This website is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License + * for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with this website. If not, see . + *) + +Printf.printf "%s" + {|@media (prefers-color-scheme: light) { +body { + background-color: #ffc; + color: #000; +} +a { + color: #099; +} +a:visited { + color: #c3c; +} +} +@media (prefers-color-scheme: dark) { +body { + background-color: #003; + color: #fff; +} +a { + color: #ff9; +} +a:visited { + color: #f99; +} +} + +#content { + min-height: calc(100vh - 200px); +} + +#mpring { + margin-left: calc(50% - 100px); + border: 0; +} +|} diff --git a/guix/site-web-pro.scm b/guix/site-web-pro.scm index 6374f3c..03f34a0 100644 --- a/guix/site-web-pro.scm +++ b/guix/site-web-pro.scm @@ -14,7 +14,7 @@ ; along with this website If not, see . (define-module (site-web-pro) - #:use-module (guix build-system copy) + #:use-module (guix build-system dune) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) @@ -29,11 +29,8 @@ (name "site-web-pro") (version "1.0-git") (source (local-file (dirname (dirname (current-filename))) "site-web-pro-checkout" #:recursive? #t #:select? vcs-file?)) - (build-system copy-build-system) - (arguments (list #:install-plan ''( - ("f4mnq/" "share/f4mnq") - ("mpring/" "share/mpring")))) + (build-system dune-build-system) (synopsis "Mon site web professionel") - (description "Mon site web professionel, statique.") + (description "Mon site web professionel, statique, écrit en OCaml.") (home-page "https://www.f4mnq.fr") (license (list license:agpl3+ license:cc-by-sa4.0)))) diff --git a/mpring/dune b/mpring/dune new file mode 100644 index 0000000..964811d --- /dev/null +++ b/mpring/dune @@ -0,0 +1,5 @@ +(install + (files + (glob_files + (*.{html,css,png} with_prefix mpring))) + (section share)) -- 2.52.0