adamzap / landslide Goto Github PK
View Code? Open in Web Editor NEWGenerate HTML5 slideshows from markdown, ReST, or textile
License: Apache License 2.0
Generate HTML5 slideshows from markdown, ReST, or textile
License: Apache License 2.0
Hello,
I was using an old (+ 9 months) version of landslide. I started today to take my .rst file and work with the current master version. When compiling my file, the "presenter notes" appears over my slide. I have not included any "presenter notes" directive in my source file. I reduced my .rst file to the minimum to reproduce the bug but I cannot figure out what is the problem. A test file can be downloaded at:
A screenshot is available at:
Just stumbled upon this tool, Slippy http://slides.seld.be/?file=2010-05-30+Example.html
Press on the 'Esc' key, there's an overview of the presentation available using miniatures. I'd find it cool to get this in landslide too :)
Who's in?
Hi,
my presentation pen use PgUp and PgDown to navigate (key-code: "104" and "109"), and not left and right keys. Another good feature of the pen is the "blank" button. With it (key-code 48, "b" key), your screen is blank. Last feature, the laser (need to "freeze" the key-code "63").
These key-codes are standardised, my pen works with evince or LibreOffice.
I've created my presentation with:
landslide -d presentation.pdf django.md and the PDF works without problems (no middle pages and no TOC showed) but special chars fail.
Just a thought, but it might be easier to maintain this, and innovate, if the slide rendering code (JS, CSS) were split into a separate project from the machinery to convert markdown to source (which is rather particular). You could then just use git submodule support to include one in the other.
Ideally, I'd like to see the best of this project's slide code merged with the best of https://github.com/paulrouget/dzslides.
Due to the relatively tight coupling between css/html and what the macros are producing, I think allowing people to add new macros inside of their themes makes sense.
I propose adding a folder (called macros
) to the existing themes directories, moving all of the existing macros to the default
theme, and writing code to autoload from these files.
If we think this is a good idea, I'd be willing to help out with this as well. My python is really rusty, so I'm not sure how much help I'd be in the autoloading code, but everything else I'm sure I'd be able to add value with.
Thoughts?
Possibly caused by a trailing slash...?
I think I have found a bug (difficult to reproduce with simple files).
The following ReST file fails to render the level 3 titles (the title is too low and overwrites the text). In this example the title "Heading 3" is bad rendrered:
Heading 1
bla bla
Heading 2
bla bla
Heading 3
Oups !!
----
Heading 3
oups !
Heading 2
bla
Heading 1.2
bla
The date-based approach of the current README was a bad idea.
It will be rewritten in a more permanent style.
Also I'd like to have links to nice landslide presentations that are currently accessible.
Hi
As I don't like Markdown nor RST that much, it would be really great if support for textile could be added, too!
When using the light and tango styles from the git repository "presenter notes" appears on all the slides. I think this is because default now has significant changes that are not tracked by light and tango, e.g.,:
div#current_presenter_notes {
display: none;
}
div.slide div.presenter_notes {
display: none;
}
This is a small contribution :
http://github.com/harobed/landslide/commit/b6d347a7a87b730517edf44123a1745cc6a10293
With this patch, you can do :
$ pip install landslide___.tar.gz
all dependency are automatically installed
You can also do
$ python setup.py develop
This is useful in development mode.
This patch use "entry_points" to install "landslide" executable.
What do you think about this contribution ?
Regards,
Stephane
It would be nice to have a watch command so that you can just save your markdown file and then see the result in the browser without having to call landslide again. A big plus if it watched your theme files too.
watchdog looks like a good option to achieve it.
I could work on a fork and contribute it. Let me know.
I am using this to teach a javascript course and it is working great.
Extra middle slides are being rendered in some cases.
To reproduce, run landslide on samples/example2
landslide command not end while reading reST file which includes ".. image::".
Here is what i typed. Press Ctrl-c after waiting a couple of mins.
(sphinx)[mac]%landslide -i landslide.rst
Adding landslide.rst (restructuredtext)
Embedded image python-logo-master-v3-TM.png
^CTraceback (most recent call last):
File "/Users/example/Works/VEnvs/sphinx/bin/landslide", line 9, in <module>
load_entry_point('landslide==0.8.2', 'console_scripts', 'landslide')()
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/site-packages/landslide-0.8.2-py2.6.egg/landslide/main.py", line 166, in main
run(input_file, options)
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/site-packages/landslide-0.8.2-py2.6.egg/landslide/main.py", line 154, in run
generator.Generator(input_file, **options.__dict__).execute()
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/site-packages/landslide-0.8.2-py2.6.egg/landslide/generator.py", line 198, in execute
self.write()
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/site-packages/landslide-0.8.2-py2.6.egg/landslide/generator.py", line 467, in write
html = self.render()
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/site-packages/landslide-0.8.2-py2.6.egg/landslide/generator.py", line 460, in render
slides = self.fetch_contents(self.source)
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/site-packages/landslide-0.8.2-py2.6.egg/landslide/generator.py", line 244, in fetch_contents
slides.append(self.get_slide_vars(inner_slide, source))
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/site-packages/landslide-0.8.2-py2.6.egg/landslide/generator.py", line 345, in get_slide_vars
re.DOTALL | re.UNICODE | re.IGNORECASE)
File "/Users/example/Works/VEnvs/sphinx/lib/python2.6/re.py", line 142, in search
return _compile(pattern, flags).search(string)
KeyboardInterrupt
Hi!
I've tested if you can embed a image into the url('') definition at CSS and yes, you can. So I try to do that with landslide code but I have some questions.
I can do it "easily" in the EmbedImagesMacro if the content variable have the css embeded before embed img in the HTML. Some as:
This could be asily with the regexp in the Macro.
Other way is do that get_css and control the embed variable, but I think that is not the good place to do that.
If you help me to start I can do that in my fork and commit after.
Thanks!
markdown outputs escaped xml so that the xml renders properly in the browser (for example: < and >), but we think the code highlighter doesn't recognize the escaped characters, so syntax highlighting appears broken.
sometimes it's nice to have another title page in the middle of a deck.
Examples:
Hello,
it seems, that syntax highlighting is not support with ReST.
When I try the following :
Some test: .. code-block:: php .. highlightlang:: php
I get no syntax highlighting. I get an ReST error instead.
It is up to you to decide which directive (code-block, or highlightlang) you want to support though.
Cheers :)
Adding a feature for automatically generating TOC would be nice. This could be done via a javascript function which would create the TOC when loading the html page.
I'm fine with html5-slides-markdown.
Any other ideas?
Here's one: chutes
My ideas:
Any other ideas for improvement? Please push back on my ideas if you disagree.
I hope to implement this by next week if no one else wants to.
I tried to use a Landslide presentation on an iPad (using the iCab browser which has a full screen mode for VGA output). Swiping to get the next slide works, but I can’t find a way to do keyboard input to show/hide the outline, slide counter, etc. Is there anything I’m missing? Are there plans to add more touch-friendly interface elements?
Could you bump the version number on PyPi? I installed via pip install landslide
and got a version that was missing features. For example, I couldn't turn off line numbers from the command line.
Hi,
The PDF output produced by Prince XML is black and white. Also, it adds an extra page after every slide reserved for notes.
Is it possible to get a colored PDF without extra pages, just like in the browser?
It would be interesting to make some experiments with wkhtmltopdf too. It is open source, while Prince is free for non-commercial use only. I made some tests with wkhtmltopdf but the result was not very good. However, I think it could be tweaked.
Best,
Laszlo
this has been suggested by bradcupit
I have started to look into it.
Any opinions? pytidylib or utidylib should work...
Into the rst2pdf tool, the developers implemented a command line switch to enable automatic page break with every new section title. The switch controls the section depth that are concerned by automatic page break.
In landslide, each new slide is generated by ----
(for .rst files). As my document is supposed to be used to generate slides but also an A4 course material, I have 3 level of sectionning titles and do not need any ----
between sections, whereas I need to add them to make landslide work.
Maybe it could be interesting to add a -b
switch (break switch) to make automatic the introduction of ----
. The execution of:
landslide -b 2 test.rst
would introduce a slide break before each section of level 1 and 2 (but not for levels 3+).
I tracked down the problem to this line in generator.py
inner_slides = re.split(r'<hr.+>', parser.parse(file_contents),
re.DOTALL | re.UNICODE)
Python <2.7 does not take flags for re.split. The result is that maxsplit
is set to 48.
I'm new to both ubuntu and HTML5 but I was pretty much blown away by the potential use of landslide.
I've followed all instructions installed landslide etc, but when I'm trying to run the presentation.html , as per instructions given in the "rendering" section of the readme.md document I get an error which says,
''Couldn't get a file descriptor referring to the console"
I might not be looking at something completely obvious but as I said I'm new and need all the help.
Cheers,
Koti Ivaturi
In our discussion on the Presenter View feature, one thing that came up was how it should be re-written as a Macro. In looking at the macro system, one thing that's become clear to me is it is insufficient for many enhancements to Landslide (you are currently only able to modify the content and css classes of a slide.
I propose changing the macro system to take in (and return) the slide_vars
map directly, allowing you to modify slide_classes
& content
as we currently can, but also allowing the addition of new map variable (like presenter_notes
from our conversation) as well as changing other things (like title
, source
, or header
)
Doing this won't require too much of a change of the existing macros... In fact, we could add a subclass of the general Macro (maybe called SlideContentMacro
) that has the exact same interface as the existing Macro system. Rewriting it to be based on this generic system should be trivial.
If we think this is a good idea, I can pitch in some time to help make this happen...
Thoughts?
Hi,
I think there is a bug for RST files.
When computing a .md file with utf-8 characters, like:
jf@radotte:~/swap$ cat test.md
Eté et accentué !
all is going well when generating the slides:
jf@radotte:~/swap$ landslide test.md
Adding test.md (markdown)
Generated file: presentation.html
but when doing the same with test.rst:
jf@radotte:~/swap$ cat test.rst
Eté et accentué !
the following error occurs:
jf@radotte:~/swap$ landslide test.rst
Adding test.rst (restructuredtext)
Error: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
It seems that the wrong codec (ascii) is chosen, instead of utf-8.
Forcing the utf-8 codec has no effect:
jf@radotte:~/swap$ landslide -e utf8 test.rst
Adding test.rst (restructuredtext)
Error: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
It's me again :) The width of images seems not to be taken into account... It's probably more work to implement it than fixing a bug.
.. image:: images/arrays.png
:width: 400px
.. image:: images/arrays.png
:width: 80%
Trying to instal from the pip
command:
$ sudo pip install landslide
Directory 'landslide' is not installable. File 'setup.py' not found.
Has the file been included in the package? (I'm not a pipy
guru)
With a single slide I can reproduce a regexp related hang/busy spin in Landslide when using the -i argument to embed everything.
# Example
<img src="large-ass-image.jpg">
The offending regexp is this from Generator.get_slide_vars:
find = re.search(r'(.+)?<h\d+?.*?>presenter notes</h\d>\s?(.+)?$', content,
re.DOTALL | re.UNICODE | re.IGNORECASE)
This never returns on my system (or at least until my patience ends). If I remove both of the " (.+)? " sections then it completes. I'm very weak at regexp stuff but it looks like " (.+)? " iterating over very large BASE64'd images in those content sections is incredibly inefficient and the source of the apparent hang. I'm afraid my regexp-fu is too weak to figure out how to fix it but if no one else gets around to it I might take a crack at it.
A git bisect shows this behavior started when the Presenter Notes code was originally merged.
(Test system was Ubuntu 11.04 32-bit with Python 2.7.1+ubuntu patches)
we should ship an rst example that shows all of rst's landslide-compatible features
I tried to test the branch of Olivier for syntax highlighting in ReST files. But I have a problem with this version (maybe it's an installation problem ?).
I did:
cd olivierverdier-landslide-36cdc36
sudo python setup.py build
sudo python setup.py install
And then:
landslide android.rst
Adding android.rst (restructuredtext)
Generated file: presentation.html
which seems to be ok because landslide does not complain about my code-block
directives.
The, openin the presentation the first slide is ok, but the second is "invisible" (I can to hit but I does not see it).
The ReST file is:
slide 1
.. code-block:: java
Resources res = getResources();
String hw = res.getString(R.string.hello);
slide 2
This is not shown !
When using Firefox, as you progress through the slides the left margin is offset by a few pixels. After a few slides the main page starts to slip off the screen. Interestingly this only happens going forward; returning to the previous slide is fine.
Disabling the moz-transition on div.slide makes it more obvious.
I've tracked the problem down to margin-left on the .slide.future and .slide.far-future rules. Hiding those elements or removing the margin fixes the problem. I've tried all sorts of tweaks, but my css is pretty rudimentary..
I have the feeling that this could be a Firefox bug, but if anyone has ideas how to work around it that would be much appreciated. For now I'll stick to Chrome.
The sidebar directive seems to be implemented but broken. The following example with a long sentence inside the sidebar produces something but not really good...
.. sidebar:: title
sidebar text sidebar text sidebar sidebar text sidebar text sidebar
Maybe the sidebar content should be droped if not implemented.
Hi! I've made simple changes in the default theme to get this: http://mirblu.com/slides/presentation.html
I've copied the files that I must change (only a little) and I link (ln -s) the others. I think that it could be more easy to provide a extra_screen.css (for example) to override the default CSS and a extra.js to add my little changes the default JS.
Sorry for my english... I will try to explain better if you need it.
In order to help manage my personal themes (as well as keeping these themes up to date with new versions of Landslide), I think it would be useful to support more than one css file (for both print
as well as screen
views).
I propose creating a folder structure in the themes css directory as such:
default/
css/
print/
print.css
screen/
screen.css
In the code, we could iterate over all the files in these folders (in alphabetical order) and add them with the proper stylesheet link in the html.
Again, I'm totally willing to help out with this. Just wanted somebody else to validate it's a good idea.
Inserting this in slides.md :
accentué
raises this error :
markdown.MarkdownException: UnicodeDecodeError: Markdown only accepts unicode or ascii input.
inserting this :
© copyright or accentué
raises this error :
UnicodeDecodeError: 'ascii' codec can't decode byte …
I think the theming and templating capabilities of Landslide are currently underexploited (okay, they're crap). For example, we're not taking much advantage from Jinja2 features, especially loaders, blocks and template inheritance. We have (okay, I have) reinvented the wheel. That's not good.
So I've started a new branch in my fork to work on a full refactoring of this part of the application : https://github.com/n1k0/landslide/tree/new-templating
My main goal is to remove most of the templating logic and configuration from the generator
module to fully use Jinja2 for what it intends to be, a template engine.
Thoughts and comments are welcome, and help would be much appreciated. In the meanwhile feel free to watch progress on the new-templating
branch of my fork =)
I'm currently using showoff, a similar markdown-based presentation generator which allows to separate and somewhat organize bulky contents (think of training materials for example)
I think adding something very simple in this direction would be a real added value :)
First, thank you for providing such a nice tool.
Would be nice however to be able to print the generated presentation, either directly from the browser (and probably using the export to PDF feature) or from a command line utility such as princexml.
Therefore a printing stylesheet would be a great addition :)
What do you think?
Hello,
I think that the copytheme option combined with relative paths does not handle the custom css tag. Using the following configuration:
cat landslide.cfg
[landslide]
source = java_embarque.rst
destination = presentation-java_embarque.html
css = /home/jf/ensib/cours/rst/jf.css
relative = True
linenos = inline
copytheme = True
the resulting theme directory does not contain jf.css. In the html source file I have:
whereas other links are relative:
So the custom css file, should be copied to the theme directory and the html code should be:
the notes are currently limited to one line. it's often nice to have multi-line notes. my current workaround is to just put my notes in something like:
<p class="notes">
lots
of lines
here
</p>
Hi,
I've hit some trouble trying to use landslide on an appengine instance, probably because of the dependencies.
Can you say whether or not the system has any dependencies that will specifically prohibit using appengine? If not, I will continue to bang away.
Thanks,
The links of the generated table of contents does not work with .rst files:
## TOC
.. contents:: TOC
:depth: 1
heading 1
plop
----
heading 2
On a fresh Ubuntu install:
$ sudo pip install landslide
Downloading/unpacking landslide
Downloading landslide-0.4.0.tar.gz (51Kb): 51Kb downloaded
Running setup.py egg_info for package landslide
Installing collected packages: landslide
Running setup.py install for landslide
changing mode of build/scripts-2.5/landslide from 644 to 755
changing mode of /usr/bin/landslide to 755
Successfully installed landslide
Cleaning up...
niko@nikobox:~$ landslide
Traceback (most recent call last):
File "/usr/bin/landslide", line 23, in <module>
from generator import Generator
ImportError: No module named generator
Now investigating...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.