~etalab/code.gouv.fr

code.gouv.fr/src/codegouvfr/macros.clj -rw-r--r-- 486 bytes
0b117f3aBastien Guerry Add alert and link to the code.gouv.fr form 3 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(ns codegouvfr.macros
  (:require [clojure.java.io :as io]
            [clojure.walk :as walk]
            [markdown-to-hiccup.core :as md]))

(defmacro inline-page [page]
  [:div.fr-container.fr-grid.fr-grid--row
   [:div.fr-col-10.fr-col-md-10
    (->> (str "public/md/" page)
         io/resource
         slurp
         md/md->hiccup
         md/component
         (walk/prewalk-replace
          {:h2 :h2.fr-h2.fr-mt-3w
           :p  :p.fr-my-3w
           :li :li.fr-ml-2w}))]])