fully tested md_files

This commit is contained in:
Lesenechal Remi 2019-12-26 14:22:13 +01:00
parent eac5e9b82e
commit c171ce7ad9
2 changed files with 8 additions and 30 deletions

View File

@ -17,7 +17,7 @@
(alias
(name doc-test)
(action (run ./doc_test.exe))
(deps (source_tree ../../gitlab-pages/docs/language-basics))
(deps (source_tree ../../gitlab-pages/docs))
)
(alias

View File

@ -5,11 +5,8 @@ module SnippetsGroup = Map.Make(struct type t = (string * string) let compare a
let failed_to_compile_md_file md_file (s,group,prg) =
let title () = "Failed to compile ```"^s^" block (group '"^group^"') in file '"^md_file^"'" in
let content () = "unable to compile the program down to michelson" in
let data = [
("source" , fun () -> Format.asprintf "%s" prg) ;
] in
error ~data title content
let content () = "\n"^prg in
error title content
(**
binds the snippets by (syntax, group_name)
@ -34,6 +31,7 @@ let get_groups md_file =
| None -> Some (String.concat "\n" el.contents)
)
grp_map
| [Md.Field "skip"] -> grp_map
| _ ->
List.fold_left
(fun grp_map arg -> match arg with
@ -57,8 +55,8 @@ let get_groups md_file =
**)
let compile_groups _filename grp_list =
let%bind (_michelsons : Compiler.compiled_expression list list) = bind_map_list
(fun ((s,_grp),contents) ->
trace (failed_to_compile_md_file _filename (s,_grp,contents)) @@
(fun ((s,grp),contents) ->
trace (failed_to_compile_md_file _filename (s,grp,contents)) @@
let%bind v_syntax = Compile.Helpers.syntax_to_variant (Syntax_name s) None in
let%bind simplified = Compile.Of_source.compile_string contents v_syntax in
let%bind typed,_ = Compile.Of_simplified.compile simplified in
@ -79,24 +77,19 @@ let compile filename () =
find ./gitlab-pages/ -iname "*.md"
*)
let md_files = [
(*
"/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-smart-contract.md";
"/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-payout.md";
"/gitlab-pages/docs/intro/installation.md";
"/gitlab-pages/docs/intro/editor-support.md";
"/gitlab-pages/docs/intro/what-and-why.md";
"/gitlab-pages/docs/language-basics/functions.md";
"/gitlab-pages/docs/language-basics/math-numbers-tez.md";
*)
(* antislash problem:
"/gitlab-pages/docs/language-basics/strings.md";
"/gitlab-pages/docs/language-basics/functions.md";
"/gitlab-pages/docs/language-basics/boolean-if-else.md";
"/gitlab-pages/docs/language-basics/types.md";
*)
"/gitlab-pages/docs/language-basics/strings.md";
"/gitlab-pages/docs/language-basics/maps-records.md";
"/gitlab-pages/docs/language-basics/variables-and-constants.md";
"/gitlab-pages/docs/language-basics/sets-lists-touples.md";
(*
"/gitlab-pages/docs/language-basics/operators.md";
"/gitlab-pages/docs/language-basics/unit-option-pattern-matching.md";
"/gitlab-pages/docs/contributors/big-picture/back-end.md";
@ -116,21 +109,6 @@ let md_files = [
"/gitlab-pages/docs/advanced/timestamps-addresses.md";
"/gitlab-pages/docs/api/cli-commands.md";
"/gitlab-pages/docs/api/cheat-sheet.md";
"/gitlab-pages/website/blog/2019-07-11-ligo-update.md";
"/gitlab-pages/website/blog/2019-06-13-public-launch-of-ligo.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/back-end.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/vendors.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/front-end.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/overview.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/middle-end.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/philosophy.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/road-map/short-term.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/road-map/long-term.md";
"/gitlab-pages/website/versioned_docs/version-next/contributors/origin.md";
"/gitlab-pages/website/versioned_docs/version-next/api-cli-commands.md";
"/gitlab-pages/website/README.md";
"/gitlab-pages/README.md";
*)
]
let md_root = "../../gitlab-pages/docs/language-basics/"