From 98dc4fa3c57c30b437fa064ae04ed29bcc59a623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bourgois?= Date: Sun, 1 Aug 2021 14:45:37 +0200 Subject: [PATCH] up --- docs/404.html | 15 ++++++ docs/bootstrap.js | 2 +- docs/{ => examples}/000_hello_world.gf | 0 docs/{ => examples}/001_hello_someone.gf | 0 docs/{ => examples}/002_drive_alone.gf | 0 docs/{ => examples}/003_high_up.gf | 0 docs/flags/flag-france.png | Bin 0 -> 443 bytes docs/flags/flag-united-kingdom.png | Bin 0 -> 1512 bytes docs/index_dark.css | 8 +++ docs/index_light.css | 8 +++ front/examples/000_hello_world.gf.test | 16 ------ front/examples/001_hello_someone.gf.test | 26 ---------- .../examples_test/000_hello_world.test.gf | 0 .../examples_test/001_hello_someone.test.gf | 0 front/src/flow/format.rs | 8 +-- .../{ => static}/examples/000_hello_world.gf | 0 .../examples/001_hello_someone.gf | 0 .../{ => static}/examples/002_drive_alone.gf | 0 front/{ => static}/examples/003_high_up.gf | 0 front/webpack.config.js | 9 +++- mir/src/main.rs | 49 +++++++++++++++++- 21 files changed, 92 insertions(+), 49 deletions(-) create mode 100644 docs/404.html rename docs/{ => examples}/000_hello_world.gf (100%) rename docs/{ => examples}/001_hello_someone.gf (100%) rename docs/{ => examples}/002_drive_alone.gf (100%) rename docs/{ => examples}/003_high_up.gf (100%) create mode 100644 docs/flags/flag-france.png create mode 100644 docs/flags/flag-united-kingdom.png create mode 100644 docs/index_dark.css create mode 100644 docs/index_light.css delete mode 100644 front/examples/000_hello_world.gf.test delete mode 100644 front/examples/001_hello_someone.gf.test rename docs/000_hello_world.gf.test => front/examples_test/000_hello_world.test.gf (100%) rename docs/001_hello_someone.gf.test => front/examples_test/001_hello_someone.test.gf (100%) rename front/{ => static}/examples/000_hello_world.gf (100%) rename front/{ => static}/examples/001_hello_someone.gf (100%) rename front/{ => static}/examples/002_drive_alone.gf (100%) rename front/{ => static}/examples/003_high_up.gf (100%) diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..8e1c949 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,15 @@ + + + + + Gouttelettes + + + + + + + + + + diff --git a/docs/bootstrap.js b/docs/bootstrap.js index 44d3522..327a287 100644 --- a/docs/bootstrap.js +++ b/docs/bootstrap.js @@ -483,4 +483,4 @@ eval("// A dependency graph that contains any wasm must all be imported\n// asyn /***/ }) -/******/ }); +/******/ }); \ No newline at end of file diff --git a/docs/000_hello_world.gf b/docs/examples/000_hello_world.gf similarity index 100% rename from docs/000_hello_world.gf rename to docs/examples/000_hello_world.gf diff --git a/docs/001_hello_someone.gf b/docs/examples/001_hello_someone.gf similarity index 100% rename from docs/001_hello_someone.gf rename to docs/examples/001_hello_someone.gf diff --git a/docs/002_drive_alone.gf b/docs/examples/002_drive_alone.gf similarity index 100% rename from docs/002_drive_alone.gf rename to docs/examples/002_drive_alone.gf diff --git a/docs/003_high_up.gf b/docs/examples/003_high_up.gf similarity index 100% rename from docs/003_high_up.gf rename to docs/examples/003_high_up.gf diff --git a/docs/flags/flag-france.png b/docs/flags/flag-france.png new file mode 100644 index 0000000000000000000000000000000000000000..0802afa5fec119da4829820fde3b3dac784131e9 GIT binary patch literal 443 zcmeAS@N?(olHy`uVBq!ia0y~yU~~Youd*-$$ty`FcYzd3x}&cn1H;CC?mvmFK)yn< zN02WALzNl>LqiJ#!!Mvv!wUw6QUeBtR|yOZRx=nF#0%!^3bX-A@CW#WxH2eD4awf| z|NsBb1=VjgEw?*%g7h#ZdAqwXrE%A!06FX>p1!W^4>`CvCFCrRgii+wt@Lzp45_&F z_MD?2g8~ophO8MZ8=C5UD_*>vso`;HM(~dHf{p_Z4jz5L&UIqZ(e}5udVr2rEpd$~ zNl7e8wMs5Z1yT$~28QOk1{S)81|bHPRz@aP#s=C3237_JC#@F$MA49&pOTqYiCe>t SbZJ+h1_n=8KbLh*2~7Z*gneZI literal 0 HcmV?d00001 diff --git a/docs/flags/flag-united-kingdom.png b/docs/flags/flag-united-kingdom.png new file mode 100644 index 0000000000000000000000000000000000000000..76499d8c4155566113f32a323cdf0c9194ab0bdf GIT binary patch literal 1512 zcmZ`(YdDl?7=FL`=42RV7>7nCBZZ=w=|n0SW`;?okwmn7BZq1WNjXIO$xt~gtGY@% zZ8mLfs2$bHp%`lA5UQ={poZ$AqA5C%F|*&=Kf6En&-*<0^W69QzR!JK?|Vop@u5?>FY0OX0~rDPaeS7!(>VgVn^_vZspRcNS{5io4K*>{~k0BLgpK;-~@#Y*T9 z0K2&Wyg>kPKMsIpf}$>91=f&D*Q^&l@Ckq4cuTL>Pfh8{fA4e>WJ2t%71dp>v;}q^ z=_O}xOlqe-_dIJj>c;yzonEKY z^$on$j*g9W{y9=rKccMr(A@s@&B%*E&E$w?^pDPws=CqE?#cHbMsIcXNMm|~w|~6z z&~`<3J$4@`($7bLi!n@(!T>2r>@Os}Frd>Zv$cIqHQ1;!v4FomobtRgZUeV8Dv*WJ1UqM?!CN zGORozB`XUwCMqwl8LABpji7@p1WzV(kh9$pFx>wm*tEc;@SXty#E;sXQb?*-&dEyc zifT?&H9WgYP{jM&I}?XTGQw0#<4t8w$ak72xXng2 zDhi{{V|L=Bg7=r_>;e-(rI&UtMMQ*OB`E3m;gyVH1jJ-aNPDRR(3tTmsT<7)j?uyL z=JTG;$U7%1hD0a zD>k(uR_>j7*T`4Aho&6O3?bRF``N0;K9{~h`^6?;g9&8_ZzQ>9t=t!~+7;O{dJ?6; zWkdiQbf5%<y2bPFbS3I{OKSB`$!5Af z#GP&)m}a;eP19u4T;pkN62{I&S;%X8`M>rdE=D{M?HRNBfxgMM8Q9a&GN^84zto5w zPM=%($oy2}nl#0}sg|M4MWJ~oJ`3_Vah6?na*K$UJnjLSX?oV-!XQ&Gl!JV&clRQ{ z&t9Vn5t5;XQYX)E$!wM7QiB}?Hhvs;j^E`V2N6Spr;p?`wc$?`k7G1kdVd~03KJJ9 zXNp)D%hB*s6di+C?4`yS+>*C0nufs|XXYu4d_Q}l7t_w>P}}Cn!K{p(>*lf<#cEDr zM+b{i&u_tXR#Hk6Y`ZqvDFO)$3E`5(`PlWi?859uH;xwj0J zEJf_u8|c=d7hJuwhVMaNzPP?U-X8F5G8dGkvF%07W1xk0I%Uv>kl*{m&+p4UZPY0o zY;GsDW52Pg?8a*o#Z0sDTxgK~&Xk|3F#|JSXVcVXU>Gy!6dvJVQwzW(W}E}u>rI9{ z*s494sbZ)ab7`%SvH-Io5p}^_FvBa>9( display.salutation diff --git a/front/examples/001_hello_someone.gf.test b/front/examples/001_hello_someone.gf.test deleted file mode 100644 index cdd6b9f..0000000 --- a/front/examples/001_hello_someone.gf.test +++ /dev/null @@ -1,26 +0,0 @@ -display_input - name - title - english - Name - french - Nom -display - personal_salutation - title - english - Greeting - french - Salutation -function - hello_someone - input - name - output - english - Hello {name}! - french - Bonjour {name} ! -graph - input.name -> function.hello_someone - function.hello_someone -> display.personal_salutation diff --git a/docs/000_hello_world.gf.test b/front/examples_test/000_hello_world.test.gf similarity index 100% rename from docs/000_hello_world.gf.test rename to front/examples_test/000_hello_world.test.gf diff --git a/docs/001_hello_someone.gf.test b/front/examples_test/001_hello_someone.test.gf similarity index 100% rename from docs/001_hello_someone.gf.test rename to front/examples_test/001_hello_someone.test.gf diff --git a/front/src/flow/format.rs b/front/src/flow/format.rs index 061cba0..69572a3 100644 --- a/front/src/flow/format.rs +++ b/front/src/flow/format.rs @@ -103,12 +103,12 @@ pub fn format_flow_as_yaml(x: &str) -> String { fn test_format_flow() { let examples = vec!["000_hello_world", "001_hello_someone"]; for example in examples { - let content = read_to_string(format!("examples/{}.gf", example)) + let content = read_to_string(format!("static/examples/{}.gf", example)) .expect("Something went wrong reading the file"); let content_flat = read_to_string(format!("examples_flat/{}.gf", example)) .expect("Something went wrong reading the file"); write( - format!("examples/{}.gf.test", example), + format!("examples_test/{}.test.gf", example), format_flow(&content_flat), ) .unwrap(); @@ -119,7 +119,7 @@ fn test_format_flow() { fn test_flatten() { let examples = vec!["000_hello_world", "001_hello_someone"]; for example in examples { - let content = read_to_string(format!("examples/{}.gf", example)) + let content = read_to_string(format!("static/examples/{}.gf", example)) .expect("Something went wrong reading the file"); let content_flat = read_to_string(format!("examples_flat/{}.gf", example)) .expect("Something went wrong reading the file"); @@ -135,7 +135,7 @@ fn test_flatten() { fn test_format_flow_as_yaml() { let examples = vec!["000_hello_world", "001_hello_someone"]; for example in examples { - let content = read_to_string(format!("examples/{}.gf", example)) + let content = read_to_string(format!("static/examples/{}.gf", example)) .expect("Something went wrong reading the file"); let content_yaml = read_to_string(format!("examples_yaml/{}.yaml", example)) .expect("Something went wrong reading the file"); diff --git a/front/examples/000_hello_world.gf b/front/static/examples/000_hello_world.gf similarity index 100% rename from front/examples/000_hello_world.gf rename to front/static/examples/000_hello_world.gf diff --git a/front/examples/001_hello_someone.gf b/front/static/examples/001_hello_someone.gf similarity index 100% rename from front/examples/001_hello_someone.gf rename to front/static/examples/001_hello_someone.gf diff --git a/front/examples/002_drive_alone.gf b/front/static/examples/002_drive_alone.gf similarity index 100% rename from front/examples/002_drive_alone.gf rename to front/static/examples/002_drive_alone.gf diff --git a/front/examples/003_high_up.gf b/front/static/examples/003_high_up.gf similarity index 100% rename from front/examples/003_high_up.gf rename to front/static/examples/003_high_up.gf diff --git a/front/webpack.config.js b/front/webpack.config.js index b6eb500..5a77f35 100644 --- a/front/webpack.config.js +++ b/front/webpack.config.js @@ -13,7 +13,14 @@ module.exports = { }, mode: "development", plugins: [ - new CopyWebpackPlugin(['index.html', 'favicon.svg', 'examples', 'index.css']) + new CopyWebpackPlugin([ + 'index.html', + 'favicon.svg', + 'static', + 'index.css', + 'index_dark.css', + 'index_light.css' + ]) ], devServer: { // reference: https://webpack.js.org/configuration/dev-server/#devserverhttps diff --git a/mir/src/main.rs b/mir/src/main.rs index 2268b00..1372e53 100644 --- a/mir/src/main.rs +++ b/mir/src/main.rs @@ -65,7 +65,7 @@ fn release() -> bool { == 0 { println!("[ok] webpack"); - return copy_release(); + return delete_release(); } else { println!("[error] webpack"); } @@ -74,12 +74,59 @@ fn release() -> bool { } return false; } +fn delete_release() -> bool { + if let Ok(mut child) = Command::new("rm") + .arg("-r") + .arg("-f") + .arg("/Users/loicbourgois/github.com/gouttelettes/gouttelettes/docs") + .spawn() + { + if child + .wait() + .expect("rm wasn't running") + .code() + .unwrap() + == 0 + { + println!("[ok] rm"); + return copy_release(); + } else { + println!("[error] rm"); + } + } else { + println!("rm didn't start"); + } + return false; +} fn copy_release() -> bool { if let Ok(mut child) = Command::new("cp") .arg("-R") .arg("/Users/loicbourgois/github.com/gouttelettes/gouttelettes/front/dist") .arg("/Users/loicbourgois/github.com/gouttelettes/gouttelettes/docs") .spawn() + { + if child + .wait() + .expect("cp wasn't running") + .code() + .unwrap() + == 0 + { + println!("[ok] cp"); + return copy_404(); + } else { + println!("[error] cp"); + } + } else { + println!("cp didn't start"); + } + return false; +} +fn copy_404() -> bool { + if let Ok(mut child) = Command::new("cp") + .arg("/Users/loicbourgois/github.com/gouttelettes/gouttelettes/docs/index.html") + .arg("/Users/loicbourgois/github.com/gouttelettes/gouttelettes/docs/404.html") + .spawn() { if child .wait()