Giter Site home page Giter Site logo

Comments (13)

tonosan avatar tonosan commented on August 24, 2024 2

Hi
I´ll publish my slidify in rpubs but the presentation doesn´t appear.
Any idea of what is happening? thanks


title : Introduccion a R
subtitle : Breve, muy breve
author : Antonio Martinez Pineda
job : Division de Educacion Continua Fac. Psicologia
logo : dec.jpg
framework : io2012 # {io2012, html5slides, shower, dzslides,revealjs, ...}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : tomorrow # {tomorrow,zenburn,kate,tango,pygments}
widgets : [] # {mathjax, quiz, bootstrap}
mode : selfcontained # {selfcontained,standalone, draft}

knit : slidify::knit2slides

from slidify.

Mechaque avatar Mechaque commented on August 24, 2024 1

I am trying to publish my slide but it just shows a blank page nothing happens. any solutions you can share?

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

I like the approach taken by showoff in providing an option that allows users to directly upload a static version of the presentation to the gh-pages branch of github. The code is a little cryptic to me as it relies on basic plumbing of github, but should not be very difficult to replicate in R.

Here are some lines from the documentation, and the related code from showoff.

showoff github : Generates a static version of your site and puts it in a gh-pages branch for static serving on GitHub.

These options are specified after the command.

force force overwrite of existing Gemfile/.gems and config.ru files if they exist
dotgems Use older-style .gems file instead of bundler-style Gemfile
password add password protection to your heroku site

# generate a static version of the site into the gh-pages branch
def self.github
   ShowOff.do_static(nil)
  `git add static`
   sha = `git write-tree`.chomp
   tree_sha = `git rev-parse #{sha}:static`.chomp
   `git read-tree HEAD`  # reset staging to last-commit
   ghp_sha = `git rev-parse gh-pages 2>/dev/null`.chomp
   extra = ghp_sha != 'gh-pages' ? "-p #{ghp_sha}" : ''
   commit_sha = `echo 'static presentation' | git commit-tree #{tree_sha} #{extra}`.chomp
  `git update-ref refs/heads/gh-pages #{commit_sha}`
end

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

RStudio has come up with an awesome idea for sharing R Markdown documents. RPubs allows users to upload html files in a single click, which gets displayed on the RPubs gallery.

The workhorse is a function rpubsUpload which automates the uploading process. The first step is to embed images, and I have a script that can do this. The next step is to embed local js and css files. There are two ways I can do this

  1. Write a helper script that detects all local js and css files and inlines them (OR)
  2. Upload local js and css files to a CDN and set lib_path to the root folder.

Clearly, (2) is easier, if there is a way for me to upload js/css files and serve them from there.

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

Uploading to RPubs

Should I write a publish_deck wrapper to encapsulate these steps?

slidify('slides.Rmd', options = list(embed = TRUE))
rPubsUpload('My Presentation', 'slides.html')

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

Publishing to Github Pages

References

  1. Serve Files to Github Pages with a Single Branch

Ideas

Setting up a gh-pages branch in a new repository

git init
git commit --allow-empty -m 'Initial Commit'
git branch gh-pages
git checkout gh-pages

UPDATE. I came across a ruby gem Grancher that claims to make it simple to publish a gh-pages branch using rake tasks. I need to check it out and see if I can port its functionality to R

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

This works great. I streamlined the publishing process by using a makefile with the following commands

USER := ramnathv
REPO := tempslides

slides: index.html

setup_gh_pages :
    git init
    git commit --allow-empty -m 'initial commit'
    git checkout -b gh-pages
    touch index.Rmd
    git add .
    git commit -a -m 'set up deck as gh-pages branch'

add_gh_remote:
    git remote add github https://github.com/$(USER)/$(REPO).git

deploy: slides
    git push origin gh-pages

%.html: %.Rmd
    Rscript -e "library(slidify); slidify('$<', '$@')"

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

Another publishing option is googlecode which can serve an html file at

http://{{projname}}/googlecode.com/git/{{path/to/html}}

The first step is to create a googlecode git repository for the project and then run the following deployment commands

git remote add googlecode https://code.google.com/p/{{projname}}.git
git push googlecode gh-pages:master

Note that it is important to push to the master branch, since for some reason html files in other branch give a 404. I have not verified if pushing to master works as yet, but I am pretty certain it does.

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

I think it would be a good idea to have an option of keeping both branches, master and gh-pages. I can use the strategy of subtree merge and a post-commit-hook to keep the gh-pages branch updated.

TODO. Outline different possible workflows and post on SO asking what are the advantages and disadvantages.

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

I can take some ideas from the rake tasks used by octopress.

rake setup_gh_pages
  1. Ask you for your Github Pages repository url.
  2. Rename the remote pointing to imathis/octopress from ‘origin’ to ‘octopress’
  3. Add your Github Pages repository as the default origin remote.
  4. Switch the active branch from master to source.
  5. Configure your blog’s url according to your repository.
  6. Setup a master branch in the _deploy directory for deployment

I can modify this to step through the following sequence instead

  1. Add your Github Username and Repo to Makefile.
  2. Add your Github Pages repository as a remote named github.

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

Another decision to make is whether to provide a makefile or embed the git commands inside an R function. The case for a makefile is that it is more transparent and hence allows for easier customization. A second advantage is that it allows running slidify from the command line. Finally, pairing make with watch, I get guard for free which can be very useful while editing presentations.

One way I can make progress on this is to write a detailed makefile with steps for each process. It would then be easy to embed the commands within an R function. I can decide later which of the two options I want to pursue.

Here is some inspiration from octopress rake tasks

  1. rake install
  2. rake generate
  3. rake watch
  4. rake new_post
  5. rake new_page
  6. rake deploy
  7. rake setup_github_pages

from slidify.

ramnathv avatar ramnathv commented on August 24, 2024

I have implemented this feature. I might revisit this page for picking up pointers I missed.

from slidify.

tonosan avatar tonosan commented on August 24, 2024

I wonder how you can publish your slidify in sites.google.

from slidify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.