decker-edu / decker

A markdown based tool for slide deck creation.
GNU General Public License v3.0
55 stars 14 forks source link

Feature: Adjusted (Title Slide) Templates #59

Closed salbeira closed 9 months ago

salbeira commented 9 months ago

This merge adds some features and some cleanup to the templates of the default pack and the tudo pack.

I added several partials to be evaluated to spread out tasks the templates deal with into different files so finding the places to change styles, plugins or meta variable translation are easier to find.

In addition I added a customizable logos and copyright-information section to the title slides. Multiple authors are now handled equally to regular authors, just as a list of entries. Every describable entity can now also have a URL attribute to make their name clickable to link to their respective websites.

The way these changes are supposed to function is simply adding functionality but not removing functionality or changing existing ones. Everything should work as it worked before sans some changes to variable names (the default pack used "institute" instead of "affiliation", but @monofon told me I can and should just change things around as noone maintains this resource pack)

The best way I found to describe the title slide meta variables is this pseudo-grammar:

title: string
subtitle: string
author: Author
authors: [Author]
affiliation: Affiliation
copyright: Copyright
teaser: Image
logos: [Image]

type Author: string | {
    name: string
    url?: string
    affiliation?: Affiliation
}

type Affiliation: string | {
    name: string
    url?: string
    logo?: Image
}

type Image: string | {
    uri: string
    width?: string
    height?: string
}

type Copyright: string | {
    type: string
    url?: string
}

Attributes with a ? are optional.

A title slide can have: a Title, a Subtitle, a primary author and a primary affiliation. One can also supply multiple authors in the authors variable. It can have a copyright disclaimer, a teaser image and a list of logos to be included at the bottom of the slide.

Each author themselves can have a specific affiliation assigned to them. The primary author can have this too if the user wants to declare a different affiliation of the author compared to the deck's affiliation.

An affiliation can have a logo assigned to them. This allows one to have the logos of each author's affiliation displayed beneath their data (in the case of our resource pack).

Images can be supplied either purely by their URI or by supplying both URI and width and height. The values of the images' dimension can be supplied as any CSS valid value as they are inserted into the images internal style data.

Copyright information can be supplied either simply by a string or by supplying the copyright type and a URL to the license.

When supplying all data the title page can become quite crowded. The user is advised to review if they need to cramp the title page with everything available.

@monofon adjusted the path-resolution in develop already: Paths inside of variables now only get adjusted if they actually also exist. Therefore the entrie subtrees of data for author, authors, affiliation, teaser and logos are added as runtime-path-variables. As it is highly unlikely someone names one of their files "My Full Name", without a file-extension, or "https://example.org", any meta variable that has simple strings inside them just doesn't get adjusted while actual paths get properly resolved to relative paths to the referenced file.

Right now for the tudo resource pack the tudo logo is included by default. The current issue with runtime-path-resolution is that files referenced inside the support directory are always declared as "not found", therefore no path adjustment happens. Therefore right now the tudo-logo is added manually inside this pack's deck-title.html . This allows for a config-flag that adds or removes the logo though.

To play around with all the options please look into the title-slide-deck.md - Test File

In addition this merge removes all references to the unused TOC parts of the templates as recommended in Issue #36 .

Further things to consider and to discuss:

mbotsch commented 9 months ago

Please test on my example deck.

salbeira commented 9 months ago

If you mean the eLearning deck (fresh checkout):

grafik

mbotsch commented 9 months ago