enhance: add mldoc ast schema (#8829)

* enhance: add mldoc ast schema

* Add bb task to validate mldoc

Also move mldoc schema to make room for other schemas

---------

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
This commit is contained in:
rcmerci
2023-03-20 13:41:13 +08:00
committed by GitHub
parent 988a00e266
commit c3f7417682
7 changed files with 262 additions and 6 deletions

View File

@@ -7,6 +7,7 @@
[frontend.handler.export.common :as common :refer
[*state* indent newline* raw-text simple-ast-malli-schema
simple-asts->string space]]
[logseq.graph-parser.schema.mldoc :as mldoc-schema]
[frontend.state :as state]
[frontend.util :as util :refer [concatv mapcatv removev]]
[goog.dom :as gdom]
@@ -320,7 +321,7 @@
(indent-with-2-spaces (dec current-level)))))])
;; {:malli/schema ...} only works on public vars, so use m/=> here
(m/=> block-ast->simple-ast [:=> [:cat [:sequential :any]] [:sequential simple-ast-malli-schema]])
(m/=> block-ast->simple-ast [:=> [:cat mldoc-schema/block-ast-schema] [:sequential simple-ast-malli-schema]])
(defn- block-ast->simple-ast
[block]
(let [newline-after-block? (get-in *state* [:export-options :newline-after-block])]