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

Some slides don't show at the top #26

Closed
nixfreak opened this issue Jun 14, 2023 · 16 comments
Closed

Some slides don't show at the top #26

nixfreak opened this issue Jun 14, 2023 · 16 comments

Comments

@nixfreak
Copy link

image

image

How can I make sure every slide starts at the top?

@HugoGranstrom
Copy link
Owner

Reveal.js automatically centers everything in both the x- and y-direction, if that's what you are referring to? So if the content isn't tall enough to take up the entire slide, it will be centered. Is this the problem?

@HugoGranstrom
Copy link
Owner

HugoGranstrom commented Jun 14, 2023

Found this question on their Github: hakimel/reveal.js#3069
Is this what you want to achieve?: https://revealjs.com/demo/?center=false (compared to https://revealjs.com/demo/)

@nixfreak
Copy link
Author

Ok , so is that with the slideOption? Do I need to add center=false to every slide?

I want the slides (words) to start at the top no the center. I need the slides to start at the top because of more words I can put on it.

@nixfreak
Copy link
Author

Found this question on their Github: hakimel/reveal.js#3069 Is this what you want to achieve?: https://revealjs.com/demo/?center=false (compared to https://revealjs.com/demo/)

Yes exactly.

@HugoGranstrom
Copy link
Owner

Ok , so is that with the slideOption? Do I need to add center=false to every slide?

I want the slides (words) to start at the top no the center. I need the slides to start at the top because of more words I can put on it.

It is not implemented in nimiSlides yet, but it should be easy to add a global switch that makes all slides non-centered.

You don't get more space by this though, because as it is now, things will move the more content you add.

@HugoGranstrom
Copy link
Owner

I can add it to my current PR later today or tomorrow if you would like to try it locally.

@nixfreak
Copy link
Author

perfect thanks

@HugoGranstrom
Copy link
Owner

@nixfreak It should be ready for a spin now. Clone this repo and switch to the writeDocs branch and nimble install it. Then you should have a version of nimiSlides which has the template disableVerticalCentering which you can call to remove the vertical centering of all slides.

@nixfreak
Copy link
Author

nixfreak commented Jun 16, 2023

Error: type mismatch: got
but expected one of:
template disableVerticalCentering()
first type mismatch at position: 1
extra argument given

expression: disableVerticalCentering do: nbText: hlMd """ <font size=6px> What is SKC?</font> """

@HugoGranstrom
Copy link
Owner

You should just run it once at the start. Then use normal slide as usual

@HugoGranstrom
Copy link
Owner

disableVerticalCentering()

slide:
 nbText: "Bla bla"

@nixfreak
Copy link
Author

You should just run it once at the start. Then use normal slide as usual

Oh .. ok ill try it. thanks again. I can't believe I can use just plain html to customize everything , this is too much fun. I have already had comments from co-workers telling me it looks "so professional" lol.

@nixfreak
Copy link
Author

nixfreak commented Jun 16, 2023

So I put the disableVerticalCentering() then slide but now I have issues

`╭─nixfreak@Cha0sX in repo: nimiSlides on  writeDocs [?] is  v0.2.2 via  v1.6.12 took 5ms
[🔴] × ./sample
[nimib] config file found: /home/nixfreak/.lang/nim/nimiSlides/nimib.toml
[nimib] srcDir: /home/nixfreak/.lang/nim/nimiSlides/docsrc
[nimib] filename: ../sample.html
[nimib] setting current directory to nb.homeDir: /home/nixfreak/.lang/nim/nimiSlides/docs
/home/nixfreak/.nimble/pkgs/nimib-0.3.9/nimib.nim(48) sample
/home/nixfreak/.nimble/pkgs/nimib-0.3.9/nimib/paths.nim(24) setCurrentDir
/home/nixfreak/.choosenim/toolchains/nim-1.6.12/lib/pure/os.nim(1438) setCurrentDir
/home/nixfreak/.choosenim/toolchains/nim-1.6.12/lib/pure/includes/oserr.nim(95) raiseOSError
Error: unhandled exception: No such file or directory
Additional info: /home/nixfreak/.lang/nim/nimiSlides/docs [OSError]

╭─nixfreak@Cha0sX in repo: nimiSlides on  writeDocs [?] is  v0.2.2 via  v1.6.12 took 3ms`


cat sample.nim |rg "disable*" -A 5

disableVerticalCentering() slide: slide: fragment(@[fadeIn, highlightBlue]): nbText: hlMd """ <font size=6px> What is SKC?</font>

@HugoGranstrom
Copy link
Owner

Hmm I have no idea what is happening tbh. Where have you placed your sample.nim? Is it in the nimiSlides repo? Then you might have to manually create a docs dir there

@nixfreak
Copy link
Author

nixfreak commented Jun 16, 2023

Fantastic , created a docs directory and moved the sample.nim file and my images directory and everything is at the top now per slide. This is awesome. question: does it make more sense to customize the font size via tags or css?

Is there a way to use css for customizing ?
Also do you plan to implement "hot code reloading", or just have a nims script to compile and execute the file ?

@HugoGranstrom
Copy link
Owner

I can't believe I can use just plain html to customize everything , this is too much fun. I have already had comments from co-workers telling me it looks "so professional" lol.

That's awesome to hear! :D

This is awesome. question: does it make more sense to customize the font size via tags or css? Is there a way to use css for customizing ?

I would say it depends. If you want to change the font-size globally, you should do it using CSS. But if there is just a few places where you want to change it, it could make sense to add a way to pass in the font size for that specific nbText. To add CSS you can use addStyle:

nb.addStyle: """
:root {
  --r-main-font-size: 42px;
}
"""

See a list of all the CSS variables here.

Also do you plan to implement "hot code reloading", or just have a nims script to compile and execute the file ?

This is something for nimib to implement and not something that will be implemented here. But I don't think this is something that will be done in the foreseeable future. To have a nimib-serve that automatically builds when a file has changed is the more plausible of the two options you mentioned, though. It's not that much work to recompile your program and refresh the webpage. But if someone would contribute it, we wouldn't say no ;)

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

2 participants