-
Create a directory
.md2googleslides
in your home directorycd ~/ mkdir .md2googleslides
-
Talk to Dorai! Ensure that he has added your preferred email address is to the Google API settings, and then have him send you the
client_id.json
file through a secure channel. Put this file inside the~/.md2googleslides
folder. -
In your terminal window, manually run md2gslides on a simple, dummy file.
node node_modules/md2googleslides/bin/md2gslides lib/dummy-slides.md -n -t TITLE --use-fileio
This will generate some terminal output. The first line of the output looks something like
Authorize this app by visiting this url: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=…;
-
Copy the entire URL (it’s quite long!) into a new browser window. This will ask you to grant permission for
md2gslides
to construct google slides for you, which requires two different permissions. Check both boxes and continue. Eventually you will reach a web page that contains a code. -
Copy that code, and paste it back into your terminal. This closes the loop between md2gslides and Google, authenticating your computer. You’re ready to rock!
The script build-slide
is used to build the slides for an
individual lesson, whose name is supplied as its argument, e.g.,
./build-slide function-composition
This assumes that the lesson function-composition
is
(or will be created) in the distribution/**/lessons
directory.
build-slide
converts the lessons’s slides.md
to a
post-processed slides.mkd
(that expands out our
curriculum-specific directives) and then uses md2gslides
to
construct and upload the corresponding presentation. If the
repo
does not already a presentation id associated with these
slides — in the file slides-pyret.id
say --, then a new id is
used and stored in the slides-pyret.id
, and you are advised to
commit it to the repo, so that it can be reliably reused during
future calls to build-slide
.
You can use some options to guide build-slide
. The position of
these options on the build-slide
argument line doesn’t matter.
If slides-pyret.id
is already present, then you are warned that
the current build-slide
call could replace an existing
presentation on the web. Answer y
to the prompt if that’s what
you really want to do. If not, answer n
to exit: You will then
be advised to use the -f
option to create a new id that will
not dislodge the existing presentation.
Using the -f
option is a good way to simply check that your
modified slides convert correctly without committing them to the
web yet.
If you’re cool with updating an existing presentation on the web,
and don’t want a prompt asking for your confirmation, use the
--rebuild
option.
The build-slide
script takes as argument the name of a lesson
as it is in the distribution
directory. For the default
proglang of pyret
, this name is
the same as the name of the lesson in the repo. For other
proglangs, e.g., wescheme
, the lesson directory inside
distribution
sports the suffix -wescheme
. build-slide
called
with the suffixed lesson name will do the right thing, and will
copy the resultant slides-wescheme.id
(not the suffix!) to the
correct lesson directory in the repo:
build-slide function-composition-wescheme
If you prefer to use the lesson name as given in the repo even
for proglangs other than pyret
, e.g., wescheme
, you
may do so, provided you add the --proglang wescheme
option:
build-slide function-composition --proglang wescheme
It is ok to overspecify, i.e., to give the --proglang
option
in addition to the proglang-modified name for the lesson as it
occurs in distribution
:
build-slide function-composition-wescheme --proglang wescheme
By default, build-slide
calls make
to ensure a proper
distribution
folder before attempting to build slides for its
argument lesson.
However, if you’re calling build-slide
multiple times in quick
succession (perhaps within a shell loop), the make
is redundant
except for the first time, and even a make
that doesn’t need to
update the distribution
consumes valuable time. In such cases,
use the --nomake
option to skip the make
.
build-slide --nomake function-composition
build-slide
builds the deck for a single argument lesson. To
build the slides for all lessons, use
build-all-slides
To build the slides for all the lessons in a particular course, e.g., algebra-pyret, use
build-all-slides algebra-pyret
build-all-slides
accepts the same options as build-slide
:
-
-f
to make the slides without updating the currently public Google deck -
--rebuild
to approve updating the currently public Google deck -
--nomake
to avoid a sanity-checkmake
. (Note however that if this option isn’t given,build-all-slides
will callmake
, but only once — not once for each of the lessons that it processes. So failing to mention this option is not so terrible.)
The lesson-plan adoc files are typically split into slides at the 2-level
sections, with the lower-level sections being ignored. An author
can insert their own slide-break with the directive
@slidebreak
, which is a no-op as far as the regular HTML
generation is concerned or @slidebreak{layout-name}
to specify a
specific slide layout.
A final 1-level section, if it is named Additional Exercises
, is
also converted to a slide.
PD slides are marked with @pd-slide{…}
or
@strategy{…}{…}
where the material is
inserted as a new slide, but only if the --pd
option is used.
Note that introducing these in a final 1-level section
Additional Exercise
implies this is no longer the final slide.
If you want to include a @strategy
in such a slide, it’s best
to use the primitives
@ifpdslide{ @strategy-basic{...}{...} }
as these don’t introduce a tacit slidebreak. (The less verbose
directives @pd-slide
and @strategy
are built on top of
@ifpdslide
and @strategy-basic
.)
include