Giter Club home page Giter Club logo

slider-py's Introduction

Slider-Py

Coverage Status

  1. Parse a simplified MarkDown that is used to create my slides. (TODO make the format a subset of Markua)
  2. Generate HTML files from the slides
  3. Generate PDF from the slides
  4. Generate mobi file from the slides

See the slide sources and the generated slides

Example

Create a directory (e.g. 'example') and in there a file called 'main.md' with the following content.

# Chapter Title
{id: page-url}
{i: subject matter}
{i: another!subject}

## Page Title
{id: page-url}

* Bullet
* Points


1. Numbered
1. Bullet
1. Points


   ```
   Verbatim for code between triple backticks.
   ```

Free Paragraph text.

**bold between a pair of double-stars**

`inline code example between single backticks`

HTML Links: [slides](https://code-maven.com/slides/) that will be used as links anywhere except in verbatim text

![Title](path/to/file.py)    # include external file
![](path/to/file.py)         # include external file use filename as title

![Title](path/to/file.png)    # include image


{aside}
In the asides, we support [links](http://some-page.com), **bold** and

* unordered
* list
{/aside}

Then run

python slider.py --md example/main.md --html --dir html/

The results shoule be in the 'html' directory.

TODO

  • Navigation key-binding in JavaScript (can be in other templating system)

  • make sure the same id does not exists in different pages

  • make sure index is not an id in the multiSlider case

  • make sure keywords is not an id

  • make sure examples is not an id

  • other conflicts?

  • Main page for multi-file case should be index.html

  • Next and Prev chapter link on the chapter pages.

  • To index of this chapter link on each page.

  • Numbering pages?

  • Keywords file extension link

Development suggestions:

Generate html slides in a temporary local directory to look at the result

rm -rf html/*; python slider/__init__.py --md cases/all.md --html --dir html

Update the expected results for a test case:

rm -rf cases/html/all
python slider/__init__.py --md cases/all.md --html --dir cases/html/all/

update all the test cases: ./update_test_cases

Development

virtualenv -p python3 venv
source venv/bin/activate
pip install -r dev-requirements.txt -c constraints.txt
pytest -v
pytest -v --cov=slider/ --cache-clear
flake8

Format

Chapter title and id:

  • Must be exactly one at the top of each .md file. The id will become the last part in the URL.
# Chapter
{id: chapter}

Page title, id, and words to index:

  • The id is required. It will become the last part of the URL.
  • There can be 0 or more {i: } entries. These are the words that are indexed and shown in the keywords table.
## Page title
{id: page-file-name}
{i: print}

slider-py's People

Contributors

szabgab avatar dependabot[bot] avatar

Stargazers

César Guerra avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

leora-betesh

slider-py's Issues

Fail if the same id is used twices

## Page 1
{id: page-1}

## Page 2
{id: page-1}

the above should fail and report that id page-1 was used twice.

Same if one of the ids belong to a chapter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.