GithubHelp home page GithubHelp logo

adamzap / landslide Goto Github PK

View Code? Open in Web Editor NEW
2.1K 2.1K 372.0 3.24 MB

Generate HTML5 slideshows from markdown, ReST, or textile

License: Apache License 2.0

Python 26.96% CSS 34.73% JavaScript 24.55% HTML 6.89% SCSS 6.86%

landslide's People

Contributors

aaugustin avatar adamzap avatar akrabat avatar bermanmaxim avatar bestfriendchris avatar blocke avatar bradcupit avatar charleso avatar codito avatar copelco avatar doug avatar durden avatar fozziethebeat avatar godfat avatar hadrieng2 avatar harobed avatar jadeallenx avatar kevinanewman avatar leblanc-simon avatar maruel avatar mtrythall avatar n1k0 avatar olivierverdier avatar philpennock avatar roktas avatar sdouche avatar shreyankg avatar soundmonster avatar spin6lock avatar tjormola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

landslide's Issues

Auto load macros from the themes directory

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?

unicode issues with characters in markdown or base.html

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 …

Separate and combine markdown source files

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 :)

PDF output

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

option for generating TOC

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.

embed image not end

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

Issue with rst files and olivierverdier/landslide@36cdc36 branch

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 !

Syntax highlighting not available with Rest format

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 :)

landslide installation fails

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...

Problem with presenter notes

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:

http://dl.free.fr/j5Wj4U7WR

A screenshot is available at:

http://dl.free.fr/bSphb2wAx

Bug for heading level 3 for ReST

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

Wish: automatic slide break with rst sections

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+).

Presenter Notes RegExp Breaks

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)

Touch interface

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?

help for a noobie please - error in rendering

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

Theming and templating refactoring

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 =)

Wish: relative paths for theme and images

Another wish: it is difficult to copy a landslide presentation to another computer or tu put it on a web server because the links for themes and images have the full path name:

Maybe it could help to provide a way to produce relative path names in the HTML output:

Version on PyPi is old

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.

Presentation pen keys

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.

copytheme+relative support for custom css

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:

Landslide on AppEngine

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,

Print stylesheet?

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?

Embed CSS images with -i option

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:

  1. Embed css+html
  2. Embed images html (<img) and embed images css (url(''))

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!

Split slide rendering from markdown, etc. script?

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.

Stops rendering at 49 slides

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.

Improve the print stylesheet for pdf export

My ideas:

  • Align everything left rather than center (like the slides)
  • Adjust font sizes so that the page breaks match the slides

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.

Add extra.js and extra.css files in theme

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.

Support multiple css files in themes

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.

xml syntax highlighting isn't working

markdown outputs escaped xml so that the xml renders properly in the browser (for example: &lt; and &gt;), but we think the code highlighter doesn't recognize the escaped characters, so syntax highlighting appears broken.

pip installation fails

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)

Rewrite README

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.

light and tango styles not tracking changes in default

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;
}


landslide watch config.cfg

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.

Exporting to PDF fails with accents

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.

Firefox offset bug on next slide

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.

More generic Macro system

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?

Error when decoding utf-8 characters for RST files

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

Test

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

Test

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)

Bug: links of toc unusable for .rst

The links of the generated table of contents does not work with .rst files:

## TOC

.. contents:: TOC
:depth: 1


heading 1


plop

----

heading 2

sidebar directive breaks rst presentations

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.

tidy html output by default?

this has been suggested by bradcupit

I have started to look into it.

Any opinions? pytidylib or utidylib should work...

multiline presenter notes.

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>

width of images not taken into account for ReST files

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%

title page in middle of deck

sometimes it's nice to have another title page in the middle of a deck.
Examples:

  • switch from one presenter to another (but share same slides)
  • mark a milestone in the presentation (overview, current state, future) may each have their own 'title' page

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.