0

I'd love to use the so elegant Jupyter-Book to construct documentation for my packages. I've tried quite a lot, and here is an example I'm finalizing those days :

One can see I use

  • jupyter-notebook to generate user guides or tutorials,
  • markdown to generate simple static pages without codes, and
  • sphinx autodoc to generate api documentation. Note I'm fairly newbie using sphinx and autodoc.

I'd like to enhance the publication style of the auto-generated api documentation. As one can see, e.g. on this page, there is no right sidebar in the API documentation, whereas one may want to write the names of the class methods, or module functions there.

Also, the parameters list might be better presented in indented lists instead of being queued in parenthesis, and the name of the class might be shorter, for instance only the name of the class, not the path to it might appear. In short, I'd prefer having

class BaseTokenizer(string: str = '', 
                    subtoksep: chr = ' ', 
                    intervals: Union[None, EvenSizedSortedSet] = None, 
                    tokens: list = [])

instead of the monolithic presentation

class iamtokenizing.base_tokenizer.BaseTokenizer(string: str = '', subtoksep: 
chr = ' ', intervals: Union[None, 
extractionstring.even_sized_sorted_set.EvenSizedSortedSet] = None, tokens: list = [])

Is there a way to do all of that, or should I consider raising an issue instead ?

FraSchelle
  • 249
  • 4
  • 10
  • The HTML is a bunch of inline `span`s, so you could apply custom CSS to get the appearance you want in a `custom.css`, then include that in your `conf.py`. https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_css_files – Steve Piercy Jan 06 '23 at 08:14
  • @StevePiercy That you for your comment. The point is: since I'm new to sphinx and jupyter-book, I do not know how this conf.py is read while using sphinx through jpuyter-book ... any idea where to get some infos ? – FraSchelle Jan 06 '23 at 10:53
  • Start with the Sphinx docs? There's a nice tutorial. – Steve Piercy Jan 06 '23 at 12:29
  • 1
    @StevePiercy: As far as I can tell, Jupyterbook does not use conf.py; instead there is a _config.yml file: https://jupyterbook.org/en/stable/customize/config.html – mzjn Jan 07 '23 at 09:48
  • @FraSchelle: "there is no right sidebar" - That's one problem. "the parameters list might be better presented" - That's a different problem. Please ask about one problem at a time. – mzjn Jan 07 '23 at 09:49
  • @mzjn Thank you ! Do you have any idea on the resolution? – FraSchelle Jan 12 '23 at 14:11
  • 1
    Regarding the display of parameters, there is a similar old issue (not about jupyter-book specifically) https://github.com/sphinx-doc/sphinx/issues/1514. – mzjn Jan 12 '23 at 14:21

0 Answers0