Giter VIP home page Giter VIP logo

django-slideshow's Introduction

A Perfectly Simple Django Slideshow App

GitHub repo size GitHub issues GitHub Twitter URL

Table of Contents

๐Ÿ”† About

This is an app that does something. That "something" is a way to organize revealjs slideshows and attach them to events where they are presented.

NOTE: Documentation is work in progress.

๐Ÿ Getting Started

To get started, clone a copy of this repo and get going!

Here is one way to clone the project. Create a local directory and navigate to it in your terminal. Then run this command.

git clone https://github.com/tataraba/django-slideshow.git

Requirements

Make sure you have Python 3.10 (or 3.11! โœจ) installed (somewhere) in your system.

Here are the libraries we will be using (instructions below on installing them)

  • Django
  • gunicorn
  • jinja2
  • django-render-block
  • pydantic
  • pydantic-django
  • django-htmx
  • django-htmx-refresh

๐Ÿ–ฅ๏ธ Installing

If you use a package manager, you can install directly from the pyproject.toml file, which makes this process a little more straight forward. I happen to use pdm as my package manager, but it's not required.

If you don't use pdm, go about it the traditional way, like so (these instructions are for Windows PowerShell users. Use the equivalent commands if on another OS/platform):

# First, Create a virtual environment
python -m venv .venv

# Activate said environment (this is the command in Windows PowerShell)
.\.venv\Scripts\activate

# Once your environment is activate, install dependencies
python -m pip install -r requirements.txt

Optional: If you are using pdm, all you would have to do instead is type:

# Install dependencies
pdm install

# Activate virtual environment (created by pdm with above command)
.\.venv\Scripts\activate

At this point, you should have a working Django app! ๐ŸŽˆ

If you're not familiar with Django, you will likely need to get acquainted with some of the Django manage.py commands. However, if you just want to start poking around, run these two commands:

# The `migrate` command turns the Django models into database tables
python manage.py migrate

# The `runserver` command runs your application locally
python manage.py runserver

And that's it!

You should be able to navigate to http://127.0.0.1:8000 and see the landing page for a Perfectly Simple Django Slidshew App (slidjo for short).

๐Ÿ”จ Usage

The slidjo app allows you to create slideshows using reveal.js.

All you need to do is create an html file containing only the appropriate revealjs markup, and then upload that file using the "Create Slideshow" feature.

You'll be able to add a title and description for your slideshow, and later, add it to "Events" that you can also create within the app.

More details on this will be coming later, but as a quick primer, your html file might look like this:

<!-- sample.html -->
<section>My First Slide</section>
<section>My Second Slide</section>
<section>
    <section>Let's see some vertical action</section>
    <section>Look at me down here</section>
</section>

Additionally, if you'd prefer to write your slides in markdown, your file can look like this:

<!-- sample_with_markdown.html -->
<section data-markdown>
    <textarea data-template>

        # Heading Example

        ---

        ### New Slide

        ---

        Reveal reads the "---" as a new slide

    </textarea>
</section>

Note that in neither case, you have to add <head> or <body> tags or anything like that. This is intended. Those pieces are added by templates automatically.

Obviously, the slides can get much fancier than these examples, but for more on that, you'll have to look through the revealjs documentation.

๐ŸŽถ Notes

This is very much a work in progress. Several features are missing and I need to add a lot more documentation.

Some of the things I want to add:

  • Updating/Deleting Slideshow and Event data
  • Ability to change "themes" for revealjs slideshows (selecting alternate css styles)
  • Auto detect .html vs .md file (instead of using <textarea>)
  • Data validation for several fields
    • End date > Start date
    • Support for online-only events
    • Ensuring the "featured" field working as expected
  • Ability to add multiple slideshows to one event (many to many relationship instead of one to many)
  • Add tests!
  • Documentation on how to use tailwind to further optimize the look and feel

๐Ÿ’— Contributions?

I am considering opening up this project for contributions. I have no idea how to manage a project, though, so for now, ๐Ÿคทโ€โ™‚๏ธ...

But, if you watch this space, I may get to it sooner rather than later.

django-slideshow's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

django-slideshow's Issues

Support for online events

This may require reworking the model (database table), but as of now, there's no clear way to make a distinction between a live event and an online-only event.

Think about a different way to represent an event based on type. Maybe have a drop-down? Could list in-person, hybrid, online-only as the options? Would fields change based on selection? Maybe?

Updating/Deleting Slideshow and Event data

Right now, updating or deleting "Slideshow" or "Event" data has to be done through the admin panel. This works okay, but it would be easier if this could just be handled through the frontend. I believe htmx can make this fairly easy or intuitive.

However, note that if this were ever deployed out into the "real world", then certain facets of the site (including most CRUD events) would need to be locked behind user authentication--but that's a story for another day.

Auto-detect for .html vs .md files

Right now, when uploading a file while creating a slideshow, the application expects an html file.

First of all, validation can be added to ensure that only .html or .md files are allowed.

Additional validation could be added to ensure that unnecessary tags are not included in the html file (like <head> or <body>, but maybe that's a separate issue.

As of now, the program only expects html file, which means that if someone wants to create slides is markdown, they need to include the <section data-markdown> and <textarea data-template> html tags in their file around the markdown content. This is not ideal. It would be great if the application detects markdown and adds those tags automatically.

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.