simple-learning

Simple learning web program
git clone git://git.laack.co/simple-learning.git
Log | Files | Refs | README | LICENSE

commit ee7063edf46bea5ece0c5135b1dce6cacbc418dc
parent 37abe390f197109fc35619de066e2170bddd16fa
Author: Andrew Laack <andrew@laack.co>
Date:   Fri, 28 Aug 2026 23:35:25 -0500

Started working on conversion tool to make course conversions from simple md easier

Diffstat:
Amd-to-sl/README.md | 3+++
Mmd-to-sl/bin/main.ml | 36+++++++++++++++++++++++++++++++++++-
Amd-to-sl/test.md | 15+++++++++++++++
3 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/md-to-sl/README.md b/md-to-sl/README.md @@ -0,0 +1,3 @@ +# MD -> SL + +This is an attempt to convert MD files to SL files. This is not going to work for all markdown files. This exists so I can convert files from md -> sl and then do minor changes to make them work nicely as courses. diff --git a/md-to-sl/bin/main.ml b/md-to-sl/bin/main.ml @@ -1 +1,35 @@ -let () = print_endline "Hello, World!" + +let verify_file_exists filename = + Sys.file_exists filename + +let read_file filename = + let ic = open_in filename in + + let rec go acc = + try + let line = input_line ic in + if acc = "" then go line else go (acc ^ "\n" ^ line) + with e -> close_in_noerr ic; acc + in go "" + + +let output_file = ref "" +let input_file = ref "" + +let arguments = [ + ("-o", Arg.Set_string output_file, "Set output file name"); + ("-i", Arg.Set_string input_file, "Set input file name"); +] + +let handle_missing_file () = + print_endline ("Unable to find file " ^ input_file.contents ^ "."); + exit (-1) + +let anon_fun _ = () +let usage_msg = "md-to-sl -i <input_file> -o <output_file>" + +let () = Arg.parse arguments anon_fun usage_msg + +let () = if verify_file_exists input_file.contents then () else handle_missing_file () + +let () = print_endline (read_file input_file.contents) diff --git a/md-to-sl/test.md b/md-to-sl/test.md @@ -0,0 +1,15 @@ +# This is a test + +testing +iearsntoiar +st +anrsto +rst +rst +iearsntoiresnrstoi ernstoi rnts iset0)(70)(7 0(w9[] ][09287894231ar]) +ars +tar +st + + +arsotinar oisnorsitrsotiernts ien [oist](oist.md)