Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto load macros from the themes directory #45

Open
BestFriendChris opened this issue May 8, 2011 · 4 comments
Open

Auto load macros from the themes directory #45

BestFriendChris opened this issue May 8, 2011 · 4 comments

Comments

@BestFriendChris
Copy link
Contributor

Due to the relatively tight coupling between css/html and what the macros are producing, I think allowing people to add new macros inside of their themes makes sense.

I propose adding a folder (called macros) to the existing themes directories, moving all of the existing macros to the default theme, and writing code to autoload from these files.

If we think this is a good idea, I'd be willing to help out with this as well. My python is really rusty, so I'm not sure how much help I'd be in the autoloading code, but everything else I'm sure I'd be able to add value with.

Thoughts?

@n1k0
Copy link
Contributor

n1k0 commented May 18, 2011

I'm not sure macros should be tied to the theme concept. IMHO theming is much more about presentation than effective feature, and macros provide features (or at least, processing)…

Definitely a tough question.

@BestFriendChris
Copy link
Contributor Author

The problem is that sometimes a macro has an impact on layout. Take the presenter view as an example. That required additions to the HTML, CSS, and JS.

Another example: I put my résumé in a landslide slideshow (http://bestfriendchris.github.com/resume). I'd like to add a macro that has first level slides be laid out vertically while sub-slides be laid out horizontally. I don't really believe this belongs in stock landslide, but I'd like to include it in my own project. This will definitely require HTML, CSS, & JS changes...

@n1k0
Copy link
Contributor

n1k0 commented May 18, 2011

Hmmm you highlight a point I think I missed while designing landslide as it is now: the distinction between a /project/ and a /theme/… I'll have to think a bit more about this

@n1k0
Copy link
Contributor

n1k0 commented May 18, 2011

As a side note, what do you think about the possibility of importing macros through the config.cfg file, eg:

[landslide]
source = slides/
macros = macros.MyMacro
         macros.OtherMacro

So you could have a project structure like this:

project/
    slides/
        0_intro.md
        1_conclusion.md
    config.cfg
    macros.py 

With of course some kind of import function smart enough to resolve the macro class paths a bit like how Django does.

This could overcome part of the the problem you're raising here… Thoughts?

@adamzap adamzap removed this from the 1.0 milestone Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants