From 719c3a3b593ff013f5b0dfb2d421d181d44dd5d2 Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Fri, 25 Oct 2024 11:25:27 +0300 Subject: [PATCH] chore: Use a Dune dialect to preprocess eml templates (#2781) --- dune-project | 11 ++ src/ocamlorg_frontend/dune | 396 ------------------------------------- 2 files changed, 11 insertions(+), 396 deletions(-) diff --git a/dune-project b/dune-project index ccfb6ce69c..4aceff78d3 100644 --- a/dune-project +++ b/dune-project @@ -85,3 +85,14 @@ (url "git+https://github.com/tarides/olinkcheck") (package (name olinkcheck))) + +(dialect + (name eml) + (implementation + (extension eml) + (preprocess + (run + %{bin:dream_eml} + %{input-file} + --workspace %{workspace_root} + --stdout)))) diff --git a/src/ocamlorg_frontend/dune b/src/ocamlorg_frontend/dune index d0700d5764..7035dfd513 100644 --- a/src/ocamlorg_frontend/dune +++ b/src/ocamlorg_frontend/dune @@ -3,399 +3,3 @@ (libraries ocamlorg.global dream ocamlorg.data timedesc ocamlorg_static)) (include_subdirs unqualified) - -(subdir - layouts/ - (rule - (target layout.ml) - (action - (run %{bin:dream_eml} %{dep:layout.eml} --workspace %{workspace_root}))) - (rule - (target community_layout.ml) - (action - (run - %{bin:dream_eml} - %{dep:community_layout.eml} - --workspace - %{workspace_root}))) - (rule - (target learn_layout.ml) - (action - (run - %{bin:dream_eml} - %{dep:learn_layout.eml} - --workspace - %{workspace_root}))) - (rule - (target news_layout.ml) - (action - (run - %{bin:dream_eml} - %{dep:news_layout.eml} - --workspace - %{workspace_root}))) - (rule - (target tools_layout.ml) - (action - (run - %{bin:dream_eml} - %{dep:tools_layout.eml} - --workspace - %{workspace_root}))) - (rule - (target package_layout.ml) - (action - (run - %{bin:dream_eml} - %{dep:package_layout.eml} - --workspace - %{workspace_root})))) - -(subdir - pages/ - (rule - (target about.ml) - (action - (run %{bin:dream_eml} %{dep:about.eml} --workspace %{workspace_root}))) - (rule - (target academic_users.ml) - (action - (run - %{bin:dream_eml} - %{dep:academic_users.eml} - --workspace - %{workspace_root}))) - (rule - (target academic_institutions.ml) - (action - (run - %{bin:dream_eml} - %{dep:academic_institutions.eml} - --workspace - %{workspace_root}))) - (rule - (target is_ocaml_yet.ml) - (action - (run - %{bin:dream_eml} - %{dep:is_ocaml_yet.eml} - --workspace - %{workspace_root}))) - (rule - (target ocaml_planet.ml) - (action - (run - %{bin:dream_eml} - %{dep:ocaml_planet.eml} - --workspace - %{workspace_root}))) - (rule - (target changelog.ml) - (action - (run %{bin:dream_eml} %{dep:changelog.eml} --workspace %{workspace_root}))) - (rule - (target changelog_entry.ml) - (action - (run - %{bin:dream_eml} - %{dep:changelog_entry.eml} - --workspace - %{workspace_root}))) - (rule - (target news.ml) - (action - (run %{bin:dream_eml} %{dep:news.eml} --workspace %{workspace_root}))) - (rule - (target news_post.ml) - (action - (run %{bin:dream_eml} %{dep:news_post.eml} --workspace %{workspace_root}))) - (rule - (target books.ml) - (action - (run %{bin:dream_eml} %{dep:books.eml} --workspace %{workspace_root}))) - (rule - (target community.ml) - (action - (run %{bin:dream_eml} %{dep:community.eml} --workspace %{workspace_root}))) - (rule - (target events.ml) - (action - (run %{bin:dream_eml} %{dep:events.eml} --workspace %{workspace_root}))) - (rule - (target conferences.ml) - (action - (run - %{bin:dream_eml} - %{dep:conferences.eml} - --workspace - %{workspace_root}))) - (rule - (target conference.ml) - (action - (run %{bin:dream_eml} %{dep:conference.eml} --workspace %{workspace_root}))) - (rule - (target home.ml) - (action - (run %{bin:dream_eml} %{dep:home.eml} --workspace %{workspace_root}))) - (rule - (target industrial_users.ml) - (action - (run - %{bin:dream_eml} - %{dep:industrial_users.eml} - --workspace - %{workspace_root}))) - (rule - (target industrial_businesses.ml) - (action - (run - %{bin:dream_eml} - %{dep:industrial_businesses.eml} - --workspace - %{workspace_root}))) - (rule - (target learn.ml) - (action - (run %{bin:dream_eml} %{dep:learn.eml} --workspace %{workspace_root}))) - (rule - (target install.ml) - (action - (run %{bin:dream_eml} %{dep:install.eml} --workspace %{workspace_root}))) - (rule - (target tools_platform.ml) - (action - (run - %{bin:dream_eml} - %{dep:tools_platform.eml} - --workspace - %{workspace_root}))) - (rule - (target tool_page.ml) - (action - (run %{bin:dream_eml} %{dep:tool_page.eml} --workspace %{workspace_root}))) - (rule - (target jobs.ml) - (action - (run %{bin:dream_eml} %{dep:jobs.eml} --workspace %{workspace_root}))) - (rule - (target outreachy.ml) - (action - (run %{bin:dream_eml} %{dep:outreachy.eml} --workspace %{workspace_root}))) - (rule - (target package_overview.ml) - (action - (run - %{bin:dream_eml} - %{dep:package_overview.eml} - --workspace - %{workspace_root}))) - (rule - (target package_documentation.ml) - (action - (run - %{bin:dream_eml} - %{dep:package_documentation.eml} - --workspace - %{workspace_root}))) - (rule - (target package_versions.ml) - (action - (run - %{bin:dream_eml} - %{dep:package_versions.eml} - --workspace - %{workspace_root}))) - (rule - (target packages.ml) - (action - (run %{bin:dream_eml} %{dep:packages.eml} --workspace %{workspace_root}))) - (rule - (target packages_autocomplete_fragment.ml) - (action - (run - %{bin:dream_eml} - %{dep:packages_autocomplete_fragment.eml} - --workspace - %{workspace_root}))) - (rule - (target packages_search.ml) - (action - (run - %{bin:dream_eml} - %{dep:packages_search.eml} - --workspace - %{workspace_root}))) - (rule - (target papers.ml) - (action - (run %{bin:dream_eml} %{dep:papers.eml} --workspace %{workspace_root}))) - (rule - (target exercises.ml) - (action - (run %{bin:dream_eml} %{dep:exercises.eml} --workspace %{workspace_root}))) - (rule - (target release.ml) - (action - (run %{bin:dream_eml} %{dep:release.eml} --workspace %{workspace_root}))) - (rule - (targets governance.ml) - (deps governance.eml) - (action - (run %{bin:dream_eml} %{deps} --workspace %{workspace_root}))) - (rule - (targets governance_team.ml) - (deps governance_team.eml) - (action - (run %{bin:dream_eml} %{deps} --workspace %{workspace_root}))) - (rule - (targets releases.ml) - (deps releases.eml) - (action - (run %{bin:dream_eml} %{dep:releases.eml} --workspace %{workspace_root}))) - (rule - (target resources.ml) - (action - (run %{bin:dream_eml} %{dep:resources.eml} --workspace %{workspace_root}))) - (rule - (target success_story.ml) - (action - (run - %{bin:dream_eml} - %{dep:success_story.eml} - --workspace - %{workspace_root}))) - (rule - (target tutorial.ml) - (action - (run %{bin:dream_eml} %{dep:tutorial.eml} --workspace %{workspace_root}))) - (rule - (target not_found.ml) - (action - (run %{bin:dream_eml} %{dep:not_found.eml} --workspace %{workspace_root}))) - (rule - (target package_documentation_not_found.ml) - (action - (run - %{bin:dream_eml} - %{dep:package_documentation_not_found.eml} - --workspace - %{workspace_root}))) - (rule - (target playground.ml) - (action - (run %{bin:dream_eml} %{dep:playground.eml} --workspace %{workspace_root}))) - (rule - (target page.ml) - (action - (run %{bin:dream_eml} %{dep:page.eml} --workspace %{workspace_root}))) - (rule - (target logos.ml) - (deps logos.eml) - (action - (run %{bin:dream_eml} %{dep:logos.eml} --workspace %{workspace_root}))) - (rule - (target cookbook.ml) - (deps cookbook.eml) - (action - (run %{bin:dream_eml} %{dep:cookbook.eml} --workspace %{workspace_root}))) - (rule - (target cookbook_task.ml) - (deps cookbook_task.eml) - (action - (run - %{bin:dream_eml} - %{dep:cookbook_task.eml} - --workspace - %{workspace_root}))) - (rule - (target cookbook_recipe.ml) - (deps cookbook_recipe.eml) - (action - (run - %{bin:dream_eml} - %{dep:cookbook_recipe.eml} - --workspace - %{workspace_root})))) - -(subdir - components/ - (rule - (target copy_to_clipboard.ml) - (action - (run - %{bin:dream_eml} - %{dep:copy_to_clipboard.eml} - --workspace - %{workspace_root}))) - (rule - (target footer.ml) - (action - (run %{bin:dream_eml} %{dep:footer.eml} --workspace %{workspace_root}))) - (rule - (target forms.ml) - (action - (run %{bin:dream_eml} %{dep:forms.eml} --workspace %{workspace_root}))) - (rule - (target header.ml) - (action - (run %{bin:dream_eml} %{dep:header.eml} --workspace %{workspace_root}))) - (rule - (target hero_section.ml) - (action - (run - %{bin:dream_eml} - %{dep:hero_section.eml} - --workspace - %{workspace_root}))) - (rule - (target navmap.ml) - (action - (run %{bin:dream_eml} %{dep:navmap.eml} --workspace %{workspace_root}))) - (rule - (target pagination.ml) - (action - (run %{bin:dream_eml} %{dep:pagination.eml} --workspace %{workspace_root}))) - (rule - (target search.ml) - (action - (run %{bin:dream_eml} %{dep:search.eml} --workspace %{workspace_root}))) - (rule - (target sidebar.ml) - (action - (run %{bin:dream_eml} %{dep:sidebar.eml} --workspace %{workspace_root}))) - (rule - (target toc.ml) - (action - (run %{bin:dream_eml} %{dep:toc.eml} --workspace %{workspace_root}))) - (rule - (target icons.ml) - (action - (run %{bin:dream_eml} %{dep:icons.eml} --workspace %{workspace_root}))) - (rule - (target package_breadcrumbs.ml) - (action - (run - %{bin:dream_eml} - %{dep:package_breadcrumbs.eml} - --workspace - %{workspace_root}))) - (rule - (target learn_components.ml) - (action - (run - %{bin:dream_eml} - %{dep:learn_components.eml} - --workspace - %{workspace_root}))) - (rule - (target tutorial_search.ml) - (action - (run - %{bin:dream_eml} - %{dep:tutorial_search.eml} - --workspace - %{workspace_root}))) - (rule - (target cards.ml) - (action - (run %{bin:dream_eml} %{dep:cards.eml} --workspace %{workspace_root}))))