from sikuli import *
import sys
if not "../editor.sikuli" in sys.path:
sys.path.append( "../editor.sikuli" )
from editor import *
set_typing_speed( 80 )
file_open()
type( Key.UP, Key.ALT )
wait( 0.5 )
home()
wait( 0.25 )
enter()
wait( 1 )
end()
wait( 0.25 )
enter()
wait( 1 )
set_typing_speed( 200 )
paragraph()
heading( "What text formats are supported?" )
typer( "Scr" )
autoinsert()
typer( " supports Markdown, R Markdown, XML, and R XML; however, the software " )
typer( "architecture enables it to easily add new formats. The following figure " )
typer( "depicts the overall architecture: " )
paragraph()
typer( "" )
paragraph()
typer( "Many text editors can only open one type of plain text markup format that is " )
typer( "only output as HTML. With a little more effort, text editors could support " )
typer( "multiple input and output formats. Scr" )
autoinsert()
typer( " does so and goes one step further by introducing interpolated definitions." )
paragraph()
typer( "Kitten interlude:" )
paragraph()
typer( "" )
paragraph()
heading( "What is R?" )
typer( "R is a programming language. You might have noticed a few potential grammar " )
typer( "problems with direct substitution. Rules for possessive forms, numbers, and " )
typer( "other quirks can be tackled using R." )
type( Key.END, Key.CTRL )
paragraph()
set_typing_speed( 300 )
heading( "How is R used?" )
typer( "R must be instructed where to find script files and what ones to load. The " )
typer( "*working directory* is the full path to those R files; the *startup script* " )
typer( "defines what R files to load. Both preferences must be changed before prose " )
typer( "may be processed. Preferences can be opened using either the " )
typeln( "**Edit > Preferences** menu or by pressing `Ctrl+Alt+s`. Here goes!" )
wait( 2 )
type( "s", Key.CTRL + Key.ALT )
wait("1594592396134.png", 1)
click("1594592396134.png")
wait( 0.5 )
type( Key.UP, Key.ALT )
wait( 0.5 )
end()
wait( 0.5 )
enter()
wait( 0.5 )
end()
wait( 0.5 )
type( Key.UP )
wait( 0.5 )
recur( 2, tab )
wait( 0.5 )
enter()
wait( 1 )
wait("1594593710440.png", 5)
click("1594593710440.png")
set_typing_speed( 440 )
typeln( "setwd( '$application.r.working.directory$' )" )
typeln( "assign( 'anchor', '$date.anchor$', envir = .GlobalEnv )" )
typeln( "source( 'pluralize.R' )" )
typeln( "source( 'possessive.R' )" )
typeln( "source( 'conversion.R' )" )
typeln( "source( 'csv.R' )" )
wait("1594593794335.png", 3)
click("1594593794335.png")
paragraph()
set_typing_speed( 220 )
typer( "R is now configured. The startup script and other R " )
typer( "files can be found in the " )
typer( "[repository](https://github.com/DaveJarvis/scrivenvar/tree/master/R). " )
wait( 1.5 )
wait("1594594984108.png", 5)
click("1594594984108.png")
wait( 5 )
click("1594689573764.png")
paragraph()
typer( "Next, we'll see how definitions and R can work together." )
wait( 2 )