pax_global_header00006660000000000000000000000064116623055460014522gustar00rootroot0000000000000052 comment=025522de5ec5d7231f2a35d8167e09b4986ddb4c landslide-1.0.1/000077500000000000000000000000001166230554600134605ustar00rootroot00000000000000landslide-1.0.1/.gitignore000066400000000000000000000002631166230554600154510ustar00rootroot00000000000000*.pyc build .idea landslide/.idea presentation.html *.pdf samples/.DS_Store *.swp src/landslide.egg-info/ dist/ *.komodoproject .komodotools landslide.sublime-project docs/_build landslide-1.0.1/LICENSE000066400000000000000000000236751166230554600145020ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS landslide-1.0.1/MANIFEST.in000066400000000000000000000000331166230554600152120ustar00rootroot00000000000000graft src/landslide/themes landslide-1.0.1/README.md000066400000000000000000000264461166230554600147530ustar00rootroot00000000000000# Overview Landslide generates a slideshow using the slides that power [the html5-slides presentation](http://apirocks.com/html5/html5.html). ![demo](http://adamzap.com/random/landslide.png) A sample slideshow is [here](http://adamzap.com/random/landslide.html). # Features - Write your slide contents easily using the [Markdown](http://daringfireball.net/projects/markdown/syntax) or [ReStructuredText](http://docutils.sourceforge.net/rst.html) syntaxes - [HTML5](http://dev.w3.org/html5/spec/), Web based, stand-alone document (embedded local images), fancy transitions - PDF export (using [PrinceXML](http://www.princexml.com/) if available) # Requirements `python` and the following modules: - `jinja2` - `pygments` for code blocks syntax coloration - `markdown` if you use Markdown syntax for your slide contents - `docutils` if you use ReStructuredText syntax for your slide contents ## Optional - `textile` for textile support # Installation The easiest way to install Landlside is probably using `pip`: $ pip install landslide Alternatively, you can use `easy_install`: $ easy_install landslide If you want to stay on the edge: $ git clone https://github.com/adamzap/landslide.git $ cd landslide $ python setup.py build $ sudo python setup.py install # Formatting ## Markdown - Your Markdown source files must be suffixed by `.md`, `.markdn`, `.mdown` or `.markdown` - To create a title slide, render a single `h1` element (eg. `# My Title`) - Separate your slides with a horizontal rule (`---` in markdown) except at the end of md files - Your other slides should have a heading that renders to an `h1` element - To highlight blocks of code, put !`{lang}` where `{lang}` is the pygment supported language identifier as the first indented line ## ReStructuredText - Your ReST source files must be suffixed by `.rst` or `.rest` (**`.txt` is not supported**) - Use headings for slide titles - Separate your slides using an horizontal rule (`----` in RST) except at the end of RST files ## Textile - Textile cannot generate
, so you must insert those manually to separate slides # Rendering - Run `landslide slides.md` or `landslide slides.rst` - Enjoy your newly generated `presentation.html` Or get it as a PDF document if PrinceXML is installed and available on your system: $ landslide README.md -d readme.pdf $ open readme.pdf # Viewing - Press `h` to toggle display of help - Press `left arrow` and `right arrow` to navigate - Press `t` to toggle a table of contents for your presentation. Slide titles are links - Press `ESC` to display the presentation overview (Exposé) - Press `n` to toggle slide number visibility - Press `b` to toggle screen blanking - Press `c` to toggle current slide context (previous and next slides) - Press `e` to make slides filling the whole available space within the document body - Press `S` to toggle display of link to the source file for each slide - Press '2' to toggle notes in your slides (specify with the .notes macro) - Press '3' to toggle pseudo-3D display (experimental) - Browser zooming is supported # Commandline Options Several options are available using the command line: -h, --help show this help message and exit -c, --copy-theme Copy theme directory into current presentation source directory -b, --debug Will display any exception trace to stdin -d FILE, --destination=FILE The path to the to the destination file: .html or .pdf extensions allowed (default: presentation.html) -e ENCODING, --encoding=ENCODING The encoding of your files (defaults to utf8) -i, --embed Embed stylesheet and javascript contents, base64-encoded images in presentation to make a standalone document -l LINENOS, --linenos=LINENOS How to output linenos in source code. Three options availables: no (no line numbers); inline (inside
                          tag); table (lines numbers in another cell, copy-paste
                          friendly)
    -o, --direct-output    Prints the generated HTML code to stdin; won't work
                          with PDF export
    -q, --quiet           Won't write anything to stdin (silent mode)
    -r, --relative        Make your presentation asset links relative to current
                          pwd; This may be useful if you intend to publish your
                          html presentation online.
    -t THEME, --theme=THEME
                          A theme name, or path to a landlside theme directory
    -v, --verbose         Write informational messages to stdin (enabled by
                          default)
    -x EXTENSIONS, --extensions=EXTENSIONS
                          Comma-separated list of extensions for Markdown

# Presentation Configuration

Landslide allows to configure your presentation using a `cfg` configuration file, therefore easing the aggregation of source directories and the reuse of them accross presentations. Landslide configuration files use the `cfg` syntax. If you know `ini` files, you get the picture. Below is a sample configuration file:

    [landslide]
    theme  = /path/to/my/beautiful/theme
    source = 0_my_first_slides.md
             a_directory
             another_directory
             now_a_slide.markdown
             another_one.rst
    destination = myWonderfulPresentation.html
    css =    my_first_stylesheet.css
             my_other_stylesheet.css
    js =     jquery.js
             my_fancy_javascript.js
    relative = True
    linenos = inline

Don't forget to declare the `[landslide]` section. To generate the presentation as configured, just run:

    $ cd /path/to/my/presentation/sources
    $ landslide config.cfg

# Macros

You can use macros to enhance your presentation:

## Notes

Add notes to your slides using the `.notes:` keyword, eg.:

    # My Slide Title

    .notes: These are my notes, hidden by default

    My visible content goes here

You can toggle display of notes by pressing the `2` key.

Some other macros are also available by default: `.fx: foo bar` will add the `foo` and `bar` classes to the corresponding slide `
` element, easing styling of your presentation using CSS. # Presenter Notes You can also add presenter notes to each slide by following the slide content with a heading entitled "Presenter Notes". Press the 'p' key to open the presenter view. # Registering Macros Macros are used to transform the HTML contents of your slide. You can register your own macros by creating `landslide.macro.Macro` derived classes, implementing a `process(content, source=None)` method and returning a tuple containing the modified contents and some css classes you may be wanting to add to your slide `
` element. For example: !python import landslide class MyMacro(landslide.Macro): def process(self, content, source=None): return content + '

plop

', ['plopped_slide'] g = landslide.generator.Generator(source='toto.md') g.register_macro(MyMacro) print g.render() This will render any slide as below: !html

foo

my slide contents

plop>

# Advanced Usage ## Setting Custom Destination File $ landslide slides.md -d ~/MyPresentations/KeynoteKiller.html ## Working with Directories $ landslide slides/ ## Working with Direct Output $ landslide slides.md -o | tidy ## Using an Alternate Landslide Theme $ landslide slides.md -t mytheme $ landslide slides.md -t /path/to/theme/dir ## Embedding Base-64-Encoded Images $ landslide slides.md -i ## Exporting to PDF $ landslide slides.md -d PowerpointIsDead.pdf # Theming A Landslide theme is a directory following this simple structure: mytheme/ |-- base.html |-- css | |-- print.css | `-- screen.css `-- js `-- slides.js If a theme does not provide HTML and JS files, those from the default theme will be used. CSS is not optional. Last, you can also copy the whole theme directory to your presentation one by passing the `--copy-theme` option to the `landslide` command: $ landslide slides.md -t /path/to/some/theme --copy-theme # User stylesheets and Javascripts If you don't want to bother making your own theme for tweaking up a bit your presentation style and/or add some interactivity using tiny bits of Javascript, you can include your own user css and js files to the generated presentation. This feature is only available if you use a landslide configuration file, by setting the `css` and/or `js` flags: [landslide] theme = /path/to/my/beautiful/theme source = slides.mdown css = custom.css js = jquery.js powerpoint.js These will link the ``custom.css`` stylesheet and both the ``jquery.js`` and ``powerpoint.js`` files within the ```` section of the presentation html file. **NOTE:** Paths to the css and js files must be relative to the directory you're running the ``landslide`` command from. # Publishing your Presentation Online If you intend to publish your HTML presentation online, you'll have to use the `--relative` option, as well as the `--copy-theme` one to have all asset links relative to the root of your presentation; $ landslide slides.md --relative --copy-theme That way, you'll just have to host the whole presentation directory to a webserver. Of course, no Python nor PHP nor anything else than a HTTP webserver (like Apache) is required to host a landslide presentation. Check out a [Landslide presentation customized this way](http://www.akei.com/presentations/2011-Djangocong/index.html). ## Theme Variables The `base.html` must be a [Jinja2 template file](http://jinja.pocoo.org/2/documentation/templates) where you can harness the following template variables: - `css`: the stylesheet contents, available via two keys, `print` and `screen`, both having: - a `path_url` key storing the url to the asset file path - a `contents` key storing the asset contents - `js`: the javascript contents, having: - a `path_url` key storing the url to the asset file path - a `contents` key storing the asset contents - `slides`: the slides list, each one having these properties: - `header`: the slide title - `content`: the slide contents - `number`: the slide number - `embed`: is the current document a standalone one? - `num_slides`: the number of slides in current presentation - `toc`: the Table of Contents, listing sections of the document. Each section has these properties available: - `title`: the section title - `number`: the slide number of the section - `sub`: subsections, if any # Styles Scope * To change HTML5 presentation styles, tweak the `css/screen.css` stylesheet bundled with the theme you are using * For PDF, modify the `css/print.css` # Authors ## Original Author and Development Lead - Adam Zapletal (adamzap@gmail.com) ## Co-Author - Nicolas Perriault (nperriault@gmail.com) ## Contributors See https://github.com/adamzap/landslide/contributors ## Base Template Authors and Contributors (html5-slides) - Marcin Wichary (mwichary@google.com) - Ernest Delgado (ernestd@google.com) - Alex Russell (slightlyoff@chromium.org)landslide-1.0.1/docs/000077500000000000000000000000001166230554600144105ustar00rootroot00000000000000landslide-1.0.1/docs/Makefile000066400000000000000000000107721166230554600160570ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Landslide.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Landslide.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/Landslide" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Landslide" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." make -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." landslide-1.0.1/docs/conf.py000066400000000000000000000156721166230554600157220ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # Landslide documentation build configuration file, created by # sphinx-quickstart on Sun Feb 27 10:01:49 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../src')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.todo', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Landslide' copyright = u'2011, Adam Zapletal, Nicolas Perriault' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.8' # The full version, including alpha/beta/rc tags. release = '0.8.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. html_show_sourcelink = False # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'Landslidedoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'Landslide.tex', u'Landslide Documentation', u'Adam Zapletal, Nicolas Perriault', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'landslide', u'Landslide Documentation', [u'Adam Zapletal, Nicolas Perriault'], 1) ] landslide-1.0.1/docs/index.rst000066400000000000000000000052361166230554600162570ustar00rootroot00000000000000Landslide's documentation ========================= Landslide_ is a command-line based presentation generator relying on Web standards (html, javascript, css) and some Python_ libraries such as Jinja2_, Pygments_, docutils_ and Markdown_. Installation ------------ Landslide requires Python_ v2.5 minimum and these dependencies installed: * The Jinja2_ template engine * Pygments_ for code syntax highlighting One of the syntax handlers above: * The Markdown_ python library if you intend to write your slides contents using the Markdown_ syntax * or the docutils_ package if you rather prefer using reStructuredText_. The easiest way to install Landslide_ is using Pip_:: $ pip install landslide Alternatively, you can use easy_install_:: $ easy_install landslide If you rather want to stay `on the edge`_:: $ git clone https://github.com/n1k0/landslide.git $ cd landslide $ python setup.py build $ sudo python setup.py install Basic Usage ----------- Using the Markdown_ syntax ~~~~~~~~~~~~~~~~~~~~~~~~~~ * Your Markdown source files must be suffixed by ``.md``, ``.markdn``, ``.mdown`` or ``.markdown`` * To create a title slide, render a single h1 element (eg. ``# My Title``) * Separate your slides with a horizontal rule (``---`` in markdown) except at the end of markdown files * Your other slides should have a heading that renders to an ``

`` or ``

