executablebooks / sphinx-panels

A sphinx extension for creating panels in a grid layout
https://sphinx-panels.readthedocs.io
MIT License
83 stars 20 forks source link

Simplify configuration for quick access to common setups #45

Closed mmcky closed 3 years ago

mmcky commented 3 years ago

Is your feature request related to a problem? Please describe.

I just gave sphinx-panels a go and found it very difficult to understand the grid system and card layout documentation not having a lot of exposure to html / css etc. I tried:

````{panels}
```{figure} _static/logo1.png

but it came up as 2 rows x 1 column when I thought from the docs it would be 1 row x 2 columns

Describe the solution you'd like

This is similar to #18 -- but I think it would be great to simplify access to high level configurations such as an equally spaced grid with :rows: and :columns: able to be provided.

Describe alternatives you've considered

None -- other than learning the complex juganaut that is .col-sm-4 magic

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

chrisjsewell commented 3 years ago

but it came up as 2 rows x 1 column when I thought from the docs it would be 1 row x 2 columns

This feels like a misunderstanding of how panels actually work; the number of columns is not fixed, it is dependant on screen/window size. What happens if you increase the width of your viewing window?

AakashGfude commented 3 years ago

@chrisjsewell the sphinx-panels in the case of @mmcky was tested with quantecon-book-theme which does not use bootstrap. So, on inspecting the elements, none of the col-md, col-xs styles were applied. I reckon its a requirement of projects using sphinx-panels to have bootstrap included in their theme?

chrisjsewell commented 3 years ago

The required bootstrap css is included with this extension, unless you have specifically turned it off in your conf.py, which may be the case if you have copied that from sphinx-book-theme

AakashGfude commented 3 years ago

ooh, nice. so there is a config in sphinx-book-theme ? or sphinx-panels to turn on/off?

chrisjsewell commented 3 years ago

What's the link to your conf.py

AakashGfude commented 3 years ago

@chrisjsewell the lecture on which it is being tested is https://github.com/QuantEcon/lecture-python-programming.myst/blob/master/lectures/_config.yml

and the theme repo: https://github.com/QuantEcon/quantecon-book-theme

chrisjsewell commented 3 years ago

Oh you are using it with jupyter-book. Then yes it is turned off: https://github.com/executablebooks/jupyter-book/blob/a47ff972ecdb39b349a46c2d3bc796e57e98f7b9/jupyter_book/config.py#L43

AakashGfude commented 3 years ago

Thanks a lot @chrisjsewell .

mmcky commented 3 years ago

ok thanks @chrisjsewell -- I might add something to the docs. I didn't understand how panels works :-)

mmcky commented 3 years ago

@chrisjsewell are you saying to get panels to work we need to add

panels_add_boostrap_css: True

to top level of _config.yml?

It looks like this is all setup using jupyter-book from the docs.

https://jupyterbook.org/content/content-blocks.html?highlight=panels#panels-and-dropdowns

and I can't find any mention of this in https://github.com/executablebooks/jupyter-book/blob/master/docs/_config.yml

chrisjsewell commented 3 years ago

No you have to add it under sphinx config

mmcky commented 3 years ago

Ok thanks @chrisjsewell makes sense.