Comments (9)
I suggest that slide separator should be accompany at least one-line blank before it.
foo
---
This is <h3>
originally, and
foo
---
This is <hr/>
from slidify.
Good point. I always use a blank before and after the slide separator, which is why I never encountered an error thus far. But there are several use cases like the one you point out, where it could lead to different outcomes.
Some of the ruby
based slide generation gems use !SLIDE
as the slide separator. It defines slides a lot clearer. In fact, if you go through the current code base of slidify
, that is the separator I use internally, converting ---
on the fly to the actual separator.
The advantage of ---
is that it is easy to type, clean and is pandoc
compatible, which is great, since it allows you to generate beamer
slides from your slidify
document. The drawback is resolving the ambiguities it creates.
Any thoughts on this?
from slidify.
I like ---
because, it is simple and also used for <hr>
in generation of html.
I thinks the rule is simple: <hr>
will be replaced by the slide separator.
http://daringfireball.net/projects/markdown/syntax#hr
from slidify.
Currently, slidify
recognizes the following as slide separators.
--- foo bar #my-id
!SLIDE foo bar #my-id
<!SLIDE foo bar #my-id>
I need to think about rationalizing them in order to keep the design simple. The advantage of ---
is that
a. easy to use and logical
b. resulting markdown document displays well
If users add slide classes to the same line, they can enclose it within angled brackets so that it doesnt show up in the rendered version of the markdown document.
I will give this a little more thought, but I am more or less convinced that the way to go about it is to allow the following three separator formats
--- foo bar #my-id
< --- foo bar #my-id >
<!-- ---foo bar #my-id >
from slidify.
I think I figured out the required regexes
. Here is the code that would do it. I realized that another advantage of using ---
is to keep it pandoc compatible so that a user can export the presentation as a beamer pdf.
x1 <- "--- foo bar #my-id"
x2 <- "<--- foo bar #my-id>"
x3 <- "<!-- --- foo bar #my-id>"
spat <- "^(?<sep><?(?<comm>!--)?\\s?---\\s?(?<attribs>.*)>?$)"
slidify:::re.capture(spat, x1)$names
from slidify.
Automatic Insertion of Separators This feature idea is stolen from pandoc
which uses the idea of a slide-level
to split a markdown file into slides. It has some heuristics to auto detect the slide level. Once detected pandoc
uses the following rules:
- Headers at the slide level always start a new slide.
- Headers below the slide level create headers within a slide.
- Headers above the slide level create title slides.
I need to factor this by modifying my code for add_slide_separator
add_slide_separator <- function(doc, slide_header_level){
n = slide_header_level
if (any(grep('^---', doc))){
doc = gsub("^---", "!SLIDE", doc)
} else {
doc = gsub("^(#{n,}.*)$ ", "<!SLIDE>\n\\1", doc)
}
return(doc)
}
Here are a couple of issues I foresee
- I need to write a function to determine the
slide_level
using thepandoc
heuristic. - I need to ignore
#
inside fenced code blocks.
from slidify.
I am facing another issue with this choice of separator, since <!-- --- -->
hides the entire document in markdown preview since hyphens are not allowed inside comments. I need to figure out a way to sort this.
from slidify.
I am revisiting my choice of slide separator. I really like my current choice of using ---
followed by key:value pairs and using punctuations to quickly specify commonly used metadata. The only thing that sticks out is that the separator line stands out in the html rendering of the md file.
A common approach taken by google-io2012
and remark.js
is to use the following format to specify slides. This is in line with what I was thinking about when I looked at custom yaml metadata by slide. The syntax is clean albeit a little verbose.
I am torn between these two equally appealing approaches. There might be a way to combine the two approaches and let the user use either of the two.
---
id: id
class: [class1, class2, class3]
name: slide
These are slide contents
from slidify.
It is now possible to do this.
--- {#id, class: [class1, class2, class3], name: slide}
from slidify.
Related Issues (20)
- User-Defined Functions in Slidify HOT 2
- incremental reveal of heading?
- slidify embeds plotly plots as images rather than as normal interactive plots
- Is it possible to support two column layout in reveal.js ? HOT 2
- status 127 after running publish_github()
- How to write chemical formula in slidify
- Is slidify dead?
- Slidify for Music Tracks
- Coudn't find ggpairs and grid.arrange
- Slidify slides not rendering in browser HOT 3
- foo
- era
- Unable to correctly publish slidify slides to RPubs - generates blank page? HOT 2
- Separator slides
- Quiz randomization
- Dead link on slidify.org
- Hide 1st 2 slides during presentation
- Instal phyloseq HOT 1
- no clean subscript in title HOT 1
- Error in markdownExtensions() while calling slidify() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slidify.