question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for multiple books in a single project

See original GitHub issue

Desired feature

I have a software package that is composed of two separate parts: A C-based library (c-proj) and a python wrapper that builds upon this library (py-proj). The documentation for the two projects is found in the main proj repo of the project, but the documentation of c-proj and py-proj are very different, and each has its own separate _toc.yml file inside of their own separate folders. I would like to to be able to host both of the books on the same web site and to be able to switch easily between the c-proj and py-proj books.

A possible solution

One possible solution would be to put the documentation of each project into its own folder, and then add an index.html file that allows the user the switch between the two. The structure of the book would look something like this:

book
├── index.md
├── c-proj
│   ├── _toc.yml
├── py-proj
│   ├── _toc.yml

An alternative solution might be to build the sub-books in separate _build/html/c-proj, _build/html/py-proj folders, and then provide the option of choosing which index.html file should be used as the default (this would create a hard link to the index.html file). A drop down menu could then be added to the top of the page allowing to switch between the c-proj and py-proj books.

Multilingual support

Even though this feature request is related to hosting independent sub-books in a single repo, I suspect that the machinery for multiligual support might be similar. See https://github.com/executablebooks/jupyter-book/issues/223

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
HealthyPearcommented, Feb 11, 2022

Any idea how to tell the book the same settings about logo and title that I have in the conf.py? I am using "logo_only": True, in conf.py and that works for the main page, but in the book the title (which is long) is crammed on the right between the logo and the sidebar limit

I found out how to remove it from the logo by adding

sphinx:
  config:
    html_theme_options:
      logo_only: True

to the book’s _config.yml, though it might be good to also state where to put it wrt to the logo

0reactions
HealthyPearcommented, Feb 10, 2022

Hmm - the new sphinx book theme actually does have some rough support for adding a header. Check out these instructions here: https://sphinx-book-theme.readthedocs.io/en/latest/customize/header.html

This seems to do the job! though I’ll need to learn how to do the styling

for reference now my custom css looks like this

iframe.book {
    width: 100%;
    height: 100%;
    border: none;
    position: fixed;
    top: 2em;
    bottom: 0;
    left: 0;
    z-index: 1000000;
}

.bd-sidebar {
    border: none;
    z-index: -100000;
}

Right now there’s no styling that is specific to the header, but perhaps over time we could add this in for common patterns. There’s a question of where to draw the line between this theme and the pydata theme 🤔

I understand - I think a proper solution where a book is inside another book should work better anyway…

Any idea how to tell the book the same settings about logo and title that I have in the conf.py? I am using "logo_only": True, in conf.py and that works for the main page, but in the book the title (which is long) is crammed on the right between the logo and the sidebar limit

Read more comments on GitHub >

github_iconTop Results From Across the Web

How I Write Multiple Books at Once - YouTube
RELATED VIDEOS:→My Writing Process: https://www.youtube.com/watch?v=xbF_gY69wlM&t=16s→Self Care Tips for Writers: ...
Read more >
Is it okay to work on multiple book projects at once? - Quora
Yes and no. It very much depends on your rationale for doing so. For some people, they need the mental space of working...
Read more >
Use advanced book creation options in Pages - Apple Support
Learn how to use advanced options in Pages to fine tune or create a digital book in the EPUB book format.
Read more >
A+ Content - Amazon Kindle Direct Publishing
You can create one A+ Content project and apply multiple book ASINs to it, to add A+ Content to different format detail pages....
Read more >
Create a booklet or book in Word - Microsoft Support
For best results, change the document layout before you start your writing project. That way there's less clean-up work to do if tables...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found