`` element * To highlight blocks of code, put ``!{lang}`` where ``{lang}`` is the pygment supported language identifier as the first indented line Here's a sample presentation based on Markdown:: # My Presentation Heading --- ## My First Slide Title With some contents --- ## My Second Slide Title With some contents Using the reStructuredText_ syntax ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bar API Documentation ----------------- Generator ~~~~~~~~~ .. automodule:: landslide.generator :members: Macros ~~~~~~ .. automodule:: landslide.macro :members: Parser ~~~~~~ .. automodule:: landslide.parser :members: Utils ~~~~~ .. automodule:: landslide.utils :members: Indices and tables ------------------ * :ref:`genindex` * :ref:`modindex` * :ref:`search` .. links .. _docutils: http://docutils.sourceforge.net/ .. _easy_install: http://packages.python.org/distribute/easy_install.html .. _Jinja2: http://jinja.pocoo.org/ .. _Landslide: https://github.com/n1k0/landslide .. _Markdown: http://daringfireball.net/projects/markdown/ .. _on the edge: https://github.com/n1k0/landslide/commits/master/ .. _Pip: http://pip.openplans.org/ .. _Pygments: http://pygments.org/ .. _Python: http://python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.htmllandslide-1.0.1/samples/000077500000000000000000000000001166230554600151245ustar00rootroot00000000000000landslide-1.0.1/samples/example1/000077500000000000000000000000001166230554600166405ustar00rootroot00000000000000landslide-1.0.1/samples/example1/monkey.jpg000066400000000000000000000715341166230554600206560ustar00rootroot00000000000000JFIFddDuckyBAdobed    D!1AQaq"2B#Rb3$rCcS4!1AQaq"2 ?I'Ḧ<ˇlRq^J$P7Nf*FBq uBlpC@BI\֠I'55u [T.)j)$Z )6)MEM9) z|EWED|SԈAPwh8{7Z)dn |[o1_'}} Ԕc։%cc{ޑO= <*ezakFI@ROKI:O p+D QGI(=(l}!.hԑ~#[߮(sާ}=I.>$L[q__ 7Z^RItmf?1T?MrtP{+->Ϊ.Ͽ2/t{ tZ"{sWDN|'E*tYL%͛b*I^]dqXrzdLƦ@$ 4O 0 M(mRWΠ@}%T.=j-8,rph(E i[mt4 愵TQG:mQ@rPGhZz5mpZ «%)>*G 4ʸdY}#@ʂq^ @ຢ<cª/oq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ۗzwmǛަ>O;d|/< NltI6L?Z'9ۘ ]3$:wLǍJ(><ñc!!t>Rr sG6W_#זN_Ìd`ݹGg9g&1]9!)=C`9Xv;ՋUi#zF6-guq.*6 Yn˸/κ#٢|{4INT%`q& hTYnrpsumVIj4AFv-P蟧0k]=H`y`ܬ?O̜k[sbKap;XxOӘ. |]limaV<5p9.w `nokQcQo?Jpow[y޵DŽocf+D5YK?*_QڼyXs ^M"6Tdm+;h篢CuQm'ߗ_:kV/kTCU [N*%N~$-h28<PT&@'_e'[r*?,wҬ } &J+Ȟʱw|›ӆ,A֜y-]4uɾC˧*|yWEE7p=tm#=}Mmbtq o.ɵV=xu>Op{vO?aMt*?4ޕkD~RpTD_e3>OmM?ZҀ*jo[K4 Jt4ץ_"}MUX?A=UysF'#"~ڭ^rSw.Aɳj_ZQwݿޏv<~}{w.OAlvxm_mzg|8^'n>ss>_Mwj&Vq-tQ}On/.I\sWuR|_#fϘ\+7!r*5ׇo=SK$ׅtx= nO&Wq__Yw>pOMڥUWܞ6nDz6RSa/zmtֲS*㖧g>}-꣕f~Wv:V6_7DZ\\r=8y6ÝeKjv+Ͷ ٣}|z\e|?landslide-1.0.1/samples/example1/slides.md000066400000000000000000000051441166230554600204510ustar00rootroot00000000000000Landslide ========= --- Landslide --------- .notes: plop Generates a slideshow using the slides that power [the html5-slides presentation](http://apirocks.com/html5/html5.html). A `python` with the `jinja2`, `markdown`, and `pygments` modules is required. Markdown Formatting Instructions -------------------------------- - Separate your slides with a horizontal rule (--- in markdown) - Your first slide (title slide) should not have a heading, only `

`s - Your other slides should have a heading that renders to an h1 element - To highlight blocks of code, put !{{lang}} as the first indented line - See the included slides.md for an example Rendering Instructions ---------------------- - Put your markdown content in a file called `slides.md` - Run `python render.py` - Enjoy your newly generated `presentation.html` --- Slide #2 ======== .fx: foo bar Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean magna tellus, fermentum nec venenatis nec, dapibus id metus. Phasellus nulla massa, consequat nec tempor et, elementum viverra est. Duis sed nisl in eros adipiscing tempor. Section #1 ---------- Integer in dignissim ipsum. Integer pretium nulla at elit facilisis eu feugiat velit consectetur. Section #2 ---------- Donec risus tortor, dictum sollicitudin ornare eu, egestas at purus. Cras consequat lacus vitae lectus faucibus et molestie nisl gravida. Donec tempor, tortor in varius vestibulum, mi odio laoreet magna, in hendrerit nibh neque eu eros. Unicode Characters Work ----------------------- © é --- Middle Title Slide ================== --- Slide #3 ======== **Hello Gentlemen** - Mega Man 2 - Mega Man 3 - Spelunky - Dungeon Crawl Stone Soup - Etrian Odyssey *Are you prepared to see beyond the veil of reason?* - DeceasedCrab - Black Cascade - Two Hunters - Diadem of 12 Stars --- Slide #4 ======== First code block: !python while True: print "Everything's gonna be allright" Second code block: !php Third code block: !xml Foligno Madonna, by Raphael This is Raphael's "Foligno" Madonna, painted in 15111512. --- Slide #5 ======== Another code block: !java if (markdown && isEasy()) { return true; } --- Slide #6 ======== An image: ![monkey](monkey.jpg) --- Slide #7 ======== Landslide can generate QR codes: .qr: 450|http://github.com/adamzap/landslide --- This is a slide with no heading. It works too. landslide-1.0.1/samples/example2/000077500000000000000000000000001166230554600166415ustar00rootroot00000000000000landslide-1.0.1/samples/example2/0.md000066400000000000000000000027571166230554600173350ustar00rootroot00000000000000Landslide ========= --- Landslide ========= Generates a slideshow using the slides that power [the html5-slides presentation](http://apirocks.com/html5/html5.html). A `python` with the `jinja2`, `markdown`, and `pygments` modules is required. Markdown Formatting Instructions -------------------------------- - Separate your slides with a horizontal rule (--- in markdown) - Your first slide (title slide) should not have a heading, only `

`s - Your other slides should have a heading that renders to an h1 element - To highlight blocks of code, put !{{lang}} as the first indented line - See the included slides.md for an example Rendering Instructions ---------------------- - Put your markdown content in a file called `slides.md` - Run `python render.py` - Enjoy your newly generated `presentation.html` --- Slide #2 ======== Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean magna tellus, fermentum nec venenatis nec, dapibus id metus. Phasellus nulla massa, consequat nec tempor et, elementum viverra est. Duis sed nisl in eros adipiscing tempor. Section #1 ---------- Integer in dignissim ipsum. Integer pretium nulla at elit facilisis eu feugiat velit consectetur. Section #2 ---------- Donec risus tortor, dictum sollicitudin ornare eu, egestas at purus. Cras consequat lacus vitae lectus faucibus et molestie nisl gravida. Donec tempor, tortor in varius vestibulum, mi odio laoreet magna, in hendrerit nibh neque eu eros. Unicode Characters Work ----------------------- © é landslide-1.0.1/samples/example2/1.md000066400000000000000000000000321166230554600173160ustar00rootroot00000000000000Middle slide ============ landslide-1.0.1/samples/example2/2.md000066400000000000000000000016261166230554600173310ustar00rootroot00000000000000Slide #3, With a Somewhat Long Title ==================================== **Hello Gentlemen** - Mega Man 2 - Mega Man 3 - Spelunky - Dungeon Crawl Stone Soup - Etrian Odyssey *Are you prepared to see beyond the veil of reason?* - DeceasedCrab - Black Cascade - Two Hunters - Diadem of 12 Stars --- Slide #4 ======== render.py --------- First code block: !python import jinja2 import markdown with open('presentation.html', 'w') as outfile: slides_src = markdown.markdown(open('slides.md').read()).split('


\n') slides = [] for slide_src in slides_src: header, content = slide_src.split('\n', 1) slides.append({'header': header, 'content': content}) template = jinja2.Template(open('base.html').read()) outfile.write(template.render({'slides': slides})) Second code block: !php exec('python render.py --help'); landslide-1.0.1/samples/example2/3_sub/000077500000000000000000000000001166230554600176545ustar00rootroot00000000000000landslide-1.0.1/samples/example2/3_sub/0.md000066400000000000000000000001461166230554600203360ustar00rootroot00000000000000A slide in a subdirectory ========================= It also works. An image: ![monkey](monkey.jpg) landslide-1.0.1/samples/example2/3_sub/monkey.jpg000066400000000000000000000715341166230554600216720ustar00rootroot00000000000000JFIFddDuckyBAdobed    D!1AQaq"2B#Rb3$rCcS4!1AQaq"2 ?I'Ḧ<ˇlRq^J$P7Nf*FBq uBlpC@BI\֠I'55u [T.)j)$Z )6)MEM9) z|EWED|SԈAPwh8{7Z)dn |[o1_'}} Ԕc։%cc{ޑO= <*ezakFI@ROKI:O p+D QGI(=(l}!.hԑ~#[߮(sާ}=I.>$L[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QRB\?._iT'w d!JsQǧ)Z*T95]k<+?0[9aw }qE7|k%/pU$X˶(~琖i0 yUǖm^k9"9A^?pY*v*!^[A(!SV<: #Sƭ=(RwăAW^wTەA, P-сEiroKŐzq%mB5\ai؄bWM-B]sZ'ys.F\1caa"ĵs;ܷᝦy}fL寖9u Cz4ۗzwmǛަ>O;d|/< NltI6L?Z'9ۘ ]3$:wLǍJ(><ñc!!t>Rr sG6W_#זN_Ìd`ݹGg9g&1]9!)=C`9Xv;ՋUi#zF6-guq.*6 Yn˸/κ#٢|{4INT%`q& hTYnrpsumVIj4AFv-P蟧0k]=H`y`ܬ?O̜k[sbKap;XxOӘ. |]limaV<5p9.w `nokQcQo?Jpow[y޵DŽocf+D5YK?*_QڼyXs ^M"6Tdm+;h篢CuQm'ߗ_:kV/kTCU [N*%N~$-h28<PT&@'_e'[r*?,wҬ } &J+Ȟʱw|›ӆ,A֜y-]4uɾC˧*|yWEE7p=tm#=}Mmbtq o.ɵV=xu>Op{vO?aMt*?4ޕkD~RpTD_e3>OmM?ZҀ*jo[K4 Jt4ץ_"}MUX?A=UysF'#"~ڭ^rSw.Aɳj_ZQwݿޏv<~}{w.OAlvxm_mzg|8^'n>ss>_Mwj&Vq-tQ}On/.I\sWuR|_#fϘ\+7!r*5ׇo=SK$ׅtx= nO&Wq__Yw>pOMڥUWܞ6nDz6RSa/zmtֲS*㖧g>}-꣕f~Wv:V6_7DZ\\r=8y6ÝeKjv+Ͷ ٣}|z\e|?landslide-1.0.1/samples/example2/4.md000066400000000000000000000001141166230554600173220ustar00rootroot00000000000000Using `.markdown` extension =========================== It works as well. landslide-1.0.1/samples/example3/000077500000000000000000000000001166230554600166425ustar00rootroot00000000000000landslide-1.0.1/samples/example3/slides.koi8_r.rst000066400000000000000000000001141166230554600220450ustar00rootroot00000000000000Slides in ReStructuredText ========================== ---- .landslide-1.0.1/samples/example3/slides.rst000066400000000000000000000015221166230554600206570ustar00rootroot00000000000000Slides in ReStructuredText ========================== ---- Here we Go ---------- This is foo This is bar This is ünicô∂e - This - Is - A - List ---- Middle Title Slide ================== ---- Here we Go Again ---------------- This is foo again This is bargain ---- RST Features ------------ *italics* **bold** ``monospace`` http://docutils.sf.net/ 1. one 2. two ---- Some code now ------------- Let me give you this snippet: .. sourcecode:: python def foo(): "just a test" print bar Then this one, a more ReSTful way (haha, nerd joke spotted) using the ``sourcecode`` directive: .. sourcecode:: python def bar(): """pretty cool""" print baz Then this other one with the ``code-block`` directive: .. code-block:: python def batman(): "foobar" return robin landslide-1.0.1/samples/example3/slides_h3.rst000066400000000000000000000003431166230554600212510ustar00rootroot00000000000000--------- Heading 1 --------- bla bla ---- Heading 2 --------- bla bla ---- Heading 3 ~~~~~~~~~ Oups !! ---- Heading 3 ~~~~~~~~~ oups ! ---- Heading 2 --------- bla ---- ----------- Heading 1.2 ----------- blalandslide-1.0.1/samples/example4/000077500000000000000000000000001166230554600166435ustar00rootroot00000000000000landslide-1.0.1/samples/example4/config.cfg000066400000000000000000000001321166230554600205650ustar00rootroot00000000000000[landslide] theme = default source = ../example1 ../example2 ../example3landslide-1.0.1/samples/test.css000066400000000000000000000000171166230554600166130ustar00rootroot00000000000000* {color: red;}landslide-1.0.1/samples/test.js000066400000000000000000000000151166230554600164350ustar00rootroot00000000000000alert('foo');landslide-1.0.1/setup.py000066400000000000000000000030171166230554600151730ustar00rootroot00000000000000from setuptools import setup, find_packages setup( name='landslide', version='1.0.1', description='Lightweight markup language-based html5 slideshow generator', packages=find_packages('src'), package_dir = {'': 'src'}, include_package_data=True, zip_safe=False, author='Adam Zapletal', author_email='adamzap@gmail.com', url='http://github.com/adamzap/landslide', license='Apache 2.0', platforms=['any'], keywords=[ 'markdown', 'slideshow', 'presentation', 'rst', 'restructuredtext', 'textile' ], install_requires=['Jinja2', 'Markdown', 'Pygments', 'docutils'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Development Status :: 4 - Beta', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Topic :: Multimedia :: Graphics :: Presentation', 'Topic :: Text Processing :: Markup' ], long_description="""\ Landslide takes your Markdown, RST, or Textile file(s) and generates a slideshow like `this `_. Read the `README `_ for formatting instructions and more information. """, entry_points={ "console_scripts": [ "landslide = landslide.main:main", ] }, ) landslide-1.0.1/src/000077500000000000000000000000001166230554600142475ustar00rootroot00000000000000landslide-1.0.1/src/landslide/000077500000000000000000000000001166230554600162065ustar00rootroot00000000000000landslide-1.0.1/src/landslide/__init__.py000066400000000000000000000000001166230554600203050ustar00rootroot00000000000000landslide-1.0.1/src/landslide/generator.py000066400000000000000000000476021166230554600205570ustar00rootroot00000000000000# -*- coding: utf-8 -*- # Copyright 2010 Adam Zapletal # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import re import codecs import inspect import jinja2 import shutil import tempfile import utils import ConfigParser from subprocess import Popen import macro as macro_module from parser import Parser BASE_DIR = os.path.dirname(__file__) THEMES_DIR = os.path.join(BASE_DIR, 'themes') TOC_MAX_LEVEL = 2 VALID_LINENOS = ('no', 'inline', 'table') class Generator(object): """The Generator class takes and processes presentation source as a file, a folder or a configuration file and provides methods to render them as a presentation. """ DEFAULT_DESTINATION = 'presentation.html' default_macros = [ macro_module.CodeHighlightingMacro, macro_module.EmbedImagesMacro, macro_module.FixImagePathsMacro, macro_module.FxMacro, macro_module.NotesMacro, macro_module.QRMacro, ] user_css = [] user_js = [] def __init__(self, source, **kwargs): """ Configures this generator. Available ``args`` are: - ``source``: source file or directory path Available ``kwargs`` are: - ``copy_theme``: copy theme directory and files into presentation one - ``destination_file``: path to html or PDF destination file - ``direct``: enables direct rendering presentation to stdout - ``debug``: enables debug mode - ``embed``: generates a standalone document, with embedded assets - ``encoding``: the encoding to use for this presentation - ``extensions``: Comma separated list of markdown extensions - ``logger``: a logger lambda to use for logging - ``relative``: enable relative asset urls - ``theme``: path to the theme to use for this presentation - ``verbose``: enables verbose output """ self.copy_theme = kwargs.get('copy_theme', False) self.debug = kwargs.get('debug', False) self.destination_file = kwargs.get('destination_file', 'presentation.html') self.direct = kwargs.get('direct', False) self.embed = kwargs.get('embed', False) self.encoding = kwargs.get('encoding', 'utf8') self.extensions = kwargs.get('extensions', None) self.logger = kwargs.get('logger', None) self.relative = kwargs.get('relative', False) self.theme = kwargs.get('theme', 'default') self.verbose = kwargs.get('verbose', False) self.linenos = self.linenos_check(kwargs.get('linenos')) self.num_slides = 0 self.__toc = [] # macros registering self.macros = [] self.register_macro(*self.default_macros) if self.direct: # Only output html in direct output mode, not log messages self.verbose = False if not source or not os.path.exists(source): raise IOError(u"Source file/directory %s does not exist" % source) self.source_base_dir = os.path.split(os.path.abspath(source))[0] if source.endswith('.cfg'): config = self.parse_config(source) self.source = config.get('source') if not self.source: raise IOError('unable to fetch a valid source from config') self.destination_file = config.get('destination', self.DEFAULT_DESTINATION) self.embed = config.get('embed', False) self.relative = config.get('relative', False) self.theme = config.get('theme', 'default') self.add_user_css(config.get('css', [])) self.add_user_js(config.get('js', [])) self.linenos = self.linenos_check(config.get('linenos')) else: self.source = source if (os.path.exists(self.destination_file) and not os.path.isfile(self.destination_file)): raise IOError(u"Destination %s exists and is not a file" % self.destination_file) if self.destination_file.endswith('.html'): self.file_type = 'html' elif self.destination_file.endswith('.pdf'): self.file_type = 'pdf' self.embed = True else: raise IOError(u"This program can only write html or pdf files. " "Please use one of these file extensions in the " "destination") self.theme_dir = self.find_theme_dir(self.theme, self.copy_theme) self.template_file = self.get_template_file() def add_user_css(self, css_list): """ Adds supplementary user css files to the presentation. The ``css_list`` arg can be either a ``list`` or a ``basestring`` instance. """ if isinstance(css_list, basestring): css_list = [css_list] for css_path in css_list: if css_path and not css_path in self.user_css: if not os.path.exists(css_path): raise IOError('%s user css file not found' % (css_path,)) self.user_css.append({ 'path_url': utils.get_path_url(css_path, self.relative), 'contents': open(css_path).read(), }) def add_user_js(self, js_list): """ Adds supplementary user javascript files to the presentation. The ``js_list`` arg can be either a ``list`` or a ``basestring`` instance. """ if isinstance(js_list, basestring): js_list = [js_list] for js_path in js_list: if js_path and not js_path in self.user_js: if not os.path.exists(js_path): raise IOError('%s user js file not found' % (js_path,)) self.user_js.append({ 'path_url': utils.get_path_url(js_path, self.relative), 'contents': open(js_path).read(), }) def add_toc_entry(self, title, level, slide_number): """ Adds a new entry to current presentation Table of Contents. """ self.__toc.append({'title': title, 'number': slide_number, 'level': level}) @property def toc(self): """ Smart getter for Table of Content list. """ toc = [] stack = [toc] for entry in self.__toc: entry['sub'] = [] while entry['level'] < len(stack): stack.pop() while entry['level'] > len(stack): stack.append(stack[-1][-1]['sub']) stack[-1].append(entry) return toc def execute(self): """ Execute this generator regarding its current configuration. """ if self.direct: if self.file_type == 'pdf': raise IOError(u"Direct output mode is not available for PDF " "export") else: print self.render().encode(self.encoding) else: self.write() self.log(u"Generated file: %s" % self.destination_file) def get_template_file(self): """ Retrieves Jinja2 template file path. """ if os.path.exists(os.path.join(self.theme_dir, 'base.html')): return os.path.join(self.theme_dir, 'base.html') default_dir = os.path.join(THEMES_DIR, 'default') if not os.path.exists(os.path.join(default_dir, 'base.html')): raise IOError(u"Cannot find base.html in default theme") return os.path.join(default_dir, 'base.html') def fetch_contents(self, source): """ Recursively fetches Markdown contents from a single file or directory containing itself Markdown files. """ slides = [] if type(source) is list: for entry in source: slides.extend(self.fetch_contents(entry)) elif os.path.isdir(source): self.log(u"Entering %s" % source) entries = os.listdir(source) entries.sort() for entry in entries: slides.extend(self.fetch_contents(os.path.join(source, entry))) else: try: parser = Parser(os.path.splitext(source)[1], self.encoding, self.extensions) except NotImplementedError: return slides self.log(u"Adding %s (%s)" % (source, parser.format)) try: file = codecs.open(source, encoding=self.encoding) file_contents = file.read() except UnicodeDecodeError: self.log(u"Unable to decode source %s: skipping" % source, 'warning') else: inner_slides = re.split(r'', parser.parse(file_contents)) for inner_slide in inner_slides: slides.append(self.get_slide_vars(inner_slide, source)) if not slides: self.log(u"Exiting %s: no contents found" % source, 'notice') return slides def find_theme_dir(self, theme, copy_theme=False): """ Finds them dir path from its name. """ if os.path.exists(theme): self.theme_dir = theme elif os.path.exists(os.path.join(THEMES_DIR, theme)): self.theme_dir = os.path.join(THEMES_DIR, theme) else: raise IOError(u"Theme %s not found or invalid" % theme) target_theme_dir = os.path.join(os.getcwd(), 'theme') if copy_theme or os.path.exists(target_theme_dir): self.log(u'Copying %s theme directory to %s' % (theme, target_theme_dir)) if not os.path.exists(target_theme_dir): try: shutil.copytree(self.theme_dir, target_theme_dir) except Exception, e: self.log(u"Skipped copy of theme folder: %s" % e) pass self.theme_dir = target_theme_dir return self.theme_dir def get_css(self): """ Fetches and returns stylesheet file path or contents, for both print and screen contexts, depending if we want a standalone presentation or not. """ css = {} print_css = os.path.join(self.theme_dir, 'css', 'print.css') if not os.path.exists(print_css): # Fall back to default theme print_css = os.path.join(THEMES_DIR, 'default', 'css', 'print.css') if not os.path.exists(print_css): raise IOError(u"Cannot find css/print.css in default theme") css['print'] = { 'path_url': utils.get_path_url(print_css, self.relative), 'contents': open(print_css).read(), } screen_css = os.path.join(self.theme_dir, 'css', 'screen.css') if (os.path.exists(screen_css)): css['screen'] = { 'path_url': utils.get_path_url(screen_css, self.relative), 'contents': open(screen_css).read(), } else: self.log(u"No screen stylesheet provided in current theme", 'warning') return css def get_js(self): """ Fetches and returns javascript file path or contents, depending if we want a standalone presentation or not. """ js_file = os.path.join(self.theme_dir, 'js', 'slides.js') if not os.path.exists(js_file): js_file = os.path.join(THEMES_DIR, 'default', 'js', 'slides.js') if not os.path.exists(js_file): raise IOError(u"Cannot find slides.js in default theme") return { 'path_url': utils.get_path_url(js_file, self.relative), 'contents': open(js_file).read(), } def get_slide_vars(self, slide_src, source=None): """ Computes a single slide template vars from its html source code. Also extracts slide informations for the table of contents. """ find = re.search(r'((.+?))\s?(.+)?', slide_src, re.DOTALL | re.UNICODE) presenter_notes = None if not find: header = level = title = None content = slide_src.strip() else: header = find.group(1) level = int(find.group(2)) title = find.group(3) content = find.group(4).strip() if find.group(4) else find.group(4) slide_classes = [] if content: content, slide_classes = self.process_macros(content, source) find = re.search(r']*>presenter notes', content, re.DOTALL | re.UNICODE | re.IGNORECASE) if find: presenter_notes = content[find.end():].strip() content = content[:find.start()] source_dict = {} if source: source_dict = {'rel_path': source, 'abs_path': os.path.abspath(source)} if header or content: return {'header': header, 'title': title, 'level': level, 'content': content, 'classes': slide_classes, 'source': source_dict, 'presenter_notes': presenter_notes} def get_template_vars(self, slides): """ Computes template vars from slides html source code. """ try: head_title = slides[0]['title'] except (IndexError, TypeError): head_title = "Untitled Presentation" for slide_index, slide_vars in enumerate(slides): if not slide_vars: continue self.num_slides += 1 slide_number = slide_vars['number'] = self.num_slides if slide_vars['level'] and slide_vars['level'] <= TOC_MAX_LEVEL: self.add_toc_entry(slide_vars['title'], slide_vars['level'], slide_number) else: # Put something in the TOC even if it doesn't have a title or level self.add_toc_entry(u"-", 1, slide_number) return {'head_title': head_title, 'num_slides': str(self.num_slides), 'slides': slides, 'toc': self.toc, 'embed': self.embed, 'css': self.get_css(), 'js': self.get_js(), 'user_css': self.user_css, 'user_js': self.user_js} def linenos_check(self, value): """ Checks and returns a valid value for the ``linenos`` option. """ return value if value in VALID_LINENOS else 'inline' def log(self, message, type='notice'): """ Logs a message (eventually, override to do something more clever). """ if self.logger and not callable(self.logger): raise ValueError(u"Invalid logger set, must be a callable") if self.verbose and self.logger: self.logger(message, type) def parse_config(self, config_source): """ Parses a landslide configuration file and returns a normalized python dict. """ self.log(u"Config %s" % config_source) try: raw_config = ConfigParser.RawConfigParser() raw_config.read(config_source) except Exception, e: raise RuntimeError(u"Invalid configuration file: %s" % e) config = {} config['source'] = raw_config.get('landslide', 'source')\ .replace('\r', '').split('\n') if raw_config.has_option('landslide', 'theme'): config['theme'] = raw_config.get('landslide', 'theme') self.log(u"Using configured theme %s" % config['theme']) if raw_config.has_option('landslide', 'destination'): config['destination'] = raw_config.get('landslide', 'destination') if raw_config.has_option('landslide', 'linenos'): config['linenos'] = raw_config.get('landslide', 'linenos') if raw_config.has_option('landslide', 'embed'): config['embed'] = raw_config.getboolean('landslide', 'embed') if raw_config.has_option('landslide', 'relative'): config['relative'] = raw_config.getboolean('landslide', 'relative') if raw_config.has_option('landslide', 'css'): config['css'] = raw_config.get('landslide', 'css')\ .replace('\r', '').split('\n') if raw_config.has_option('landslide', 'js'): config['js'] = raw_config.get('landslide', 'js')\ .replace('\r', '').split('\n') return config def process_macros(self, content, source=None): """ Processed all macros. """ macro_options = {'relative': self.relative, 'linenos': self.linenos} classes = [] for macro_class in self.macros: try: macro = macro_class(logger=self.logger, embed=self.embed, options=macro_options) content, add_classes = macro.process(content, source) if add_classes: classes += add_classes except Exception, e: self.log(u"%s processing failed in %s: %s" % (macro, source, e)) return content, classes def register_macro(self, *macros): """ Registers macro classes passed a method arguments. """ for m in macros: if inspect.isclass(m) and issubclass(m, macro_module.Macro): self.macros.append(m) else: raise TypeError("Coundn't register macro; a macro must inherit" " from macro.Macro") def render(self): """ Returns generated html code. """ template_src = codecs.open(self.template_file, encoding=self.encoding) template = jinja2.Template(template_src.read()) slides = self.fetch_contents(self.source) context = self.get_template_vars(slides) html = template.render(context) if self.embed: images = re.findall(r'\s+background(?:-image)?:\surl\((.+?)\).+;', html, re.DOTALL | re.UNICODE) for img_url in images: img_url = img_url.replace('"', '').replace("'", '') source = os.path.join(THEMES_DIR, self.theme, 'css') encoded_url = utils.encode_image_from_url(img_url, source) html = html.replace(img_url, encoded_url, 1) return html def write(self): """ Writes generated presentation code into the destination file. """ html = self.render() if self.file_type == 'pdf': self.write_pdf(html) else: outfile = codecs.open(self.destination_file, 'w', encoding='utf_8') outfile.write(html) def write_pdf(self, html): """ Tries to write a PDF export from the command line using PrinceXML if available. """ try: f = tempfile.NamedTemporaryFile(delete=False, suffix='.html') f.write(html.encode('utf_8', 'xmlcharrefreplace')) f.close() except Exception: raise IOError(u"Unable to create temporary file, aborting") dummy_fh = open(os.path.devnull, 'w') try: command = ["prince", f.name, self.destination_file] Popen(command, stderr=dummy_fh).communicate() except Exception: raise EnvironmentError(u"Unable to generate PDF file using " "prince. Is it installed and available?") finally: dummy_fh.close() landslide-1.0.1/src/landslide/macro.py000066400000000000000000000137151166230554600176700ustar00rootroot00000000000000# -*- coding: utf-8 -*- # Copyright 2010 Adam Zapletal # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import re import htmlentitydefs import pygments import sys import utils from pygments.lexers import get_lexer_by_name from pygments.formatters import HtmlFormatter class Macro(object): """Base class for Macros. A Macro aims to analyse, process and eventually alter some provided HTML contents and to provide supplementary informations to the slide context. """ options = {} def __init__(self, logger=sys.stdout, embed=False, options=None): self.logger = logger self.embed = embed if options: if not isinstance(options, dict): raise ValueError(u'Macro options must be a dict instance') self.options = options def process(self, content, source=None): """Generic processor (does actually nothing)""" return content, [] class CodeHighlightingMacro(Macro): """This Macro performs syntax coloration in slide code blocks using Pygments. """ code_blocks_re = re.compile( r'(()?\s?!(\w+?)\n(.*?)()?

)', re.UNICODE | re.MULTILINE | re.DOTALL) html_entity_re = re.compile('&(\w+?);') def descape(self, string, defs=None): """Decodes html entities from a given string""" if defs is None: defs = htmlentitydefs.entitydefs f = lambda m: defs[m.group(1)] if len(m.groups()) > 0 else m.group(0) return self.html_entity_re.sub(f, string) def process(self, content, source=None): code_blocks = self.code_blocks_re.findall(content) if not code_blocks: return content, [] classes = [] for block, void1, lang, code, void2 in code_blocks: try: lexer = get_lexer_by_name(lang) except Exception: self.logger(u"Unknown pygment lexer \"%s\", skipping" % lang, 'warning') return content, classes if 'linenos' not in self.options or self.options['linenos'] =='no': self.options['linenos'] = False formatter = HtmlFormatter(linenos=self.options['linenos'], nobackground=True) pretty_code = pygments.highlight(self.descape(code), lexer, formatter) content = content.replace(block, pretty_code, 1) return content, [u'has_code'] class EmbedImagesMacro(Macro): """This Macro extracts images url and embed them using the base64 algorithm. """ def process(self, content, source=None): classes = [] if not self.embed: return content, classes images = re.findall(r'', content, re.DOTALL | re.UNICODE) source_dir = os.path.dirname(source) for image_url in images: encoded_url = utils.encode_image_from_url(image_url, source_dir) if not encoded_url: self.logger(u"Failed to embed image \"%s\"" % image_url, 'warning') return content, classes content = content.replace(u"src=\"" + image_url, u"src=\"" + encoded_url, 1) self.logger(u"Embedded image %s" % image_url, 'notice') return content, classes class FixImagePathsMacro(Macro): """This Macro replaces html image paths with fully qualified absolute urls. """ relative = False def process(self, content, source=None): classes = [] if self.embed: return content, classes base_path = utils.get_path_url(source, self.options.get('relative')) base_url = os.path.split(base_path)[0] images = re.findall(r'', content, re.DOTALL | re.UNICODE) for image in images: full_path = os.path.join(base_url, image) content = content.replace(image, full_path) return content, classes class FxMacro(Macro): """This Macro processes fx directives, ie adds specific css classes named after what the parser found in them. """ def process(self, content, source=None): classes = [] fx_match = re.search(r'(

\.fx:\s?(.*?)

\n?)', content, re.DOTALL | re.UNICODE) if fx_match: classes = fx_match.group(2).split(u' ') content = content.replace(fx_match.group(1), '', 1) return content, classes class NotesMacro(Macro): """This Macro processes Notes.""" def process(self, content, source=None): classes = [] new_content = re.sub(r'

\.notes:\s?(.*?)

', r'

\1

', content) if content != new_content: classes.append(u'has_notes') return new_content, classes class QRMacro(Macro): """This Macro generates a QR Code with Google Chart API.""" def process(self, content, source=None): classes = [] new_content = re.sub(r'

\.qr:\s?(\d*?)\|(.*?)

', r'

QR Code

', content) if content != new_content: classes.append(u'has_qr') return new_content, classes landslide-1.0.1/src/landslide/main.py000077500000000000000000000113141166230554600175070ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 Adam Zapletal # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import sys try: from landslide import generator except ImportError: import generator from optparse import OptionParser def _parse_options(): """ Parses ``landslide`` args options. """ parser = OptionParser( usage="%prog [options] input.md ...", description="Generates an HTML5 or PDF " "slideshow from Markdown or other formats", epilog="Note: PDF export requires the `prince` program: " "http://princexml.com/") parser.add_option( "-c", "--copy-theme", action="store_true", dest="copy_theme", help="Copy theme directory into current presentation source directory", default=False) parser.add_option( "-b", "--debug", action="store_true", dest="debug", help="Will display any exception trace to stdout", default=False) parser.add_option( "-d", "--destination", dest="destination_file", help="The path to the to the destination file: .html or " ".pdf extensions allowed (default: presentation.html)", metavar="FILE", default="presentation.html") parser.add_option( "-e", "--encoding", dest="encoding", help="The encoding of your files (defaults to utf8)", metavar="ENCODING", default="utf8") parser.add_option( "-i", "--embed", action="store_true", dest="embed", help="Embed stylesheet and javascript contents, " "base64-encoded images in presentation to make a " "standalone document", default=False) parser.add_option( "-l", "--linenos", type="choice", choices=generator.VALID_LINENOS, dest="linenos", help="How to output linenos in source code. Three options availables: " "no (no line numbers); " "inline (inside
 tag); "
        "table (lines numbers in another cell, copy-paste friendly)",
        default="inline",
    )

    parser.add_option(
        "-o", "--direct-output",
        action="store_true",
        dest="direct",
        help="Prints the generated HTML code to stdout; won't work with PDF "
             "export",
        default=False)

    parser.add_option(
        "-q", "--quiet",
        action="store_false",
        dest="verbose",
        help="Won't write anything to stdout (silent mode)",
        default=False)

    parser.add_option(
        "-r", "--relative",
        action="store_true",
        dest="relative",
        help="Make your presentation asset links relative to current pwd; "
             "This may be useful if you intend to publish your html "
             "presentation online.",
        default=False,
    )

    parser.add_option(
        "-t", "--theme",
        dest="theme",
        help="A theme name, or path to a landlside theme directory",
        default='default')

    parser.add_option(
        "-v", "--verbose",
        action="store_true",
        dest="verbose",
        help="Write informational messages to stdout (enabled by default)",
        default=True)

    parser.add_option(
        "-x", "--extensions",
        dest="extensions",
        help="Comma-separated list of extensions for Markdown",
        default='',
    )

    (options, args) = parser.parse_args()

    if not args:
        parser.print_help()
        sys.exit(1)

    return options, args[0]


def log(message, type):
    """Basic logger, print output directly to stdout and errors to stderr.
    """
    (sys.stdout if type == 'notice' else sys.stderr).write(message + "\n")


def run(input_file, options):
    """ Runs the Generator using parsed options.
    """
    options.logger = log
    generator.Generator(input_file, **options.__dict__).execute()


def main():
    """ Main program entry point.
    """
    options, input_file = _parse_options()

    if (options.debug):
        run(input_file, options)
    else:
        try:
            run(input_file, options)
        except Exception, e:
            sys.stderr.write("Error: %s\n" % e)
            sys.exit(1)


if __name__ == '__main__':
    main()
landslide-1.0.1/src/landslide/parser.py000066400000000000000000000067161166230554600200660ustar00rootroot00000000000000# -*- coding: utf-8 -*-

#  Copyright 2010 Adam Zapletal
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

import re

SUPPORTED_FORMATS = {
    'markdown':         ['.mdown', '.markdown', '.markdn', '.md', '.mdn'],
    'restructuredtext': ['.rst', '.rest'],
    'textile':          ['.textile'],
}


class Parser(object):
    """This class generates the HTML code depending on which syntax is used in
       the souce document.

       The Parser currently supports both Markdown and restructuredText
       syntaxes.
    """
    RST_REPLACEMENTS = [
            (r'', r'', re.UNICODE),
            (r'', r'', re.UNICODE),
            (r'

.*?

', r'', re.UNICODE), (r'Document or section may not begin with a transition\.', r'', re.UNICODE), (r'', r'', re.DOTALL | re.UNICODE), (r'\n', r'
\n', re.DOTALL | re.UNICODE), ] md_extensions = '' def __init__(self, extension, encoding='utf8', md_extensions=''): """Configures this parser. """ self.encoding = encoding self.format = None for supp_format, supp_extensions in SUPPORTED_FORMATS.items(): for supp_extension in supp_extensions: if supp_extension == extension: self.format = supp_format if not self.format: raise NotImplementedError(u"Unsupported format %s" % extension) if md_extensions: exts = (value.strip() for value in md_extensions.split(',')) self.md_extensions = filter(None, exts) def parse(self, text): """Parses and renders a text as HTML regarding current format. """ if self.format == 'markdown': try: import markdown except ImportError: raise RuntimeError(u"Looks like markdown is not installed") if text.startswith(u'\ufeff'): # check for unicode BOM text = text[1:] return markdown.markdown(text, self.md_extensions) elif self.format == 'restructuredtext': try: from rst import html_body except ImportError: raise RuntimeError(u"Looks like docutils are not installed") html = html_body(text, input_encoding=self.encoding) # RST generates pretty much markup to be removed in our case for (pattern, replacement, mode) in self.RST_REPLACEMENTS: html = re.sub(re.compile(pattern, mode), replacement, html, 0) return html.strip() elif self.format == 'textile': try: import textile except ImportError: raise RuntimeError(u"Looks like textile is not installed") return textile.textile(text, encoding=self.encoding) else: raise NotImplementedError(u"Unsupported format %s, cannot parse" % self.format) landslide-1.0.1/src/landslide/rst.py000066400000000000000000000100751166230554600173730ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # Copyright 2010 Adam Zapletal # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from docutils import core, nodes from docutils.parsers.rst import directives, Directive from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import get_lexer_by_name, TextLexer DEFAULT = HtmlFormatter(noclasses=False) VARIANTS = {} class Pygments(Directive): """ Source code syntax hightlighting for ReST syntax.""" required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True option_spec = dict([(key, directives.flag) for key in VARIANTS]) has_content = True def run(self): self.assert_has_content() try: lexer = get_lexer_by_name(self.arguments[0]) except ValueError: # no lexer found - use the text one instead of an exception lexer = TextLexer() # take an arbitrary option if more than one is given formatter = (self.options and VARIANTS[self.options.keys()[0]] or DEFAULT) parsed = highlight(u'\n'.join(self.content), lexer, formatter) return [nodes.raw('', parsed, format='html')] directives.register_directive('sourcecode', Pygments) directives.register_directive('code-block', Pygments) def html_parts(input_string, source_path=None, destination_path=None, input_encoding='unicode', doctitle=1, initial_header_level=1): """ Given an input string, returns a dictionary of HTML document parts. Dictionary keys are the names of parts, and values are Unicode strings; encoding is up to the client. Parameters: - `input_string`: A multi-line text string; required. - `source_path`: Path to the source file or object. Optional, but useful for diagnostic output (system messages). - `destination_path`: Path to the file or object which will receive the output; optional. Used for determining relative paths (stylesheets, source links, etc.). - `input_encoding`: The encoding of `input_string`. If it is an encoded 8-bit string, provide the correct encoding. If it is a Unicode string, use "unicode", the default. - `doctitle`: Disable the promotion of a lone top-level section title to document title (and subsequent section title to document subtitle promotion); enabled by default. - `initial_header_level`: The initial level for header elements (e.g. 1 for "

"). """ overrides = {'input_encoding': input_encoding, 'doctitle_xform': doctitle, 'initial_header_level': initial_header_level} parts = core.publish_parts( source=input_string, source_path=source_path, destination_path=destination_path, writer_name='html', settings_overrides=overrides) return parts def html_body(input_string, source_path=None, destination_path=None, input_encoding='unicode', doctitle=1, initial_header_level=1): """ Given an input string, returns an HTML fragment as a string. The return value is the contents of the element. Parameters (see `html_parts()` for the remainder): - `output_encoding`: The desired encoding of the output. If a Unicode string is desired, use the default value of "unicode" . """ parts = html_parts( input_string=input_string, source_path=source_path, destination_path=destination_path, input_encoding=input_encoding, doctitle=doctitle, initial_header_level=initial_header_level) fragment = parts['html_body'] return fragment landslide-1.0.1/src/landslide/tests.py000066400000000000000000000225371166230554600177330ustar00rootroot00000000000000# -*- coding: utf-8 -*- # Copyright 2010 Adam Zapletal # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import macro import os import re import unittest import codecs from generator import Generator from parser import Parser SAMPLES_DIR = os.path.join(os.path.dirname(__file__), '..', '..', 'samples') if (not os.path.exists(SAMPLES_DIR)): raise IOError('Sample source files not found, cannot run tests') class BaseTestCase(unittest.TestCase): def logtest(self, message, type='notice'): if type == 'warning': raise WarningMessage(message) elif type == 'error': raise ErrorMessage(message) class GeneratorTest(BaseTestCase): def test___init__(self): self.assertRaises(IOError, Generator, None) self.assertRaises(IOError, Generator, 'foo.md') def test_add_user_assets(self): base_dir = os.path.join(SAMPLES_DIR, 'example1', 'slides.md') g = Generator(base_dir, logger=self.logtest) g.add_user_css(os.path.join(SAMPLES_DIR, 'test.css')) g.add_user_js(os.path.join(SAMPLES_DIR, 'test.js')) self.assertEquals(g.user_css[0]['contents'], '* {color: red;}') self.assertEquals(g.user_js[0]['contents'], "alert('foo');") def test_get_toc(self): base_dir = os.path.join(SAMPLES_DIR, 'example1', 'slides.md') g = Generator(base_dir, logger=self.logtest) g.add_toc_entry('Section 1', 1, 1) g.add_toc_entry('Section 1.1', 2, 2) g.add_toc_entry('Section 1.2', 2, 3) g.add_toc_entry('Section 2', 1, 4) g.add_toc_entry('Section 2.1', 2, 5) g.add_toc_entry('Section 3', 1, 6) toc = g.toc self.assertEquals(len(toc), 3) self.assertEquals(toc[0]['title'], 'Section 1') self.assertEquals(len(toc[0]['sub']), 2) self.assertEquals(toc[0]['sub'][1]['title'], 'Section 1.2') self.assertEquals(toc[1]['title'], 'Section 2') self.assertEquals(len(toc[1]['sub']), 1) self.assertEquals(toc[2]['title'], 'Section 3') self.assertEquals(len(toc[2]['sub']), 0) def test_get_slide_vars(self): g = Generator(os.path.join(SAMPLES_DIR, 'example1', 'slides.md')) svars = g.get_slide_vars("

heading

\n

foo

\n

bar

\n") self.assertEquals(svars['title'], 'heading') self.assertEquals(svars['level'], 1) self.assertEquals(svars['header'], '

heading

') self.assertEquals(svars['content'], '

foo

\n

bar

') self.assertEquals(svars['source'], {}) self.assertEquals(svars['classes'], []) def test_unicode(self): g = Generator(os.path.join(SAMPLES_DIR, 'example3', 'slides.rst')) g.execute() s = g.render() self.assertTrue(s.find('
') != -1)
        self.assertEquals(len(re.findall('
foo

\n

.notes: bar

\n

baz

') self.assertEquals(r[0].find('

bar

'), 11) self.assertEquals(r[1], [u'has_notes']) # FXs content = '

foo

\n

.fx: blah blob

\n

baz

' r = g.process_macros(content) self.assertEquals(r[0], '

foo

\n

baz

') self.assertEquals(r[1][0], 'blah') self.assertEquals(r[1][1], 'blob') def test_register_macro(self): g = Generator(os.path.join(SAMPLES_DIR, 'example1', 'slides.md')) class SampleMacro(macro.Macro): pass g.register_macro(SampleMacro) self.assertTrue(SampleMacro in g.macros) def plop(foo): pass self.assertRaises(TypeError, g.register_macro, plop) class CodeHighlightingMacroTest(BaseTestCase): def setUp(self): self.sample_html = '''

Let me give you this snippet:

!python
def foo():
    "just a test"
    print bar

Then this one:

!php

Then this other one:

!xml

    baz

End here.

''' def test_parsing_code_blocks(self): m = macro.CodeHighlightingMacro(self.logtest) blocks = m.code_blocks_re.findall(self.sample_html) self.assertEquals(len(blocks), 3) self.assertEquals(blocks[0][2], 'python') self.assertTrue(blocks[0][3].startswith('def foo():')) self.assertEquals(blocks[1][2], 'php') self.assertTrue(blocks[1][3].startswith('')) def test_descape(self): m = macro.CodeHighlightingMacro(self.logtest) self.assertEquals(m.descape('foo'), 'foo') self.assertEquals(m.descape('>'), '>') self.assertEquals(m.descape('<'), '<') self.assertEquals(m.descape('&lt;'), '<') self.assertEquals(m.descape('<span>'), '') self.assertEquals(m.descape('<spam&eggs>'), '') def test_process(self): m = macro.CodeHighlightingMacro(self.logtest) hl = m.process("
!php\n$foo;
") self.assertTrue(hl[0].startswith('
Let me give you this')) self.assertTrue(hl[0].find('

Then this one') > 0) self.assertTrue(hl[0].find('

Then this other one') > 0) self.assertTrue(hl[0].find('

0) self.assertEquals(hl[1][0], u'has_code') class EmbedImagesMacroTest(BaseTestCase): def test_process(self): base_dir = os.path.join(SAMPLES_DIR, 'example1', 'slides.md') m = macro.EmbedImagesMacro(self.logtest, True) self.assertRaises(WarningMessage, m.process, '', '.') content, classes = m.process('', base_dir) self.assertTrue(re.match(r'', content)) class FixImagePathsMacroTest(BaseTestCase): def test_process(self): base_dir = os.path.join(SAMPLES_DIR, 'example1', 'slides.md') m = macro.FixImagePathsMacro(self.logtest, False) content, classes = m.process('', base_dir) self.assertTrue(re.match(r'', content)) class FxMacroTest(BaseTestCase): def test_process(self): m = macro.FxMacro(self.logtest) content = '

foo

\n

.fx: blah blob

\n

baz

' r = m.process(content) self.assertEquals(r[0], '

foo

\n

baz

') self.assertEquals(r[1][0], 'blah') self.assertEquals(r[1][1], 'blob') class NotesMacroTest(BaseTestCase): def test_process(self): m = macro.NotesMacro(self.logtest) r = m.process('

foo

\n

.notes: bar

\n

baz

') self.assertEquals(r[0].find('

bar

'), 11) self.assertEquals(r[1], [u'has_notes']) class ParserTest(BaseTestCase): def test___init__(self): self.assertEquals(Parser('.md').format, 'markdown') self.assertEquals(Parser('.markdown').format, 'markdown') self.assertEquals(Parser('.rst').format, 'restructuredtext') self.assertRaises(NotImplementedError, Parser, '.txt') class WarningMessage(Exception): pass class ErrorMessage(Exception): pass if __name__ == '__main__': unittest.main() landslide-1.0.1/src/landslide/themes/000077500000000000000000000000001166230554600174735ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/default/000077500000000000000000000000001166230554600211175ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/default/base.html000066400000000000000000000123221166230554600227170ustar00rootroot00000000000000 {{ head_title }} {% if embed %} {% else %} {% endif %} {% for css in user_css %} {% if embed %} {% else %} {% endif %} {% endfor %} {% if embed %} {% else %} {% endif %} {% for js in user_js %} {% if embed %} {% else %} {% endif %} {% endfor %}
{% for slide in slides %}
{% if slide.header %}
{{ slide.header }}
{% endif %} {% if slide.content %}
{{ slide.content }}
{% endif %}

Presenter Notes

{% if slide.presenter_notes %} {{ slide.presenter_notes }} {% endif %}
{% endfor %}
{% if toc %} {% endif %} landslide-1.0.1/src/landslide/themes/default/css/000077500000000000000000000000001166230554600217075ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/default/css/print.css000066400000000000000000000023671166230554600235650ustar00rootroot00000000000000* { margin: 0; padding: 0; } @page { size: landscape; } body { font: 100% "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; padding: 0; margin: 0; } div.slide { min-width: 800px; min-height: 600px; padding: 1em; overflow: hidden; page-break-after: always; border: 1px solid black; border-radius: 20px; } div.slide div.inner { width: 800px; height: 600px; margin: auto; display: table-cell; } h1 { font-size: 2.4em; } h2 { font-size: 1.4em; } h3 { margin: 1em 0; } ul { margin: 0; padding: 0; } p, li, pre { margin: 1em 0; } li { margin-left: 2em; } a { color: #000000; } pre, code { max-width: 800px; background: #eee; font-family: Monaco, monospace; font-size: 90%; } pre { padding: .2em .5em; overflow: hidden; border-radius: .8em; } code { padding: 0 .2em; } .slide header:only-child h1 { line-height: 180%; text-align: center; display: table-cell; vertical-align: middle; height: 600px; width: 800px; font-size: 48px; margin-top:100px; margin-bottom:100px; } #toc, #help, .slide aside, .slide footer, .slide .notes, .presenter_notes, #current_presenter_notes, #presenter_note { display: none; } landslide-1.0.1/src/landslide/themes/default/css/screen.css000066400000000000000000000276661166230554600237210ustar00rootroot00000000000000body { font: 14px "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; background: #778; padding: 0; margin: 0; overflow: hidden; } div.presentation { position: absolute; width: 100%; display: table-cell; vertical-align: middle; height: 100%; background: inherit; } div.presentation > h1 { display: none; } div.slides, body.expose div.slides.nocontext { width: 100%; height: 100%; left: 0; top: 0; position: absolute; display: block; } div.slides.nocontext { width: 900px; margin: 0 auto; overflow: hidden; position: relative; left: auto; top: auto; } div.slide { display: inline; position: absolute; overflow: hidden; width: 900px; height: 700px; margin-top: -350px; margin-left: -400px; left: 50%; top: 50%; background: -webkit-gradient(linear, left bottom, left top, from(#bbd), to(#fff)); background-color: #eee; background: -moz-linear-gradient(bottom, #bbd, #fff); -webkit-transition: margin 0.25s ease-in-out; -moz-transition: margin 0.25s ease-in-out; -o-transition: margin 0.25s ease-in-out; border-top-left-radius: 20px; -moz-border-radius-topleft: 20px; -webkit-border-top-left-radius: 20px; border-top-right-radius: 20px; -moz-border-radius-topright: 20px; -webkit-border-top-right-radius: 20px; border-bottom-right-radius: 20px; -moz-border-radius-bottomright: 20px; -webkit-border-bottom-right-radius: 20px; border-bottom-left-radius: 20px; -moz-border-radius-bottomleft: 20px; -webkit-border-bottom-left-radius: 20px; } /* Expose */ body.expose div.slides { float: left; position: relative; overflow: auto; margin-bottom: 10px; } body.expose div.slide { display: block; float: left; position: relative; left: auto !important; top: auto !important; margin: 10px !important; -webkit-transition: none; -moz-transition: none; -o-transition: none; -moz-transform: scale(.33, .33); -moz-transform-origin: 0 0; -webkit-transform: scale(.33, .33); -webkit-transform-origin: 0 0; -o-transform: scale(.33, .33); -o-transform-origin: 0 0; -webkit-transition: none; -moz-transition: none; -o-transition: none; cursor: pointer; } body.expose div.slide:hover { background: -webkit-gradient(linear, left bottom, left top, from(#bdd), to(#fff)); background-color: #eee; background: -moz-linear-gradient(bottom, #bdd, #fff); } body.expose .slide-wrapper { float: left; position: relative; margin: .5%; width: 300px; height: 233px; } body.expose .slide footer { } body.expose .slide .inner { } body.expose .slide.far-past, body.expose .slide.past, body.expose .slide.future, body.expose .slide.far-future { margin-left: 0; } body.expose .slide.current { background: -webkit-gradient(linear, left bottom, left top, from(#ddb), to(#fff)); background-color: #eee; background: -moz-linear-gradient(bottom, #ddb, #fff); border: 16px solid #fff; -moz-transform: scale(.315, .315); -moz-transform-origin: 0 0; -webkit-transform: scale(.315, .315); -webkit-transform-origin: 0 0; -o-transform: scale(.315, .315); -o-transform-origin: 0 0; } /* Presenter Mode */ body.presenter_view div.slide { display: inline; position: absolute; overflow: hidden; -moz-transform: scale(.5, .5); -moz-transform-origin: 0 0; -webkit-transform: scale(.5, .5); -webkit-transform-origin: 0 0; -o-transform: scale(.5, .5); -o-transform-origin: 0 0; margin-top: -300px; } body.presenter_view .slide.far-past { display: block; margin-left: -1500px; } body.presenter_view .slide.past { display: block; margin-left: -975px; } body.presenter_view .slide.current { display: block; margin-left: -475px; border: 8px solid maroon; z-index: 2; } body.presenter_view .slide.future { display: block; margin-left: 25px; z-index: 1; } body.presenter_view .slide.far-future { display: block; margin-left: 525px; } body.presenter_view div#current_presenter_notes { visibility: visible; display: block; position: absolute; overflow: auto; vertical-align: middle; left: 50%; top: 50%; margin-left: -475px; margin-top: 100px; z-index: 2; width: 950px; border-style: solid; height: 30%; background-color: silver; } body.presenter_view div#current_presenter_notes section { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: black; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; display: block; overflow: visible; position: relative; background-color: #fffeff; height: 120px; margin-right: 30px; margin-top: 60px; margin-left: 30px; padding-right: 10px; padding-left: 10px; padding-top: 10px; } body.presenter_view div#current_presenter_notes section p { margin: 0; } body.presenter_view div#current_presenter_notes h1 { font-size: 50%; display: block; } div#current_presenter_notes { display: none; } div.slide div.presenter_notes, div.slides div.presenter_notes { display: none; } /* Slide styles */ div.slide p { font-size: 20px; } .slide.far-past { display: block; margin-left: -2400px; } .slide.past { display: block; margin-left: -1400px; } .slide.current { display: block; margin-left: -450px; } .slide.future { display: block; margin-left: 500px; } .slide.far-future { display: block; margin-left: 1500px; } body.three-d div.slides { -webkit-transform: translateX(50px) scale(0.8) rotateY(10deg); -moz-transform: translateX(50px) scale(0.8) rotateY(10deg); -o-transform: translateX(50px) scale(0.8) rotateY(10deg); } /* Content */ header:not(:only-child) { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; font-weight: normal; font-size: 50px; letter-spacing: -.05em; color: black; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; position: absolute; left: 30px; top: 25px; margin: 0; padding: 0; } header h1, header h2, header h3, header h4, header h5, header h6 { display: inline; font-size: 100%; font-weight: normal; padding: 0; margin: 0; } header h2:first-child { margin-top: 0; } section, .slide header:only-child h1 { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: #3f3f3f; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; margin-left: 30px; margin-right: 30px; margin-top: 100px; display: block; overflow: hidden; } img { display: block; margin: auto; } section img.align-center { display: block; margin-left: auto; margin-right: auto; } section img.align-right { display: block; margin-left: auto; margin-right: 0; } section img.align-left { display: block; margin-right: auto; margin-left: 0; } a { color: inherit; display: inline-block; text-decoration: none; line-height: 110%; border-bottom: 2px solid #3f3f3f; } pre { font-size: 16px; font-family: Monaco, Courier, monospace; } li { padding: 10px 0; font-size: 20px; } .slide header:only-child h1 { line-height: 180%; text-align: center; display: table-cell; vertical-align: middle; height: 700px; width: 900px; font-size: 50px; margin-top:100px; margin-bottom:100px; } .sidebar { clear: both; background: -webkit-gradient(linear, top right, bottom right, from(#dde), to(#fff)); -webkit-transition: margin 0.25s ease-in-out; background-color: #eee; background: -moz-linear-gradient(right, #dde, #fff); border-right: 5px solid #ccd; z-index: 9999999; height: 100%; overflow: hidden; top: 0; position: absolute; display: block; margin: 0; margin-left: -400px; padding: 10px 16px; overflow: auto; -webkit-transition: margin 0.2s ease-in-out; -moz-transition: margin 0.2s ease-in-out; -o-transition: margin 0.2s ease-in-out; } .sidebar h2 { text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; margin: 0 0 16px; padding: 0; } .sidebar table { width: 100%; margin: 0; padding: 0; border-collapse: collapse; } .sidebar table caption { display: none; } .sidebar tr { margin: 2px 0; border-bottom: 1px solid #ccc; } .sidebar th { text-align: left; font-weight: normal; max-width: 300px; overflow: hidden; } .sidebar tr.sub th { text-indent: 20px; } .sidebar td { text-align: right; min-width: 20px; } .sidebar a { display: block; text-decoration: none; border-bottom: none; padding: 4px 0; } .sidebar tr.active { background: #ff0; } aside { display: none; } aside.source { position: absolute; bottom: 6px; left: 10px; text-indent: 10px; } aside.page_number { position: absolute; bottom: 6px; right: 10px; text-indent: 10px; } .notes { display: none; padding: 10px; background: #ccc; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; } div.slide p.notes { font-size: 90%; } /* Pygments default theme */ .hll { background-color: #ffffcc } .c { color: #408080; font-style: italic } /* Comment */ .err { border: 1px solid #FF0000 } /* Error */ .k { color: #008000; font-weight: bold } /* Keyword */ .o { color: #666666 } /* Operator */ .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .cp { color: #BC7A00 } /* Comment.Preproc */ .c1 { color: #408080; font-style: italic } /* Comment.Single */ .cs { color: #408080; font-style: italic } /* Comment.Special */ .gd { color: #A00000 } /* Generic.Deleted */ .ge { font-style: italic } /* Generic.Emph */ .gr { color: #FF0000 } /* Generic.Error */ .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .gi { color: #00A000 } /* Generic.Inserted */ .go { color: #808080 } /* Generic.Output */ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .gs { font-weight: bold } /* Generic.Strong */ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .gt { color: #0040D0 } /* Generic.Traceback */ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .kp { color: #008000 } /* Keyword.Pseudo */ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .kt { color: #B00040 } /* Keyword.Type */ .m { color: #666666 } /* Literal.Number */ .s { color: #BA2121 } /* Literal.String */ .na { color: #7D9029 } /* Name.Attribute */ .nb { color: #008000 } /* Name.Builtin */ .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .no { color: #880000 } /* Name.Constant */ .nd { color: #AA22FF } /* Name.Decorator */ .ni { color: #999999; font-weight: bold } /* Name.Entity */ .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ .nf { color: #0000FF } /* Name.Function */ .nl { color: #A0A000 } /* Name.Label */ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .nt { color: #008000; font-weight: bold } /* Name.Tag */ .nv { color: #19177C } /* Name.Variable */ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .w { color: #bbbbbb } /* Text.Whitespace */ .mf { color: #666666 } /* Literal.Number.Float */ .mh { color: #666666 } /* Literal.Number.Hex */ .mi { color: #666666 } /* Literal.Number.Integer */ .mo { color: #666666 } /* Literal.Number.Oct */ .sb { color: #BA2121 } /* Literal.String.Backtick */ .sc { color: #BA2121 } /* Literal.String.Char */ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .s2 { color: #BA2121 } /* Literal.String.Double */ .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ .sh { color: #BA2121 } /* Literal.String.Heredoc */ .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ .sx { color: #008000 } /* Literal.String.Other */ .sr { color: #BB6688 } /* Literal.String.Regex */ .s1 { color: #BA2121 } /* Literal.String.Single */ .ss { color: #19177C } /* Literal.String.Symbol */ .bp { color: #008000 } /* Name.Builtin.Pseudo */ .vc { color: #19177C } /* Name.Variable.Class */ .vg { color: #19177C } /* Name.Variable.Global */ .vi { color: #19177C } /* Name.Variable.Instance */ .il { color: #666666 } /* Literal.Number.Integer.Long */ #blank { position: absolute; top: 0; left: 0; background-color: black; width: 100%; height: 100%; z-index: 64; display: none; } landslide-1.0.1/src/landslide/themes/default/js/000077500000000000000000000000001166230554600215335ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/default/js/slides.js000066400000000000000000000421571166230554600233650ustar00rootroot00000000000000function main() { // Since we don't have the fallback of attachEvent and // other IE only stuff we won't try to run JS for IE. // It will run though when using Google Chrome Frame if (document.all) { return; } var currentSlideNo; var notesOn = false; var expanded = false; var hiddenContext = false; var blanked = false; var slides = document.getElementsByClassName('slide'); var touchStartX = 0; var spaces = /\s+/, a1 = ['']; var tocOpened = false; var helpOpened = false; var overviewActive = false; var modifierKeyDown = false; var scale = 1; var showingPresenterView = false; var presenterViewWin = null; var isPresenterView = false; var str2array = function(s) { if (typeof s == 'string' || s instanceof String) { if (s.indexOf(' ') < 0) { a1[0] = s; return a1; } else { return s.split(spaces); } } return s; }; var trim = function(str) { return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }; var addClass = function(node, classStr) { classStr = str2array(classStr); var cls = ' ' + node.className + ' '; for (var i = 0, len = classStr.length, c; i < len; ++i) { c = classStr[i]; if (c && cls.indexOf(' ' + c + ' ') < 0) { cls += c + ' '; } } node.className = trim(cls); }; var removeClass = function(node, classStr) { var cls; if (!node) { throw 'no node provided'; } if (classStr !== undefined) { classStr = str2array(classStr); cls = ' ' + node.className + ' '; for (var i = 0, len = classStr.length; i < len; ++i) { cls = cls.replace(' ' + classStr[i] + ' ', ' '); } cls = trim(cls); } else { cls = ''; } if (node.className != cls) { node.className = cls; } }; var getSlideEl = function(slideNo) { if (slideNo > 0) { return slides[slideNo - 1]; } else { return null; } }; var getSlideTitle = function(slideNo) { var el = getSlideEl(slideNo); if (el) { var headers = el.getElementsByTagName('header'); if (headers.length > 0) { return el.getElementsByTagName('header')[0].innerText; } } return null; }; var getSlidePresenterNote = function(slideNo) { var el = getSlideEl(slideNo); if (el) { var n = el.getElementsByClassName('presenter_notes'); if (n.length > 0) { return n[0]; } } return null; }; var changeSlideElClass = function(slideNo, className) { var el = getSlideEl(slideNo); if (el) { removeClass(el, 'far-past past current future far-future'); addClass(el, className); } }; var updateSlideClasses = function(updateOther) { window.location.hash = (isPresenterView ? "presenter" : "slide") + currentSlideNo; for (var i=1; i 1) { currentSlideNo--; } updateSlideClasses(true); }; var showNotes = function() { var notes = getSlideEl(currentSlideNo).getElementsByClassName('notes'); for (var i = 0, len = notes.length; i < len; i++) { notes.item(i).style.display = (notesOn) ? 'none':'block'; } notesOn = !notesOn; }; var showSlideNumbers = function() { var asides = document.getElementsByClassName('page_number'); var hidden = asides[0].style.display != 'block'; for (var i = 0; i < asides.length; i++) { asides.item(i).style.display = hidden ? 'block' : 'none'; } }; var showSlideSources = function() { var asides = document.getElementsByClassName('source'); var hidden = asides[0].style.display != 'block'; for (var i = 0; i < asides.length; i++) { asides.item(i).style.display = hidden ? 'block' : 'none'; } }; var showToc = function() { if (helpOpened) { showHelp(); } var toc = document.getElementById('toc'); if (toc) { toc.style.marginLeft = tocOpened ? '-' + (toc.clientWidth + 20) + 'px' : '0px'; tocOpened = !tocOpened; } updateOverview(); }; var showHelp = function() { if (tocOpened) { showToc(); } var help = document.getElementById('help'); if (help) { help.style.marginLeft = helpOpened ? '-' + (help.clientWidth + 20) + 'px' : '0px'; helpOpened = !helpOpened; } }; var showPresenterView = function() { if (isPresenterView) { return; } if (showingPresenterView) { presenterViewWin.close(); presenterViewWin = null; showingPresenterView = false; } else { presenterViewWin = open(window.location.pathname + "#presenter" + currentSlideNo, 'presenter_notes', 'directories=no,location=no,toolbar=no,menubar=no,copyhistory=no'); showingPresenterView = true; } }; var switch3D = function() { if (document.body.className.indexOf('three-d') == -1) { document.getElementsByClassName('presentation')[0].style.webkitPerspective = '1000px'; document.body.className += ' three-d'; } else { window.setTimeout('document.getElementsByClassName(\'presentation\')[0].style.webkitPerspective = \'0\';', 2000); document.body.className = document.body.className.replace(/three-d/, ''); } }; var toggleOverview = function() { if (!overviewActive) { addClass(document.body, 'expose'); overviewActive = true; setScale(1); } else { removeClass(document.body, 'expose'); overviewActive = false; if (expanded) { setScale(scale); // restore scale } } processContext(); updateOverview(); }; var updateOverview = function() { try { var presentation = document.getElementsByClassName('presentation')[0]; } catch (e) { return; } if (isPresenterView) { var action = overviewActive ? removeClass : addClass; action(document.body, 'presenter_view'); } var toc = document.getElementById('toc'); if (!toc) { return; } if (!tocOpened || !overviewActive) { presentation.style.marginLeft = '0px'; presentation.style.width = '100%'; } else { presentation.style.marginLeft = toc.clientWidth + 'px'; presentation.style.width = (presentation.clientWidth - toc.clientWidth) + 'px'; } }; var computeScale = function() { var cSlide = document.getElementsByClassName('current')[0]; var sx = cSlide.clientWidth / window.innerWidth; var sy = cSlide.clientHeight / window.innerHeight; return 1 / Math.max(sx, sy); }; var setScale = function(scale) { var presentation = document.getElementsByClassName('slides')[0]; var transform = 'scale(' + scale + ')'; presentation.style.MozTransform = transform; presentation.style.WebkitTransform = transform; presentation.style.OTransform = transform; presentation.style.msTransform = transform; presentation.style.transform = transform; }; var expandSlides = function() { if (overviewActive) { return; } if (expanded) { setScale(1); expanded = false; } else { scale = computeScale(); setScale(scale); expanded = true; } }; var showContext = function() { try { var presentation = document.getElementsByClassName('slides')[0]; removeClass(presentation, 'nocontext'); } catch (e) {} }; var hideContext = function() { try { var presentation = document.getElementsByClassName('slides')[0]; addClass(presentation, 'nocontext'); } catch (e) {} }; var processContext = function() { if (hiddenContext) { hideContext(); } else { showContext(); } }; var toggleContext = function() { hiddenContext = !hiddenContext; processContext(); }; var toggleBlank = function() { blank_elem = document.getElementById('blank'); blank_elem.style.display = blanked ? 'none' : 'block'; blanked = !blanked; }; var isModifierKey = function(keyCode) { switch (keyCode) { case 16: // shift case 17: // ctrl case 18: // alt case 91: // command return true; break; default: return false; break; } }; var checkModifierKeyUp = function(event) { if (isModifierKey(event.keyCode)) { modifierKeyDown = false; } }; var checkModifierKeyDown = function(event) { if (isModifierKey(event.keyCode)) { modifierKeyDown = true; } }; var handleBodyKeyDown = function(event) { switch (event.keyCode) { case 13: // Enter if (overviewActive) { toggleOverview(); } break; case 27: // ESC toggleOverview(); break; case 37: // left arrow case 33: // page up prevSlide(); break; case 39: // right arrow case 32: // space case 34: // page down nextSlide(); break; case 50: // 2 if (!modifierKeyDown) { showNotes(); } break; case 51: // 3 if (!modifierKeyDown && !overviewActive) { switch3D(); } break; case 190: // . case 48: // 0 case 66: // b if (!modifierKeyDown && !overviewActive) { toggleBlank(); } break; case 67: // c if (!modifierKeyDown && !overviewActive) { toggleContext(); } break; case 69: // e if (!modifierKeyDown && !overviewActive) { expandSlides(); } break; case 72: // h showHelp(); break; case 78: // n if (!modifierKeyDown && !overviewActive) { showSlideNumbers(); } break; case 80: // p if (!modifierKeyDown && !overviewActive) { showPresenterView(); } break; case 83: // s if (!modifierKeyDown && !overviewActive) { showSlideSources(); } break; case 84: // t showToc(); break; } }; var handleWheel = function(event) { if (tocOpened || helpOpened || overviewActive) { return; } var delta = 0; if (!event) { event = window.event; } if (event.wheelDelta) { delta = event.wheelDelta/120; if (window.opera) delta = -delta; } else if (event.detail) { delta = -event.detail/3; } if (delta && delta <0) { nextSlide(); } else if (delta) { prevSlide(); } }; var addSlideClickListeners = function() { for (var i=0; i < slides.length; i++) { var slide = slides.item(i); slide.num = i + 1; slide.addEventListener('click', function(e) { if (overviewActive) { currentSlideNo = this.num; toggleOverview(); updateSlideClasses(true); e.preventDefault(); } return false; }, true); } }; var addRemoteWindowControls = function() { window.addEventListener("message", function(e) { if (e.data.indexOf("slide#") != -1) { currentSlideNo = Number(e.data.replace('slide#', '')); updateSlideClasses(false); } }, false); }; var addTouchListeners = function() { document.addEventListener('touchstart', function(e) { touchStartX = e.touches[0].pageX; }, false); document.addEventListener('touchend', function(e) { var pixelsMoved = touchStartX - e.changedTouches[0].pageX; var SWIPE_SIZE = 150; if (pixelsMoved > SWIPE_SIZE) { nextSlide(); } else if (pixelsMoved < -SWIPE_SIZE) { prevSlide(); } }, false); }; var addTocLinksListeners = function() { var toc = document.getElementById('toc'); if (toc) { var tocLinks = toc.getElementsByTagName('a'); for (var i=0; i < tocLinks.length; i++) { tocLinks.item(i).addEventListener('click', function(e) { currentSlideNo = Number(this.attributes['href'].value.replace('#slide', '')); updateSlideClasses(true); e.preventDefault(); }, true); } } }; // initialize (function() { if (window.location.hash == "") { currentSlideNo = 1; } else if (window.location.hash.indexOf("#presenter") != -1) { currentSlideNo = Number(window.location.hash.replace('#presenter', '')); isPresenterView = true; showingPresenterView = true; presenterViewWin = window; addClass(document.body, 'presenter_view'); } else { currentSlideNo = Number(window.location.hash.replace('#slide', '')); } document.addEventListener('keyup', checkModifierKeyUp, false); document.addEventListener('keydown', handleBodyKeyDown, false); document.addEventListener('keydown', checkModifierKeyDown, false); document.addEventListener('DOMMouseScroll', handleWheel, false); window.onmousewheel = document.onmousewheel = handleWheel; window.onresize = expandSlides; for (var i = 0, el; el = slides[i]; i++) { addClass(el, 'slide far-future'); } updateSlideClasses(false); // add support for finger events (filter it by property detection?) addTouchListeners(); addTocLinksListeners(); addSlideClickListeners(); addRemoteWindowControls(); })(); } landslide-1.0.1/src/landslide/themes/light/000077500000000000000000000000001166230554600206025ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/light/css/000077500000000000000000000000001166230554600213725ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/light/css/screen.css000066400000000000000000000274461166230554600234000ustar00rootroot00000000000000body { font: 14px "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; background: #fff; padding: 0; margin: 0; overflow: hidden; } div.presentation { position: absolute; width: 100%; display: table-cell; vertical-align: middle; height: 100%; background: inherit; } div.slides, body.expose div.slides.nocontext { width: 100%; height: 100%; left: 0; top: 0; position: absolute; display: block; background-color: #fff; } div.slides.nocontext { width: 900px; margin: 0 auto; overflow: hidden; position: relative; left: auto; top: auto; } div.slide { display: none; position: absolute; overflow: hidden; width: 900px; height: 700px; left: 50%; top: 50%; margin-top: -350px; background: -webkit-gradient(linear, left bottom, left top, from(#fff), to(#eeeeec)); background-color: #eee; background: -moz-linear-gradient(bottom, #fff, #eeeeec); -webkit-transition: margin 0.25s ease-in-out; -moz-transition: margin 0.25s ease-in-out; -o-transition: margin 0.25s ease-in-out; border-top-right-radius: 20px; -moz-border-radius-topright: 20px; -webkit-border-top-right-radius: 20px; border-bottom-left-radius: 0px; -moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; border-top-left-radius: 20px; -moz-border-radius-topleft: 20px; -webkit-border-top-left-radius: 20px; border-bottom-right-radius: 0px; -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; } div.slide p { font-size: 20px; } .slide.far-past { display: block; margin-left: -2400px; } .slide.past { display: block; margin-left: -1400px; } .slide.current { display: block; margin-left: -450px; } .slide.future { display: block; margin-left: 500px; } .slide.far-future { display: block; margin-left: 1500px; } body.three-d div.slides { -webkit-transform: translateX(50px) scale(0.8) rotateY(10deg); -moz-transform: translateX(50px) scale(0.8) rotateY(10deg); -o-transform: translateX(50px) scale(0.8) rotateY(10deg); } /* Content */ header:not(:only-child) { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; font-weight: normal; font-size: 50px; letter-spacing: -.05em; color: white; color: black; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; position: absolute; left: 30px; top: 25px; margin: 0; padding: 0; } header h1, header h2, header h3, header h4, header h5, header h6 { display: inline; font-size: 100%; font-weight: normal; padding: 0; margin: 0; } header h2:first-child { margin-top: 0; } section, .slide header:only-child h1 { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: #3f3f3f; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; margin-left: 30px; margin-right: 30px; margin-top: 100px; display: block; overflow: hidden; } section img.align-center { display: block; margin-left: auto; margin-right: auto; } section img.align-right { display: block; margin-left: auto; margin-right: 0; } section img.align-left { display: block; margin-right: auto; margin-left: 0; } a { color: inherit; display: inline-block; text-decoration: none; line-height: 110%; border-bottom: 2px solid #3f3f3f; } pre { font-size: 16px; font-family: Monaco, Courier, monospace; } li { padding: 10px 0; font-size: 20px; } .slide header:only-child h1 { line-height: 180%; text-align: center; display: table-cell; vertical-align: middle; height: 700px; width: 900px; font-size: 50px; margin-top:100px; margin-bottom:100px; } .sidebar { background: -webkit-gradient(linear, top right, bottom right, from(#dde), to(#fff)); -webkit-transition: margin 0.25s ease-in-out; background-color: #eee; background: -moz-linear-gradient(right, #dde, #fff); border-right: 5px solid #ccd; z-index: 9999999; height: 100%; overflow: hidden; top: 0; position: absolute; display: block; margin: 0; margin-left: -400px; padding: 10px 16px; overflow: auto; -webkit-transition: margin 0.2s ease-in-out; -moz-transition: margin 0.2s ease-in-out; -o-transition: margin 0.2s ease-in-out; } .sidebar h2 { text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; margin: 0 0 16px; padding: 0; } .sidebar table { width: 100%; margin: 0; padding: 0; border-collapse: collapse; } .sidebar table caption { display: none; } .sidebar tr { margin: 2px 0; border-bottom: 1px solid #ccc; } .sidebar th { text-align: left; font-weight: normal; max-width: 300px; overflow: hidden; } .sidebar tr.sub th { text-indent: 20px; } .sidebar td { text-align: right; min-width: 20px; } .sidebar a { display: block; text-decoration: none; border-bottom: none; padding: 4px 0; } .sidebar tr.active { background: #ff0; } aside { display: none; } aside.source { position: absolute; bottom: 6px; left: 10px; text-indent: 10px; } aside.page_number { position: absolute; bottom: 6px; right: 10px; text-indent: 10px; } .notes { display: none; padding: 10px; background: #ccc; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; } div.slide p.notes { font-size: 90%; } img { display: block; margin: auto; } /* Expose */ body.expose div.slides { float: left; position: relative; overflow: auto; margin-bottom: 10px; } body.expose div.slide { display: block; float: left; position: relative; left: auto !important; top: auto !important; margin: 10px !important; -webkit-transition: none; -moz-transition: none; -o-transition: none; -moz-transform: scale(.33, .33); -moz-transform-origin: 0 0; -webkit-transform: scale(.33, .33); -webkit-transform-origin: 0 0; -o-transform: scale(.33, .33); -o-transform-origin: 0 0; -webkit-transition: none; -moz-transition: none; -o-transition: none; cursor: pointer; } body.expose div.slide:hover { background: -webkit-gradient(linear, left bottom, left top, from(#bdd), to(#fff)); background-color: #eee; background: -moz-linear-gradient(bottom, #bdd, #fff); } body.expose .slide-wrapper { float: left; position: relative; margin: .5%; width: 300px; height: 233px; } body.expose .slide footer { } body.expose .slide .inner { } body.expose .slide.far-past, body.expose .slide.past, body.expose .slide.future, body.expose .slide.far-future { margin-left: 0; } body.expose .slide.current { background: -webkit-gradient(linear, left bottom, left top, from(#ddb), to(#fff)); background-color: #eee; background: -moz-linear-gradient(bottom, #ddb, #fff); border: 16px solid #fff; -moz-transform: scale(.315, .315); -moz-transform-origin: 0 0; -webkit-transform: scale(.315, .315); -webkit-transform-origin: 0 0; -o-transform: scale(.315, .315); -o-transform-origin: 0 0; } /* Pygments default theme */ .hll { background-color: #ffffcc } .c { color: #408080; font-style: italic } /* Comment */ .err { border: 1px solid #FF0000 } /* Error */ .k { color: #008000; font-weight: bold } /* Keyword */ .o { color: #666666 } /* Operator */ .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .cp { color: #BC7A00 } /* Comment.Preproc */ .c1 { color: #408080; font-style: italic } /* Comment.Single */ .cs { color: #408080; font-style: italic } /* Comment.Special */ .gd { color: #A00000 } /* Generic.Deleted */ .ge { font-style: italic } /* Generic.Emph */ .gr { color: #FF0000 } /* Generic.Error */ .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .gi { color: #00A000 } /* Generic.Inserted */ .go { color: #808080 } /* Generic.Output */ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .gs { font-weight: bold } /* Generic.Strong */ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .gt { color: #0040D0 } /* Generic.Traceback */ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .kp { color: #008000 } /* Keyword.Pseudo */ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .kt { color: #B00040 } /* Keyword.Type */ .m { color: #666666 } /* Literal.Number */ .s { color: #BA2121 } /* Literal.String */ .na { color: #7D9029 } /* Name.Attribute */ .nb { color: #008000 } /* Name.Builtin */ .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .no { color: #880000 } /* Name.Constant */ .nd { color: #AA22FF } /* Name.Decorator */ .ni { color: #999999; font-weight: bold } /* Name.Entity */ .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ .nf { color: #0000FF } /* Name.Function */ .nl { color: #A0A000 } /* Name.Label */ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .nt { color: #008000; font-weight: bold } /* Name.Tag */ .nv { color: #19177C } /* Name.Variable */ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .w { color: #bbbbbb } /* Text.Whitespace */ .mf { color: #666666 } /* Literal.Number.Float */ .mh { color: #666666 } /* Literal.Number.Hex */ .mi { color: #666666 } /* Literal.Number.Integer */ .mo { color: #666666 } /* Literal.Number.Oct */ .sb { color: #BA2121 } /* Literal.String.Backtick */ .sc { color: #BA2121 } /* Literal.String.Char */ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .s2 { color: #BA2121 } /* Literal.String.Double */ .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ .sh { color: #BA2121 } /* Literal.String.Heredoc */ .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ .sx { color: #008000 } /* Literal.String.Other */ .sr { color: #BB6688 } /* Literal.String.Regex */ .s1 { color: #BA2121 } /* Literal.String.Single */ .ss { color: #19177C } /* Literal.String.Symbol */ .bp { color: #008000 } /* Name.Builtin.Pseudo */ .vc { color: #19177C } /* Name.Variable.Class */ .vg { color: #19177C } /* Name.Variable.Global */ .vi { color: #19177C } /* Name.Variable.Instance */ .il { color: #666666 } /* Literal.Number.Integer.Long */ /* Presenter Mode */ body.presenter_view div.slide { display: inline; position: absolute; overflow: hidden; -moz-transform: scale(.5, .5); -moz-transform-origin: 0 0; -webkit-transform: scale(.5, .5); -webkit-transform-origin: 0 0; -o-transform: scale(.5, .5); -o-transform-origin: 0 0; margin-top: -300px; } body.presenter_view .slide.far-past { display: block; margin-left: -1500px; } body.presenter_view .slide.past { display: block; margin-left: -975px; } body.presenter_view .slide.current { display: block; margin-left: -475px; border: 8px solid maroon; z-index: 2; } body.presenter_view .slide.future { display: block; margin-left: 25px; z-index: 1; } body.presenter_view .slide.far-future { display: block; margin-left: 525px; } body.presenter_view div#current_presenter_notes { visibility: visible; display: block; position: absolute; overflow: auto; vertical-align: middle; left: 50%; top: 50%; margin-left: -475px; margin-top: 100px; z-index: 2; width: 950px; border-style: solid; height: 30%; background-color: silver; } body.presenter_view div#current_presenter_notes section { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: black; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; display: block; overflow: visible; position: relative; background-color: #fffeff; height: 120px; margin-right: 30px; margin-top: 60px; margin-left: 30px; padding-right: 10px; padding-left: 10px; padding-top: 10px; } body.presenter_view div#current_presenter_notes section p { margin: 0; } body.presenter_view div#current_presenter_notes h1 { font-size: 50%; display: block; } div#current_presenter_notes { display: none; } div.slide div.presenter_notes { display: none; } #blank { position: absolute; top: 0; left: 0; background-color: black; width: 100%; height: 100%; z-index: 64; display: none; } landslide-1.0.1/src/landslide/themes/tango/000077500000000000000000000000001166230554600206035ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/tango/css/000077500000000000000000000000001166230554600213735ustar00rootroot00000000000000landslide-1.0.1/src/landslide/themes/tango/css/background.png000066400000000000000000000003651166230554600242240ustar00rootroot00000000000000PNG  IHDR.RsRGBbKGD pHYs  ftIME 7ًuIDATx֡ PERA(]IZ$+X 9#\u [B!TUP7k^й}D$BDH[I].G QLtIENDB`landslide-1.0.1/src/landslide/themes/tango/css/screen.css000066400000000000000000000302371166230554600233710ustar00rootroot00000000000000h1, h2, h3, h4, h5, h6, p, ul, li { font-family: sans-serif !important; } p, ul, li { color: #555753 !important; font-size: 120% !important; } header h1, header h2, header h3, header h4, header h5, header h6 { color: #204a87 !important; font-weight: bold !important; } section h1, section h2, section h3, section h4, section h5, section h6 { color: #3465a4 !important; } img { display: block; margin: auto; } body { font: 14px "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; background: #555753; padding: 0; margin: 0; overflow: hidden; } div.presentation { position: absolute; width: 100%; display: table-cell; vertical-align: middle; height: 100%; background: -webkit-gradient(linear, left bottom, left top, from(#2e3436), to(#555753)); background-color: #555753; background: -moz-linear-gradient(bottom, #555753, #2e3436); } div.slides, body.expose div.slides.nocontext { width: 100%; height: 100%; left: 0; top: 0; position: absolute; display: block; } div.slides.nocontext { width: 900px; margin: 0 auto; overflow: hidden; position: relative; left: auto; top: auto; } div.slide { background: url('background.png') bottom center no-repeat; display: none; position: absolute; overflow: hidden; width: 900px; height: 700px; left: 50%; top: 50%; margin-top: -350px; background-color: #fff; -webkit-transition: margin 0.25s ease-in-out; -moz-transition: margin 0.25s ease-in-out; -o-transition: margin 0.25s ease-in-out; border-top-left-radius: 20px; -moz-border-radius-topleft: 20px; -webkit-border-top-left-radius: 20px; border-top-right-radius: 20px; -moz-border-radius-topright: 20px; -webkit-border-top-right-radius: 20px; border-bottom-right-radius: 20px; -moz-border-radius-bottomright: 20px; -webkit-border-bottom-right-radius: 20px; border-bottom-left-radius: 20px; -moz-border-radius-bottomleft: 20px; -webkit-border-bottom-left-radius: 20px; } div.slide p { font-size: 20px; } .slide.far-past { display: block; margin-left: -2400px; } .slide.past { display: block; margin-left: -1400px; } .slide.current { display: block; margin-left: -450px; } .slide.future { display: block; margin-left: 500px; } .slide.far-future { display: block; margin-left: 1500px; } body.three-d div.slides { -webkit-transform: translateX(50px) scale(0.8) rotateY(10deg); -moz-transform: translateX(50px) scale(0.8) rotateY(10deg); -o-transform: translateX(50px) scale(0.8) rotateY(10deg); } /* Content */ header:not(:only-child) { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; font-weight: normal; font-size: 50px; letter-spacing: -.05em; color: white; color: black; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; position: absolute; left: 30px; top: 25px; margin: 0; padding: 0; } header h1, header h2, header h3, header h4, header h5, header h6 { display: inline; font-size: 100%; font-weight: normal; padding: 0; margin: 0; } header h2:first-child { margin-top: 0; } section, .slide header:only-child h1 { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: #3f3f3f; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; margin-left: 30px; margin-right: 30px; margin-top: 100px; display: block; overflow: hidden; } section img.align-center { display: block; margin-left: auto; margin-right: auto; } section img.align-right { display: block; margin-left: auto; margin-right: 0; } section img.align-left { display: block; margin-right: auto; margin-left: 0; } a { color: inherit; display: inline-block; text-decoration: none; line-height: 110%; border-bottom: 2px solid #3f3f3f; } pre { font-size: 16px; font-family: Monaco, Courier, monospace; } li { padding: 10px 0; font-size: 20px; } .slide header:only-child h1 { line-height: 180%; text-align: center; display: table-cell; vertical-align: middle; height: 700px; width: 900px; font-size: 50px; margin-top:100px; margin-bottom:100px; } .sidebar { background: -webkit-gradient(linear, top right, bottom right, from(#dde), to(#fff)); -webkit-transition: margin 0.25s ease-in-out; background-color: #eee; background: -moz-linear-gradient(right, #dde, #fff); border-right: 5px solid #ccd; z-index: 9999999; height: 100%; overflow: hidden; top: 0; position: absolute; display: block; margin: 0; margin-left: -400px; padding: 10px 16px; overflow: auto; -webkit-transition: margin 0.2s ease-in-out; -moz-transition: margin 0.2s ease-in-out; -o-transition: margin 0.2s ease-in-out; } .sidebar h2 { text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; margin: 0 0 16px; padding: 0; } .sidebar table { width: 100%; margin: 0; padding: 0; border-collapse: collapse; } .sidebar table caption { display: none; } .sidebar tr { margin: 2px 0; border-bottom: 1px solid #ccc; } .sidebar th { text-align: left; font-weight: normal; max-width: 300px; overflow: hidden; } .sidebar tr.sub th { text-indent: 20px; } .sidebar td { text-align: right; min-width: 20px; } .sidebar a { display: block; text-decoration: none; border-bottom: none; padding: 4px 0; } .sidebar tr.active { background: #ff0; } aside { display: none; } aside.source { position: absolute; bottom: 6px; left: 10px; text-indent: 10px; } aside.page_number { position: absolute; bottom: 6px; right: 10px; text-indent: 10px; } .notes { display: none; padding: 10px; background: #ccc; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; } div.slide p.notes { font-size: 90%; } /* Expose */ body.expose div.slides { float: left; position: relative; overflow: auto; margin-bottom: 10px; } body.expose div.slide { display: block; float: left; position: relative; left: auto !important; top: auto !important; margin: 10px !important; -webkit-transition: none; -moz-transition: none; -o-transition: none; -moz-transform: scale(.33, .33); -moz-transform-origin: 0 0; -webkit-transform: scale(.33, .33); -webkit-transform-origin: 0 0; -o-transform: scale(.33, .33); -o-transform-origin: 0 0; cursor: pointer; } body.expose div.slide:hover { background: -webkit-gradient(linear, left bottom, left top, from(#bdd), to(#fff)); background-color: #eee; background: -moz-linear-gradient(bottom, #bdd, #fff); } body.expose .slide-wrapper { float: left; position: relative; margin: .5%; width: 300px; height: 233px; } body.expose .slide footer { } body.expose .slide .inner { } body.expose .slide.far-past, body.expose .slide.past, body.expose .slide.future, body.expose .slide.far-future { margin-left: 0; } body.expose .slide.current { background: -webkit-gradient(linear, left bottom, left top, from(#ddb), to(#fff)); background-color: #eee; background: -moz-linear-gradient(bottom, #ddb, #fff); border: 16px solid #fff; -moz-transform: scale(.315, .315); -moz-transform-origin: 0 0; -webkit-transform: scale(.315, .315); -webkit-transform-origin: 0 0; -o-transform: scale(.315, .315); -o-transform-origin: 0 0; } /* Pygments default theme */ .hll { background-color: #ffffcc } .c { color: #408080; font-style: italic } /* Comment */ .err { border: 1px solid #FF0000 } /* Error */ .k { color: #008000; font-weight: bold } /* Keyword */ .o { color: #666666 } /* Operator */ .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .cp { color: #BC7A00 } /* Comment.Preproc */ .c1 { color: #408080; font-style: italic } /* Comment.Single */ .cs { color: #408080; font-style: italic } /* Comment.Special */ .gd { color: #A00000 } /* Generic.Deleted */ .ge { font-style: italic } /* Generic.Emph */ .gr { color: #FF0000 } /* Generic.Error */ .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .gi { color: #00A000 } /* Generic.Inserted */ .go { color: #808080 } /* Generic.Output */ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .gs { font-weight: bold } /* Generic.Strong */ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .gt { color: #0040D0 } /* Generic.Traceback */ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .kp { color: #008000 } /* Keyword.Pseudo */ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .kt { color: #B00040 } /* Keyword.Type */ .m { color: #666666 } /* Literal.Number */ .s { color: #BA2121 } /* Literal.String */ .na { color: #7D9029 } /* Name.Attribute */ .nb { color: #008000 } /* Name.Builtin */ .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .no { color: #880000 } /* Name.Constant */ .nd { color: #AA22FF } /* Name.Decorator */ .ni { color: #999999; font-weight: bold } /* Name.Entity */ .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ .nf { color: #0000FF } /* Name.Function */ .nl { color: #A0A000 } /* Name.Label */ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .nt { color: #008000; font-weight: bold } /* Name.Tag */ .nv { color: #19177C } /* Name.Variable */ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .w { color: #bbbbbb } /* Text.Whitespace */ .mf { color: #666666 } /* Literal.Number.Float */ .mh { color: #666666 } /* Literal.Number.Hex */ .mi { color: #666666 } /* Literal.Number.Integer */ .mo { color: #666666 } /* Literal.Number.Oct */ .sb { color: #BA2121 } /* Literal.String.Backtick */ .sc { color: #BA2121 } /* Literal.String.Char */ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .s2 { color: #BA2121 } /* Literal.String.Double */ .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ .sh { color: #BA2121 } /* Literal.String.Heredoc */ .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ .sx { color: #008000 } /* Literal.String.Other */ .sr { color: #BB6688 } /* Literal.String.Regex */ .s1 { color: #BA2121 } /* Literal.String.Single */ .ss { color: #19177C } /* Literal.String.Symbol */ .bp { color: #008000 } /* Name.Builtin.Pseudo */ .vc { color: #19177C } /* Name.Variable.Class */ .vg { color: #19177C } /* Name.Variable.Global */ .vi { color: #19177C } /* Name.Variable.Instance */ .il { color: #666666 } /* Literal.Number.Integer.Long */ /* Presenter Mode */ body.presenter_view div.slide { display: inline; position: absolute; overflow: hidden; -moz-transform: scale(.5, .5); -moz-transform-origin: 0 0; -webkit-transform: scale(.5, .5); -webkit-transform-origin: 0 0; -o-transform: scale(.5, .5); -o-transform-origin: 0 0; margin-top: -300px; } body.presenter_view .slide.far-past { display: block; margin-left: -1500px; } body.presenter_view .slide.past { display: block; margin-left: -975px; } body.presenter_view .slide.current { display: block; margin-left: -475px; border: 8px solid maroon; z-index: 2; } body.presenter_view .slide.future { display: block; margin-left: 25px; z-index: 1; } body.presenter_view .slide.far-future { display: block; margin-left: 525px; } body.presenter_view div#current_presenter_notes { visibility: visible; display: block; position: absolute; overflow: auto; vertical-align: middle; left: 50%; top: 50%; margin-left: -475px; margin-top: 100px; z-index: 2; width: 950px; border-style: solid; height: 30%; background-color: silver; } body.presenter_view div#current_presenter_notes section { font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: black; text-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px; display: block; overflow: visible; position: relative; background-color: #fffeff; height: 120px; margin-right: 30px; margin-top: 60px; margin-left: 30px; padding-right: 10px; padding-left: 10px; padding-top: 10px; } body.presenter_view div#current_presenter_notes section p { margin: 0; } body.presenter_view div#current_presenter_notes h1 { font-size: 50%; display: block; } div#current_presenter_notes { display: none; } div.slide div.presenter_notes { display: none; } #blank { position: absolute; top: 0; left: 0; background-color: black; width: 100%; height: 100%; z-index: 64; display: none; } landslide-1.0.1/src/landslide/utils.py000066400000000000000000000043611166230554600177240ustar00rootroot00000000000000# -*- coding: utf-8 -*- # Copyright 2010 Adam Zapletal # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import base64 import mimetypes def get_abs_path_url(path): """ Returns the absolute url for a given local path. """ return "file://%s" % os.path.abspath(path) def get_path_url(abs_path, relative=False): """ Returns an absolute or relative path url from an absolute path. """ if relative: return get_rel_path_url(abs_path) else: return get_abs_path_url(abs_path) def get_rel_path_url(path, base_path=os.getcwd()): """ Returns a relative path from the absolute one passed as argument. Silently returns originally provided path on failure. """ try: path_url = path.split(base_path)[1] if path_url.startswith('/'): return path_url[1:] else: return path_url except (IndexError, TypeError): return path def encode_image_from_url(url, source_path): if not url or url.startswith('data:') or url.startswith('file://'): return False if (url.startswith('http://') or url.startswith('https://')): return False real_path = url if os.path.isabs(url) else os.path.join(source_path, url) if not os.path.exists(real_path): print '%s was not found, skipping' % url return False mime_type, encoding = mimetypes.guess_type(real_path) if not mime_type: print 'Unrecognized mime type for %s, skipping' % url return False try: image_contents = open(real_path).read() encoded_image = base64.b64encode(image_contents) except IOError: return False except Exception: return False return u"data:%s;base64,%s" % (mime_type, encoded_image)