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

number of column (nbCol) always at 3 if usePictures is used. #103

Open
5shekel opened this issue Mar 18, 2020 · 4 comments
Open

number of column (nbCol) always at 3 if usePictures is used. #103

5shekel opened this issue Mar 18, 2020 · 4 comments

Comments

@5shekel
Copy link

5shekel commented Mar 18, 2020

this works

<nspages
demo
-nbCol 5
>

this doesnt

<nspages
demo
-usePictures 
-nbCol 5
>

both if nbCol is set to higher or lower number.

@5shekel
Copy link
Author

5shekel commented Mar 18, 2020

just want to thanks you for the great front page for my wiki!
nspages 🚀

@5shekel 5shekel changed the title nbCol always at 3 if usePictures is used. number of column (nbCol) always at 3 if usePictures is used. Mar 18, 2020
@gturri
Copy link
Owner

gturri commented Mar 18, 2020

Thanks for this bug report.
Indeed, the usePictures option completely does not take the nbCol option into account (Ias can be seen on https://github.com/gturri/nspages/blob/master/syntax.php#L202 )
I don't remember why I implemented it that way. I'll try to look into it

@gturri
Copy link
Owner

gturri commented Mar 24, 2020

So, the explanation is... that there are no columns at all.
Actually it's just a list of images, one after the other. Say you have pages A1, A2, B1, B2, and C1. With the default output it would be displayed like this

A1  B1 C1
A2  B2

but with images it's just

A1 A2 B1 B2 C1

and when it doesn't fit on a same line, the browser displays them like

A1 A2 B1
B2 C1

but if your template is less wide, then it could well be displayed like this:

A1 A2
B1 B2
C1

Long story short: the code which displays images is completely not manipulating columns at all. From a theoretical point of view, this component could be rewritten to display columns, but that would be not so trivial in itself, and it might lead to displaying pages which may be hard to render on e.g. mobile devices.

Something which may fit your needs could perhaps be adding an option like picturesRatio which could be used to reduce the size of the images (e.g. <nspages -usePictures -picturesRatio=0.5> to have images twice as small). Let me know if it might suit you. If it does, I could try to do it (but I don't know how long it would take, given that I'm more a backend developer, and this feature would rather involve front-end skills)

gturri added a commit that referenced this issue Mar 24, 2020
gturri added a commit that referenced this issue Mar 24, 2020
it could help on #103, but it' not completed yet
(PrinterPictures::_picturesRatio is still not used)
gturri added a commit that referenced this issue Mar 24, 2020
it could help on #103, but it' not completed yet
(PrinterPictures::_picturesRatio is still not used)
@5shekel
Copy link
Author

5shekel commented Mar 25, 2020

thank you gturri, for the time you put into this.

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