Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- This file: -- http://anggtwu.net/SUBTITLES/2024-bash-test-blocks.lua.html -- http://anggtwu.net/SUBTITLES/2024-bash-test-blocks.lua -- (find-angg "SUBTITLES/2024-bash-test-blocks.lua") -- Author: Eduardo Ochs <eduardoochs@gmail.com> -- -- (defun l () (interactive) (find-angg "SUBTITLES/2024-bash-test-blocks.lua")) -- (defun l () (interactive) (find-SUBS "2024-bash-test-blocks.lua")) -- (defun b () (interactive) (find-TH "2024-bash-test-blocks")) -- (defun p () (interactive) (find-TH "2024-bash-test-blocks")) -- (defun R () (interactive) (ee-recompile-SUBTITLES-0)) -- (defun r () (interactive) (ee-recompile-SUBTITLES-3)) -- (defun r () (interactive) (ee-recompile-SUBTITLES-1)) -- (define-key eev-mode-map (kbd "M-r") 'r) -- -- Skel: (find-subs-links "2024bashtest") -- Old: (find-editeevsubtitles-links-1 "2024bashtest") -- (find-efunction 'find-editeevsubtitles-links-1) -- Yttr: (find-yttranscript-links "2024bashtest" "hok5wH4XBYg") -- Info: (find-1stclassvideo-links "2024bashtest") -- Play: (find-2024bashtestvideo "0:00") -- -- I use the code below to generate the subtitles in .vtt. -- ee_dofile "~/LUA/Subtitles.lua" -- (find-angg "LUA/Subtitles.lua") --[[ -- (find-angg "LUA/Subtitles.lua") ** Run the .lua and tell it to ** write the .vtt - by default in /tmp/ * * (eepitch-lua51) * (eepitch-kill) * (eepitch-lua51) dofile "2024-bash-test-blocks.lua" sts = Subtitles.fromsexps(subs_bigstr):addtime("7:12") -- sts.lang = "pt-BR" = sts outfname = "$S/http/anggtwu.net/eev-videos/2024-bash-test-blocks.vtt" outfname = "/tmp/2024-bash-test-blocks.vtt" out = sts:vtt().."\n\n" ee_writefile(outfname, out) -- (find-fline "/tmp/2024-bash-test-blocks.vtt") ** Test the .vtt ** (find-2024bashtestvideo "0:00") ** Select /tmp/ or ee-eevvideosdir ** (find-eevvideosfile "") ** (find-eevvideosfile "" "2024-bash-test-blocks.mp4") ** (find-eevvideossh0 "cp -v 2024-bash-test-blocks.mp4 /tmp/") ** (code-video "2024bashtestvideo" "/tmp/2024-bash-test-blocks.mp4") ** (code-video "2024bashtestvideo" "$S/http/anggtwu.net/eev-videos/2024-bash-test-blocks.mp4") ** (find-2024bashtestvideo "0:00") ** Upload the 2024-bash-test-blocks.vtt ** to http://anggtwu.net/eev-videos/ * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd /tmp/ scp 2024-bash-test-blocks.vtt $LINP/eev-videos/ scp 2024-bash-test-blocks.vtt $LINS/eev-videos/ Scp-np 2024-bash-test-blocks.vtt $TWUP/eev-videos/ Scp-np 2024-bash-test-blocks.vtt $TWUS/eev-videos/ ** Upload the subtitles to youtube ** http://www.youtube.com/watch?v=hok5wH4XBYg ** Check that the "psne subtitles" thing works ** (find-1stclassvideo-links "2024bashtest") --]] --[[ * (eepitch-lua51) * (eepitch-kill) * (eepitch-lua51) dofile "2024-bash-test-blocks.lua" for li in subs_bigstr:gmatch("([^\n]+)") do local time,text = li:match('^.-"(.-)".-"(.*)"%)$') text = text:gsub("\\(.)", "%1") if time then print(" "..time.." "..text) end end --]] subs_bigstr = [==[ % (find-2024bashtestvideo "0:00" "Hi! My name is Eduardo Ochs.") % (find-2024bashtestvideo "0:02" "I'm the author of an Emacs package called eev,") % (find-2024bashtestvideo "0:05" "and this video is associated to my") % (find-2024bashtestvideo "0:09" "presentation in the EmacsConf 2024...") % (find-2024bashtestvideo "0:12" "and the title of this video is:") % (find-2024bashtestvideo "0:15" "\"An example of a bash script with test blocks\".") % (find-2024bashtestvideo "0:19" "Eev is an obscure Emacs package") % (find-2024bashtestvideo "0:24" "that apparently makes very little sense") % (find-2024bashtestvideo "0:27" "for people in developed countries, and") % (find-2024bashtestvideo "0:30" "makes sense immediately to Brazilians...") % (find-2024bashtestvideo "0:32" "and one of the main themes of my") % (find-2024bashtestvideo "0:35" "presentation at the EmacsConf will be to") % (find-2024bashtestvideo "0:38" "explain that.") % (find-2024bashtestvideo "0:40" "Let me explain what is eev.") % (find-2024bashtestvideo "0:43" "First, an explanation in just three words,") % (find-2024bashtestvideo "0:46" "that is: \"Eev is WRONG\".") % (find-2024bashtestvideo "0:48" "Now an explanation in more words.") % (find-2024bashtestvideo "0:51" "Eev takes to the extreme the idea that code") % (find-2024bashtestvideo "0:55" "\"in production\" and code \"in a first system\",") % (find-2024bashtestvideo "0:58" "in the sense of \"The Mytical Man-Month\",") % (find-2024bashtestvideo "1:00" " can have very different styles...") % (find-2024bashtestvideo "1:07" "In this presentation I'm going to") % (find-2024bashtestvideo "1:10" "explain test blocks...") % (find-2024bashtestvideo "1:14" "most people in developed countries look at") % (find-2024bashtestvideo "1:16" "test blocks and immediately imagine their") % (find-2024bashtestvideo "1:19" "$EVILBOSS - their internalized $EVILBOSS -") % (find-2024bashtestvideo "1:22" "yelling to them: YOU CAN'T USE THAT IN") % (find-2024bashtestvideo "1:24" "PRODUCTION CODE! YOU'RE FIRED!") % (find-2024bashtestvideo "1:27" "In this video we are going to") % (find-2024bashtestvideo "1:29" "see how to play with existing test") % (find-2024bashtestvideo "1:31" "blocks by downloading a file with test") % (find-2024bashtestvideo "1:34" "blocks in /tmp/...") % (find-2024bashtestvideo "1:36" "because writing your own test blocks") % (find-2024bashtestvideo "1:39" "takes more time, and more imagination,") % (find-2024bashtestvideo "1:41" "and for people in developed countries") % (find-2024bashtestvideo "1:45" "it has a high psychological cost,") % (find-2024bashtestvideo "1:47" "because they feel that test blocks") % (find-2024bashtestvideo "1:49" "are wrong.") % (find-2024bashtestvideo "1:51" "The example is in this link here,") % (find-2024bashtestvideo "1:53" "in this page...") % (find-2024bashtestvideo "1:56" "in a section called \"Try it!\".") % (find-2024bashtestvideo "2:02" "We just need to copy the eepitch block") % (find-2024bashtestvideo "2:06" "below to a buffer in Emacs - let me do that...") % (find-2024bashtestvideo "2:11" "we can copy it to any read-write buffer...") % (find-2024bashtestvideo "2:15" "let me copy it to the end of this org file...") % (find-2024bashtestvideo "2:18" "I can either copy it in the obvious way") % (find-2024bashtestvideo "2:21" "or I can create a comment block") % (find-2024bashtestvideo "2:25" "and copy it to the comment block.") % (find-2024bashtestvideo "2:28" "And now we need to run this thing here...") % (find-2024bashtestvideo "2:31" "by the way, note that these things here") % (find-2024bashtestvideo "2:34" "are not red stars... they are red bullets,") % (find-2024bashtestvideo "2:37" "but bullets are equivalent to red stars") % (find-2024bashtestvideo "2:40" "in eev, and the explanation for that") % (find-2024bashtestvideo "2:45" "is here, in the docstring for the variable") % (find-2024bashtestvideo "2:49" "`eepitch-regexp'. Anyway...") % (find-2024bashtestvideo "2:55" "I will need to switch to a smaller font.") % (find-2024bashtestvideo "2:58" "If I execute this it downloads") % (find-2024bashtestvideo "3:01" "a certain file in the directory /tmp/,") % (find-2024bashtestvideo "3:05" "it changes the the mode of that file") % (find-2024bashtestvideo "3:08" "to executable,") % (find-2024bashtestvideo "3:10" "and if I execute this sexp hers") % (find-2024bashtestvideo "3:12" "I go to the top of that file....") % (find-2024bashtestvideo "3:15" "it has many explanations here,") % (find-2024bashtestvideo "3:19" "but my suggestion is: in the first") % (find-2024bashtestvideo "3:23" "moment just go to the test blocks -") % (find-2024bashtestvideo "3:26" "for example, this one -") % (find-2024bashtestvideo "3:28" "and execute the test block, and...") % (find-2024bashtestvideo "3:31" "just check that everything works -") % (find-2024bashtestvideo "3:35" "just check that there are no error messages,") % (find-2024bashtestvideo "3:36" "and that it does something interesting") % (find-2024bashtestvideo "3:38" "that we don't understand yet.") % (find-2024bashtestvideo "3:41" "So, it has links to three test blocks...") % (find-2024bashtestvideo "3:44" "this is the second one and this is") % (find-2024bashtestvideo "3:49" "the third one, at the end of the file...") % (find-2024bashtestvideo "3:52" "and in a second moment we can open") % (find-2024bashtestvideo "3:56" "the file again and read the comments...") % (find-2024bashtestvideo "4:00" "and the most important comment is here -") % (find-2024bashtestvideo "4:02" "it explains that many of the functions") % (find-2024bashtestvideo "4:07" "in this file behave differently") % (find-2024bashtestvideo "4:09" "if we set the variable ECHO...") % (find-2024bashtestvideo "4:14" "if we use this thing here, ECHO=echo,") % (find-2024bashtestvideo "4:22" "then this thing") % (find-2024bashtestvideo "4:28" "echoes the commandandargs instead of") % (find-2024bashtestvideo "4:29" "running the commandandargs...") % (find-2024bashtestvideo "4:31" "and if we do ECHO=and_run commandandargs") % (find-2024bashtestvideo "4:37" "then the function echoes the commandandargs") % (find-2024bashtestvideo "4:40" "and runs the commandandargs.") % (find-2024bashtestvideo "4:43" "Let's take a look at the test blocks again.") % (find-2024bashtestvideo "4:47" "Note that in all these lines here...") % (find-2024bashtestvideo "4:50" "they start with ECHO=echo, that makes it") % (find-2024bashtestvideo "5:00" "just echo the external commmands") % (find-2024bashtestvideo "5:03" "that it would run...") % (find-2024bashtestvideo "5:10" "it does some very basic tests here") % (find-2024bashtestvideo "5:13" "and then this line here shows what") % (find-2024bashtestvideo "5:16" "the commmand makeflipbook would run...") % (find-2024bashtestvideo "5:19" "it would call an external command") % (find-2024bashtestvideo "5:22" "called qpdf...") % (find-2024bashtestvideo "5:22" "and this one shows that makeanim") % (find-2024bashtestvideo "5:27" "would run this thing, here that") % (find-2024bashtestvideo "5:29" "would call convert, that is a program") % (find-2024bashtestvideo "5:32" "that comes with ImageMagick...") % (find-2024bashtestvideo "5:33" "and this last one here would run") % (find-2024bashtestvideo "5:38" "two commands, makeflip and makeanim...") % (find-2024bashtestvideo "5:40" "And that's it. I think that it's better") % (find-2024bashtestvideo "5:43" "to stop the video here...") % (find-2024bashtestvideo "5:45" "for more information please see the page") % (find-2024bashtestvideo "5:48" "of the video. That's it! Bye...") % (find-2024bashtestvideo "5:50" "No, no, sorry! Not Bye yet...") % (find-2024bashtestvideo "5:55" "I forgot that this page here also mentions") % (find-2024bashtestvideo "5:58" "the trick that I use") % (find-2024bashtestvideo "6:02" "for remembering these obscure tricks") % (find-2024bashtestvideo "6:06" "with variables in bash...") % (find-2024bashtestvideo "6:09" "and the trick is that my bash file has some") % (find-2024bashtestvideo "6:13" "links like this, that go to the manual") % (find-2024bashtestvideo "6:15" "of Bash, to a certain position") % (find-2024bashtestvideo "6:19" "in the manual... if we run these links -") % (find-2024bashtestvideo "6:21" "if we open these links in the browser") % (find-2024bashtestvideo "6:24" "it just opens a certain page, like this,") % (find-2024bashtestvideo "6:28" "but if we open these links in the...") % (find-2024bashtestvideo "6:38" "for example, here... it opens the page") % (find-2024bashtestvideo "6:42" "of the bash manual and it searches") % (find-2024bashtestvideo "6:45" "for the first occurrence of") % (find-2024bashtestvideo "6:47" "this string here...") % (find-2024bashtestvideo "6:49" "so where are we here,") % (find-2024bashtestvideo "6:52" "parameter assignments...") % (find-2024bashtestvideo "6:52" "and it explains something about") % (find-2024bashtestvideo "6:55" "parameter assignments...") % (find-2024bashtestvideo "6:58" "then this one here goes to an example -") % (find-2024bashtestvideo "7:00" "that also includes the output") % (find-2024bashtestvideo "7:03" "of the example... and so on.") % (find-2024bashtestvideo "7:09" "And that's it! Bye!") ]==] unrevised_bigstr = [==[ (find-2024bashtestvideo "00:00" " ") ]==] -- Local Variables: -- coding: utf-8-unix -- End: