Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fc1943s committed May 15, 2024
1 parent b11a4cb commit 54fb1a4
Show file tree
Hide file tree
Showing 7 changed files with 4,194 additions and 24,817 deletions.
4 changes: 2 additions & 2 deletions apps/documents/documents.dib
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ let crowbook hangul { ext dist_dir dist_path output_path } =
match ext with
| "html" =>
$'$"--set"'
+. $'$" html.css.add \\\\\\"\' body {{ color: #e8e6e3; background-color: #202324; }} a {{ color: #989693; }} \'\\\\\\""'
+. $'$" html.css.add \\\\\\"\' body {{ color: #e8e6e3; background-color: #202324; }} a {{ color: #989693; }} pre {{ background-color: #1b1b1b; padding: 10px; }} \'\\\\\\""'
+. default ext
| "pdf" =>
$'$"--set"'
Expand All @@ -108,6 +108,7 @@ let crowbook hangul { ext dist_dir dist_path output_path } =
$'$" tex.template.add \\\"\\\\usepackage{{polyglossia}}\\\""'
+. $'$" tex.template.add \\\"\\\\setmainlanguage{{korean}}\\\""'
+. $'$" tex.template.add \\\"\\\\setmainfont{{NanumGothicCoding}}\\\""'
+. $'$" tex.font.size 12"'
)
+. default ext
| "epub" =>
Expand Down Expand Up @@ -455,7 +456,6 @@ let run { source_dir dist_dir cache_dir hangul_spec }
#!spiral

//// test
//// print_code=false
///! rust -d async-walkdir encoding_rs encoding_rs_io futures-lite rayon regex sha2

types ()
Expand Down
10,837 changes: 142 additions & 10,695 deletions apps/documents/documents.dib.html

Large diffs are not rendered by default.

10,777 changes: 142 additions & 10,635 deletions apps/documents/documents.dib.ipynb

Large diffs are not rendered by default.

4,562 changes: 2,362 additions & 2,200 deletions apps/documents/documents.fsx

Large diffs are not rendered by default.

2,783 changes: 1,508 additions & 1,275 deletions apps/documents/documents.rs

Large diffs are not rendered by default.

47 changes: 38 additions & 9 deletions apps/documents/documents.spi
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,40 @@ let get_command () =
)

/// ## crowbook
let crowbook { ext dist_dir dist_path output_path } =

let crowbook hangul { ext dist_dir dist_path output_path } =
inl exit_code, result =
inl args =
inl default ext =
$'$" rendering.num_depth 6"'
+. $'$" rendering.highlight.theme \\\\\\"Solarized (dark)\\\\\\""'
match ext with
| "html" =>
$'$"--set"'
+. $'$" html.css.add \\\\\\"\' body {{ color: #e8e6e3; background-color: #202324; }} a {{ color: #989693; }} pre {{ background-color: #1b1b1b; padding: 10px; }} \'\\\\\\""'
+. default ext
| "pdf" =>
$'$"--set"'
+. $'$" tex.paper.size a4paper"'
+. (
if hangul |> not
then ""
else
$'$" tex.template.add \\\"\\\\usepackage{{polyglossia}}\\\""'
+. $'$" tex.template.add \\\"\\\\setmainlanguage{{korean}}\\\""'
+. $'$" tex.template.add \\\"\\\\setmainfont{{NanumGothicCoding}}\\\""'
+. $'$" tex.font.size 12"'
)
+. default ext
| "epub" =>
$'$"--set"'
+. $'$" epub.version 3"'
+. $'$" html.css.add \\\\\\"\' body {{ color: #e8e6e3; background-color: #202324; }} a {{ color: #989693; }} \'\\\\\\""'
+. default ext
| _ => ""
runtime.execution_options fun x => { x with
command = $'$"crowbook --single \\\"{!dist_path}\\\" --output \\\"{!output_path}\\\" --to {!ext} --set rendering.num_depth 6 html.css.add \\\\\\"\' body {{ color: #e8e6e3; background-color: #202324; }} a {{ color: #989693; }} \'\\\\\\""'
command =
$'$"crowbook --verbose --to {!ext}"'
+. $'$" --single \\\"{!dist_path}\\\" --output \\\"{!output_path}\\\" {!args}"'
working_directory = dist_dir |> Some |> optionm'.box
}
|> runtime.execute_with_options
Expand Down Expand Up @@ -293,12 +322,12 @@ let run { source_dir dist_dir cache_dir hangul_spec }
inl { output_path } = fix_paths { dist_path cache_dir ext = "hangul.md" }

inl files' = [
"html", dist_path, crowbook |> files_fn
"pdf", dist_path, crowbook |> files_fn
"epub", dist_path, crowbook |> files_fn
"html", output_path, crowbook |> files_fn
"pdf", output_path, crowbook |> files_fn
"epub", output_path, crowbook |> files_fn
"html", dist_path, crowbook false |> files_fn
"pdf", dist_path, crowbook false |> files_fn
"epub", dist_path, crowbook false |> files_fn
"html", output_path, crowbook true |> files_fn
"pdf", output_path, crowbook true |> files_fn
"epub", output_path, crowbook true |> files_fn
]

[ files; files' ]
Expand Down
1 change: 0 additions & 1 deletion scripts/init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ if (!$fast) {
{ pwsh ../../polyglot/apps/builder/build.ps1 -fast 1 } | Invoke-Block
{ pwsh ../../polyglot/apps/parser/build.ps1 -fast 1 } | Invoke-Block
{ pwsh ../../polyglot/apps/spiral/build.ps1 -fast 1 } | Invoke-Block
{ pwsh ../../polyglot/lib/rust/fable/build.ps1 } | Invoke-Block
{ pwsh ../../polyglot/apps/spiral/builder/build.ps1 -fast 1 } | Invoke-Block
{ pwsh ../../polyglot/apps/dir-tree-html/build.ps1 -fast 1 } | Invoke-Block

Expand Down

0 comments on commit 54fb1a4

Please sign in to comment.