patat icon indicating copy to clipboard operation
patat copied to clipboard

Centering content

Open cvuorinen opened this issue 8 years ago • 6 comments

Hello,

First of all, patat looks like a great tool and I really like the concept. I have looked into few similar projects and patat looks like the most robust tool.

I'm trying to create my first presentation with it and stumbled on few issues. First of all, the "centered title slide" (referenced here https://github.com/jaspervdj/patat#input-format) does not seem to work if you separate the slides with ----. It only works when not using separators (auto splitting). Don't know if this is intentional, but can't always use auto splitting if you want slides with no titles for example.

I would also like an option to center something myself. I know Markdown does not support that but would be nice to have some custom control for it.

Another thing that I think would allow to make nicer looking presentations would be to be able to add some padding before the content. Or ability define a desired line length and then it would center that accordingly depending how wide the terminal is (something similar that this CSS example achieves .content { width: 300px; margin: 0 auto; }). If you have a big screen then starting the content from top left is not really ideal to create good looking presentation. Here is another similar tool that has a screenshot in the README that demonstrates this nicely https://github.com/jclulow/vtmc

cvuorinen avatar May 17 '17 20:05 cvuorinen

These are fair concerns.

  1. Re: centered slides: that's a good concern. I would like to change the behaviour here a bit but I'm slightly wary of changing the semantics of slides in a non-backwards compatible way. I think what we could do is treat ---- differently (just as a slide breaker) when slideLevel is explicitly set.

  2. That's also a good suggestion. I think the best syntax would be to rely on the ability to put raw HTML into markdown, e.g.:

     This is a normal paragraph.
    
     <center>
    
     This is a centered paragraph.
    
     </center>
    

    I would need to investigate how this works with other Pandoc frontends though -- markdown is not the only supported language.

  3. It is already possible to set the width. Put something like this in your metadata block:

     ---
     patat:
       columns: 40
     ...
    

    And patat will behave like the terminal is 40 columns wide. Adding margins is a good idea though. I imagine that would look like:

     ---
     patat:
       margin:
         top: 1
         left: 2
     ...
    

jaspervdj avatar May 18 '17 11:05 jaspervdj

Setting columns: 40 works, but still leaves the content to the left edge of the screen. It would be nicer to center the content (or another conf option to set it centered). At least I would personally more like the ability to center the fixed width columns rather than setting fixed margin, that way I don't need to know the terminal width.

Also, there is no mention about the columns option in the readme. So might want to update it at some point :)

cvuorinen avatar May 18 '17 13:05 cvuorinen

It will be nice to extract all possible configuration options. For example now I'm looking for a way to set general background...

majkrzak avatar Feb 24 '19 16:02 majkrzak

@majkrzak There is currently no way to set the background. If this is desired, please create a new issue -- this one is about having a way to center content.

jaspervdj avatar Feb 24 '19 20:02 jaspervdj

@jaspervdj my point was mostly about documentation

majkrzak avatar Feb 27 '19 21:02 majkrzak

hi guys

put raw HTML into markdown

as of today, this feature has not been implemented. correct? that is interesting, since markdown does support HTML as far as I know.. but it's probably a Pandoc thing. I might dig into your code then.

bbortt avatar Jun 11 '21 06:06 bbortt

I vote for this feature! mdp has good centering, but it is bad with colors and syntax highlighting - so patat is my choice. But patat could be much better with auto-centering of content. Margins -- are not the best workaround...

ngmaibulat avatar Feb 01 '24 15:02 ngmaibulat

This should be fixed on the main branch and will be included in the next release.

jaspervdj avatar Feb 12 '24 15:02 jaspervdj

This is included in v0.11.0.0 and later :partying_face:

jaspervdj avatar Feb 14 '24 15:02 jaspervdj