Skip to content

Where to place config info when using ReST? #16

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

Closed
deeplook opened this issue Oct 21, 2020 · 11 comments
Closed

Where to place config info when using ReST? #16

deeplook opened this issue Oct 21, 2020 · 11 comments
Labels
documentation Improvements or additions to documentation

Comments

@deeplook
Copy link
Contributor

deeplook commented Oct 21, 2020

@choldgraf I want to use sphinx-thebe with ReST, but I'm missing any information where to place config information about binderOptions and kernelOptions.

@deeplook deeplook added the documentation Improvements or additions to documentation label Oct 21, 2020
@choldgraf
Copy link
Member

hey @deeplook - these options are all configured automatically from the configuration of your repository that you put in conf.py:

https://github.com/executablebooks/sphinx-thebe/blob/master/sphinx_thebe/__init__.py#L97

see the configuration page for reference:

https://sphinx-thebe.readthedocs.io/en/latest/configure.html

does that not work for you?

@deeplook
Copy link
Contributor Author

@choldgraf I had seen that configuration page, but it has some potential to confuse people, like me, as it does not mention conf.py anywhere. And in the last section it says: "Here’s a reference of all of the configuration values avialable to sphinx-thebe.", but misses codemirror-theme from a section above.

After pip install sphinx_thebe and equivalent edits in my conf.py I see no editable cells after running make html:

extensions = [
    # ...
    'sphinx_thebe'
]

thebe_config = {
    "repository_url": "https://github.com/my/repo",
    "repository_branch": "master",
    "selector": "div.thebe",
}

and this in hello.rst:

.. code-block:: python
   :class: thebe
   print("Hello World!")

Also, the config field names seem to be named differently from thebelab which I have tested ok briefly before.

@choldgraf
Copy link
Member

@deeplook - you're right, I think that we can improve the documentation here and potentially reduce some confusion around having multiple configuration patterns for the same thing.

I've also opened up #17 to discuss standardizing the configuration value names 👍

@deeplook
Copy link
Contributor Author

Can you point me to an existing example using ReST, similar to my description above?

@choldgraf
Copy link
Member

Well right now I don't believe it is possible to configure thebe from within rST, the only configuration comes via the conf.py configuration. :-/

what's the thing you're trying to do that you cannot accomplish with conf.py configuration? That might be your only option until we can document / expand the configuration (e.g. via #17)

@deeplook
Copy link
Contributor Author

I am ok with conf.py, I just wish it would work. ;)

@choldgraf
Copy link
Member

me too 😬 sorry - this is a young package so still working out the kinks!

@deeplook
Copy link
Contributor Author

deeplook commented Oct 23, 2020

Funny, but I found out that it actually works after I add this button to the ReST source:

.. thebe-button:: Run Thebe!

But after I click on the button the code cell styling (in my case set by sphinx_rtd_theme gets modified quite a bit), see GIF.

sphinx_thebe

@choldgraf
Copy link
Member

yep - that is to be expected, it uses CodeMirror for the interactive cells, which apply a different styling etc. You can try modifying either with other themes or by applying your own CSS to the site.

Do you think this issue can be closed?

@deeplook
Copy link
Contributor Author

Feel free to close it. Maybe the documentation issue can be handled separately (?).

@choldgraf
Copy link
Member

yeah - for sure there is still more to do!

LecrisUT pushed a commit to LecrisUT/sphinx-thebe that referenced this issue Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants