{"id":13497956,"url":"https://github.com/adamzap/landslide","last_synced_at":"2025-05-14T14:07:56.555Z","repository":{"id":904913,"uuid":"662115","full_name":"adamzap/landslide","owner":"adamzap","description":"Generate HTML5 slideshows from markdown, ReST, or textile","archived":false,"fork":false,"pushed_at":"2024-01-01T12:06:16.000Z","size":3322,"stargazers_count":2094,"open_issues_count":40,"forks_count":369,"subscribers_count":72,"default_branch":"master","last_synced_at":"2025-05-13T02:51:37.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamzap.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2010-05-12T04:34:16.000Z","updated_at":"2025-05-05T15:03:55.000Z","dependencies_parsed_at":"2024-01-10T00:03:29.045Z","dependency_job_id":"a77e7691-8fc2-402e-907a-c17558722097","html_url":"https://github.com/adamzap/landslide","commit_stats":{"total_commits":438,"total_committers":48,"mean_commits":9.125,"dds":0.5547945205479452,"last_synced_commit":"675dd4dd7123b1fe013c41ebd3ed0321a7ad1833"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamzap%2Flandslide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamzap%2Flandslide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamzap%2Flandslide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamzap%2Flandslide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamzap","download_url":"https://codeload.github.com/adamzap/landslide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159267,"owners_count":22024558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T20:00:45.840Z","updated_at":"2025-05-14T14:07:56.534Z","avatar_url":"https://github.com/adamzap.png","language":"CSS","funding_links":[],"categories":["CSS","Documentation and Presentation","Open Source"],"sub_categories":[],"readme":"# Landslide\n\nLandslide generates a slideshow using from markdown, ReST, or textile. It\nbuilds off of Google's [html5slides][html5slides] template.\n\nThe following markdown produces [this slideshow][sample].\n\n    # Landslide\n\n    ---\n\n    # Overview\n\n    Generate HTML5 slideshows from markdown, ReST, or textile.\n\n    ![python](http://i.imgur.com/bc2xk.png)\n\n    Landslide is primarily written in Python, but it's themes use:\n\n    - HTML5\n    - Javascript\n    - CSS\n\n    ---\n\n    # Code Sample\n\n    Landslide supports code snippets\n\n        !python\n        def log(self, message, level='notice'):\n            if self.logger and not callable(self.logger):\n                raise ValueError(u\"Invalid logger set, must be a callable\")\n\n            if self.verbose and self.logger:\n                self.logger(message, level)\n\n[html5slides]: http://code.google.com/p/html5slides/\n[sample]: https://landslide-python.netlify.app/\n\n## Requirements\n\n`python` and the following modules:\n\n- `jinja2`\n- `pygments` for code blocks syntax coloration\n\n#### Markup Conversion\n\n- `markdown` for [Markdown](http://en.wikipedia.org/wiki/Markdown)\n- `docutils` for [reStructured Text](http://en.wikipedia.org/wiki/ReStructuredText)\n- `textile` for [Textile](http://en.wikipedia.org/wiki/Textile_(markup_language))\n\n#### Optional\n\n- `watchdog` for watching/auto-regeneration with the `-w` flag\n- [Prince](http://www.princexml.com/) for PDF export\n\n## Installation\n\nInstall the latest stable version of Landslide with a python package manager\nlike `pip`:\n\n    $ pip install landslide\n\nIf you want to stay on the edge:\n\n    $ git clone https://github.com/adamzap/landslide.git\n    $ cd landslide\n    $ python setup.py build\n    $ sudo python setup.py install\n\n## Formatting\n\n#### Markdown\n\n- Your Markdown source files must be suffixed by `.md`, `.markdn`, `.mdwn`,\n  `.mdown` or `.markdown`\n- To create a title slide, render a single `h1` element (eg. `# My Title`)\n- Separate your slides with a horizontal rule (`---` in markdown) except at the\n  end of md files\n- Your other slides should have a heading that renders to an `h1` element\n- To highlight blocks of code, put `!lang` where `lang` is the pygment\n  supported language identifier as the first indented line\n\n### ReStructuredText\n\n- Your ReST source files must be suffixed by `.rst` or `.rest` (**`.txt` is not\n  supported**)\n- Use headings for slide titles\n- Separate your slides using an horizontal rule (`----` in RST) except at the\n  end of RST files\n\n### Textile\n\n- Separate your slides using `---`, just like in markdown\n\n## Rendering\n\n- Run `landslide slides.md` or `landslide slides.rst`\n- Enjoy your newly generated `presentation.html`\n\nOr get it as a PDF document if Prince is installed and available on your\nsystem:\n\n    $ landslide README.md -d readme.pdf\n    $ open readme.pdf\n\n## Viewing\n\n- Press `h` to toggle display of help\n- Press `left arrow` and `right arrow` to navigate\n- Press `t` to toggle a table of contents for your presentation. Slide titles\n  are links\n- Press `ESC` to display the presentation overview (Exposé)\n- Press `n` to toggle slide number visibility\n- Press `b` to toggle screen blanking\n- Press `c` to toggle current slide context (previous and next slides)\n- Press `e` to make slides filling the whole available space within the\n  document body\n- Press `S` to toggle display of link to the source file for each slide\n- Press '2' to toggle notes in your slides (specify with the .notes macro)\n- Press '3' to toggle pseudo-3D display (experimental)\n- Browser zooming is supported\n\n## Commandline Options\n\nSeveral options are available using the command line:\n\n    -h, --help            show this help message and exit\n    -c, --copy-theme      Copy theme directory into current presentation source\n                          directory\n    -b, --debug           Will display any exception trace to stdin\n    -d FILE, --destination=FILE\n                          The path to the to the destination file: .html or .pdf\n                          extensions allowed (default: presentation.html)\n    -e ENCODING, --encoding=ENCODING\n                          The encoding of your files (defaults to utf8)\n    -i, --embed           Embed stylesheet and javascript contents,\n                          base64-encoded images in presentation to make a\n                          standalone document\n    -l LINENOS, --linenos=LINENOS\n                          How to output linenos in source code. Three options\n                          availables: no (no line numbers); inline (inside \u003cpre\u003e\n                          tag); table (lines numbers in another cell, copy-paste\n                          friendly)\n    -o, --direct-output    Prints the generated HTML code to stdout; won't work\n                          with PDF export\n    -q, --quiet           Won't write anything to stdout (silent mode)\n    -r, --relative        Make your presentation asset links relative to current\n                          pwd; This may be useful if you intend to publish your\n                          html presentation online.\n    -t THEME, --theme=THEME\n                          A theme name, or path to a landlside theme directory\n    -v, --verbose         Write informational messages to stdin (enabled by\n                          default)\n    -w, --watch           Watch the source directory for changes and\n                          auto-regenerate the presentation\n    -x EXTENSIONS, --extensions=EXTENSIONS\n                          Comma-separated list of extensions for Markdown\n    -m, --math-output     Enable mathematical output using mathjax\n\n## Presentation Configuration\n\nLandslide allows to configure your presentation using a `cfg` configuration\nfile, therefore easing the aggregation of source directories and the reuse of\nthem across presentations. Landslide configuration files use the `cfg` syntax.\nIf you know `ini` files, you get the picture. Below is a sample configuration\nfile:\n\n    [landslide]\n    theme  = /path/to/my/beautiful/theme\n    source = 0_my_first_slides.md\n             a_directory\n             another_directory\n             now_a_slide.markdown\n             another_one.rst\n    destination = myWonderfulPresentation.html\n    css =    my_first_stylesheet.css\n             my_other_stylesheet.css\n    js =     jquery.js\n             my_fancy_javascript.js\n    relative = True\n    linenos = inline\n\nDon't forget to declare the `[landslide]` section.  All configuration files\nmust end in the .cfg extension.\n\nTo generate the presentation as configured, just run:\n\n    $ cd /path/to/my/presentation/sources\n    $ landslide config.cfg\n\n## Macros\n\nYou can use macros to enhance your presentation:\n\n#### Notes\n\nAdd notes to your slides using the `.notes:` keyword, eg.:\n\n    # My Slide Title\n\n    .notes: These are my notes, hidden by default\n\n    My visible content goes here\n\nYou can toggle display of notes by pressing the `2` key.\n\nSome other macros are also available by default: `.fx: foo bar` will add the\n`foo` and `bar` classes to the corresponding slide `\u003cdiv\u003e` element, easing\nstyling of your presentation using CSS.\n\n#### QR Codes\n\nAdd a QR Code to your presentation by using the `.qr` keyword:\n\n    .qr: 450|http://github.com/adamzap/landslide\n\n## Presenter Notes\n\nYou can also add presenter notes to each slide by following the slide content\nwith a heading entitled \"Presenter Notes\". Press the 'p' key to open the\npresenter view.\n\n## Registering Macros\n\nMacros are used to transform the HTML contents of your slide.\n\nYou can register your own macros by creating `landslide.macro.Macro` derived\nclasses, implementing a `process(content, source=None)` method and returning\na tuple containing the modified contents and some css classes you may be\nwanting to add to your slide `\u003cdiv\u003e` element. For example:\n\n    !python\n    import landslide\n\n    class MyMacro(landslide.Macro):\n      def process(self, content, source=None):\n        return content + '\u003cp\u003eplop\u003c/p\u003e', ['plopped_slide']\n\n    g = landslide.generator.Generator(source='toto.md')\n    g.register_macro(MyMacro)\n    print g.render()\n\nThis will render any slide as below:\n\n    !html\n    \u003cdiv class=\"slide plopped_slide\"\u003e\n      \u003cheader\u003e\u003ch2\u003efoo\u003c/h2\u003e\u003c/header\u003e\n      \u003csection\u003e\n        \u003cp\u003emy slide contents\u003c/p\u003e\n        \u003cp\u003eplop\u003c/p\u003e\n      \u003c/section\u003e\n    \u003c/div\u003e\n\n## Advanced Usage\n\n#### Setting Custom Destination File\n\n    $ landslide slides.md -d ~/MyPresentations/presentation.html\n\n#### Working with Directories\n\n    $ landslide slides/\n\n#### Working with Direct Output\n\n    $ landslide slides.md -o | tidy\n\n#### Using an Alternate Landslide Theme\n\n    $ landslide slides.md -t mytheme\n    $ landslide slides.md -t /path/to/theme/dir\n\n#### Embedding Base-64-Encoded Images\n\n    $ landslide slides.md -i\n\n#### Exporting to PDF\n\n    $ landslide slides.md -d presentation.pdf\n\n#### Enabling mathematical notation\n\n    Note that this require writing the slides in ReST format as well as\n    using Docutils 0.8 or newer.\n\n    $ landslide slides.rst -m\n\n#### Enabling Markdown Extensions\n\nSee documentation on available Markdown extensions\n[here](https://python-markdown.github.io/extensions/):\n\n    $ landslide slides.md -x abbr\n\n## Theming\n\nA Landslide theme is a directory following this simple structure:\n\n    mytheme/\n    |-- base.html\n    |-- css\n    |   |-- print.css\n    |   `-- screen.css\n    `-- js\n        `-- slides.js\n\nIf a theme does not provide HTML and JS files, those from the default theme\nwill be used. CSS is not optional.\n\nLast, you can also copy the whole theme directory to your presentation one by\npassing the `--copy-theme` option to the `landslide` command:\n\n    $ landslide slides.md -t /path/to/some/theme --copy-theme\n\n## User stylesheets and Javascripts\n\nIf you don't want to bother making your own theme, you can include your own\nuser css and js files to the generated presentation.\n\nThis feature is only available if you use a landslide configuration file, by\nsetting the `css` and/or `js` flags:\n\n    [landslide]\n    theme  = /path/to/my/beautiful/theme\n    source = slides.mdown\n    css =    custom.css\n    js =     jquery.js\n             powerpoint.js\n\nThese will link the ``custom.css`` stylesheet and both the ``jquery.js`` and\n``powerpoint.js`` files within the ``\u003chead\u003e`` section of the presentation html\nfile.\n\n**NOTE:** Paths to the css and js files must be relative to the directory\nyou're running the ``landslide`` command from.\n\n## Publishing your Presentation Online\n\nIf you intend to publish your HTML presentation online, you'll have to use the\n`--relative` option, as well as the `--copy-theme` one to have all asset links\nrelative to the root of your presentation;\n\n    $ landslide slides.md --relative --copy-theme\n\nThat way, you'll just have to host the whole presentation directory to\na webserver. Of course, no Python nor PHP nor anything else than a HTTP\nwebserver (like Nginx) is required to host a landslide presentation.\n\n## Theme Variables\n\nThe `base.html` must be a [Jinja2 template file][jinja-docs] where you can\nharness the following template variables:\n\n- `css`: the stylesheet contents, available via two keys, `print` and `screen`,\n  both having:\n  - a `path_url` key storing the url to the asset file path\n  - a `contents` key storing the asset contents\n- `js`: the javascript contents, having:\n  - a `path_url` key storing the url to the asset file path\n  - a `contents` key storing the asset contents\n- `slides`: the slides list, each one having these properties:\n  - `header`: the slide title\n  - `content`: the slide contents\n  - `number`: the slide number\n- `embed`: is the current document a standalone one?\n- `num_slides`: the number of slides in current presentation\n- `toc`: the Table of Contents, listing sections of the document. Each section\n  has these properties available:\n  - `title`: the section title\n  - `number`: the slide number of the section\n  - `sub`: subsections, if any\n\n[jinja-docs]: http://jinja.pocoo.org/2/documentation/templates\n\n## Styles Scope\n\n- To change HTML5 presentation styles, tweak the `css/screen.css` stylesheet\n  bundled with the theme you are using\n- For PDF, modify the `css/print.css`\n\n## Authors\n\n#### Original Author and Development Lead\n\n- Adam Zapletal (adamzap@gmail.com)\n\n#### Co-Author\n\n- Nicolas Perriault (nperriault@gmail.com)\n\n#### Contributors\n\nSee https://github.com/adamzap/landslide/contributors\n\n#### Base Template Authors and Contributors (html5-slides)\n\n- Marcin Wichary (mwichary@google.com)\n- Ernest Delgado (ernestd@google.com)\n- Alex Russell (slightlyoff@chromium.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamzap%2Flandslide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamzap%2Flandslide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamzap%2Flandslide/lists"}