ramnathv / slidify-old

Generate reproducible html5 slides from R markdown. This repository has moved to `ramnathv/slidify`
http://ramnathv.github.com/slidify/
8 stars 0 forks source link

Decide on conventions for folder structure and naming #7

Closed ramnathv closed 12 years ago

ramnathv commented 12 years ago

Convention over Configuration is key to writing good, easily extensible software. While, I have tried to incorporate this idea into slidify, I still have several questions on how to name folders. This place is a laundry list where I expect to dump my ideas on folder naming.

  1. Should I use css and js for custom files, or go with stylesheets and javascripts ?
  2. Regarding structure, is it better to separate out custom files from system files (basically framework and highlighting related css and js files)?
  3. Another widely used convention is to use an assets directory with subfolders
    • media
    • scripts
    • stylesheets
ramnathv commented 12 years ago

I have done some more thinking on how to break down an HTML5 slide deck into its constituent modules.

Source

This one is a no brainer. The source files are R Markdown documents, each containing one or more slides. The config.yml file can be used to specify the files/directories to include in the presentation, and the order in which they are to appear.

Theme

By theme, I am referring to the collection of javascripts, stylesheets and other media assets that are used to shape the appearance of the presentation. Now, these assets might work on the slides themselves, or on specific portions of the slides (like syntax highlighting).

ramnathv commented 12 years ago

Currently, generating a slide deck creates at least 5 folders

|-css
|-highlight
|-html5slides
|---images
|-images
|-js    

This structure is convenient as it makes the copying and linking of files very easy, and keeps the custom css and js files separate from those used for highlighting and the slides. However, it looks a little disorganized. Here are a couple of ideas on how I could organize the structure differently:

  1. I like parallel structures since they are easy to understand and elegant. So I could define three folders custom, syntax and frames each of which further contain css and js folders. Except for deck.js, the other slide generating frameworks are really very light. So this might result in several single file folders. Is the structure better in spite of that limitation?
ramnathv commented 12 years ago

After a lot of thought, I have two alternatives to organizing folders in the slides directory.

Option 1

|- _slidify.yml
|- assets
|--- stylesheets
|--- javascripts
|--- media
|- libraries
|--- html5slides
|--- highlight.js
|- index.html
|- index.md
|- index.Rmd

Option 2

The only difference is that I would move all the sub-directories in _assets to the root directory of the slides.

ramnathv commented 12 years ago

I think I am settled on Option 1 as it leads to the cleanest folder structure. Moreover, introduction of the lib_path option makes it easy to use the same library folders for multiple presentations.