generated from ocamlbr/melange-mlx-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
313 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<html lang="pt-BR"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Melange Basic Template</title> | ||
<script type="module" src="main.js"></script> | ||
<title>OCaml Brasil</title> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
module Home = struct | ||
let[@react.component] make () = | ||
<div className="bg-gray-900 text-white min-h-screen"> | ||
<header className="bg-gray-800 p-4"> | ||
<nav className="flex justify-between items-center"> | ||
<div className="text-2xl font-bold">(React.string "OCaml BR")</div> | ||
<ul className="flex space-x-4"> | ||
<li>(React.string "Grupo no Telegram")</li> | ||
<li>(React.string "Associe-se")</li> | ||
(* <li>(React.string "item")</li> *) | ||
</ul> | ||
</nav> | ||
</header> | ||
|
||
<main className="container mx-auto px-4 py-8"> | ||
<section className="text-center mb-12"> | ||
<h1 className="text-4xl font-bold mb-4">(React.string "OCaml Brasil")</h1> | ||
<p className="text-xl mb-4">(React.string "Comunidade Brasileira de programadores OCaml com interesse em falar sobre a linguagem, construir coisas usando OCaml e fazer evangelismo da linguagem no Brasil.")</p> | ||
<button className="bg-orange-500 text-white px-6 py-2 rounded">(React.string "Aprenda OCaml")</button> | ||
</section> | ||
|
||
<section className="mb-12"> | ||
<h2 className="text-2xl font-bold mb-4">(React.string "Porque aprender OCaml?")</h2> | ||
<div className="grid grid-cols-1 md:grid-cols-3 gap-8"> | ||
<div className="bg-gray-800 p-6 rounded"> | ||
<h3 className="text-xl font-bold mb-2">(React.string {js|Sistema de Tipos Poderoso! 💪|js})</h3> | ||
<p>(React.string {js|O sistema de tipos do OCaml captura erros em tempo de compilação, garantindo um código robusto e confiável.|js})</p> | ||
</div> | ||
<div className="bg-gray-800 p-6 rounded"> | ||
<h3 className="text-xl font-bold mb-2">(React.string {js|Blazing Fast! 🔥|js})</h3> | ||
<p>(React.string {js|O compilador do OCaml é conhecido por sua velocidade, permitindo iteração e desenvolvimento rápidos.|js})</p> | ||
</div> | ||
<div className="bg-gray-800 p-6 rounded"> | ||
<h3 className="text-xl font-bold mb-2">(React.string {js|Grandes Empresas confiam em OCaml! 📈 |js})</h3> | ||
<p>(React.string {js|Usado por grandes empresas como Facebook, Bloomberg e Jane Street em aplicações críticas.|js})</p> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section> | ||
<h2 className="text-2xl font-bold mb-4">(React.string {js|Últimas Notícias|js})</h2> | ||
(* Article 1 *) | ||
<article> | ||
<div className="mt-2 bg-gray-800 p-4 rounded"> | ||
<h3 className="text-xl font-bold">(React.string {js|Título|js})</h3> | ||
<p>(React.string "04/01/2025 15:34 UTC-3")</p> | ||
<p> (React.string "Content")</p> | ||
</div> | ||
</article> | ||
(* Article 2 *) | ||
<article> | ||
<div className="mt-2 bg-gray-800 p-4 rounded"> | ||
<h3 className="text-xl font-bold">(React.string {js|Título|js})</h3> | ||
<p>(React.string "04/01/2025 15:34 UTC-3")</p> | ||
<p> (React.string "Content")</p> | ||
</div> | ||
</article> | ||
</section> | ||
</main> | ||
|
||
<footer className="bg-gray-800 p-4 mt-12"> | ||
<div className="container mx-auto text-center"> | ||
<p>(React.string "Feito com OCaml e React.")</p> | ||
</div> | ||
</footer> | ||
</div> | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,9 @@ | ||
; `melange.emit` is a Dune stanza that will produce build rules to generate | ||
; JavaScript files from sources using the Melange compiler | ||
; https://dune.readthedocs.io/en/stable/melange.html#melange-emit | ||
(melange.emit | ||
|
||
; The `target` field is used by Dune to put all JavaScript artifacts in a specific folder inside `_build/default` | ||
; This field `target` allows to have multiple `melange.emit` stanzas in the `dune` file | ||
; if, for example, we want to produce ES6 and CommonJS output from the same sources. | ||
(target output) | ||
|
||
; The `alias` field can be used later on to build just the artifacts from this `melange.emit` | ||
; by calling `dune build @react`. | ||
; Note that if no `alias` field is defined, a default `melange` alias will be used instead. | ||
(target output) ;; Specify the desired output directory directly | ||
(alias react) | ||
(libraries reason-react melange.belt) | ||
(preprocess (pps melange.ppx reason-react-ppx)) | ||
(module_systems es6) | ||
(promote (until-clean)) | ||
(modules :standard)) | ||
|
||
; Here's the list of dependencies of the stanza. In this case (being `melange.emit`), | ||
; Dune will look into those dependencies and generate rules with JavaScript targets | ||
; for the modules in those libraries as well. | ||
; Caveat: the libraries need to be specified with `(modes melange)`. | ||
(libraries reason-react world melange.belt) | ||
|
||
; By default, Dune will include all modules in the folder to the targets. With `modules` field | ||
; we can tweak this default behavior by excluding `hello` from the list of targets of this stanza. | ||
; See https://dune.readthedocs.io/en/stable/reference/predicate-language.html#predicate-language | ||
(modules :standard \ hello) | ||
|
||
; Uncomment the following to copy the generated JavaScript files inside the source tree | ||
; (promote (until-clean)) | ||
|
||
(preprocess | ||
; The `pps` field is a list of ppx to apply to the sources before generating JavaScript. melange.ppx allows to use Melange attributes [@mel. ...] (https://melange.re/v2.0.0/communicate-with-javascript/#attributes) | ||
; reason-react-ppx allows to use JSX for ReasonReact components by using the [@JSX] attributes from Reason: https://reasonml.github.io/docs/en/jsx | ||
(pps melange.ppx reason-react-ppx)) | ||
|
||
; module_systems is a list of module systems to generate code for (es6, commonjs) | ||
; Change to (module_systems es6 commonjs) if you want to generate both | ||
; https://melange.re/v2.0.0/build-system/#commonjs-or-es6-modules | ||
(module_systems es6)) | ||
|
||
(melange.emit | ||
(target node) | ||
(alias node) | ||
(libraries world) | ||
(modules hello) | ||
(module_systems (es6 mjs))) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.