Commits

Peter Ward committed a3fea4d

frame options

  • Participants
  • Parent commits 1bbf170

Comments (0)

Files changed (1)

File shinypress/handlers/images.py

 
 template = env.from_string(r"""
 %% for filename in images %%
-\begin{frame}
+\begin{frame}<frameopts>
 \begin{list}{}{%
 \setlength{\leftmargin}{-1.5em}%
 \setlength{\rightmargin}{-1.5em}%
 """)
 
 def render(directory):
+    frameopts = ''
+
+    PLAIN = '[plain] '
+    if directory.startswith(PLAIN):
+        directory = directory[len(PLAIN):]
+        frameopts = '[plain]'
+
     directory = path.abspath(directory)
     images = []
     for pattern in ('*.jpg', '*.png'):
             glob(path.join(directory, pattern))
         )
     images.sort()
-    return (template.render(images=images), [])
+    return (template.render(images=images, frameopts=frameopts), [])
 
 def render_single(image):
-    return (template.render(images=[image]), [open(image, 'rb')])
+    return (template.render(images=[image], frameopts=''), [open(image, 'rb')])