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

Build several PDFs out of a single project #71

Open
Samy-Oubouaziz opened this issue Mar 2, 2023 · 1 comment
Open

Build several PDFs out of a single project #71

Samy-Oubouaziz opened this issue Mar 2, 2023 · 1 comment

Comments

@Samy-Oubouaziz
Copy link

Hello,

I am considering switching from LaTeX to SimplePDF for a number of reasons. The first tests were very concluant, it works (almost) great out of the box, however, there is a quite important limitation due to our environment.

The documentation project is divided in 3 folders, Installation, Operation and Reference, with a single conf.py file at the root of the repo, and we build 3 separate PDFs, one for each folder, as the total reaches 1500 pages.

I am trying to use if/else statements for the master_doc and exclude_patterns in the following form (pseudo code):

if html:
    master_doc = 'index'
    exclude_patterns.extend(['*/index_pdf])
else:
    if install:
      master_doc = 'installation/index_pdf'
      exclude_patterns.extend(['index', 'operation/*','reference/*'])

    elif operation: 
      master_doc = 'operation/index_pdf'
      exclude_patterns.extend(['index', 'installation/*','reference/*'])

   elif reference:
      master_doc = 'reference/index_pdf'
      exclude_patterns.extend(['index', 'installation/*','operation/*'])

BUT doing so does not allow cross-referencing (using :ref:<reference>) between Installation/Operation/Reference, as 2 out of the 3 are excluded when building PDFs.

Is there currently a way to build 3 PDFs out of 1 Sphinx project, or to disable/bypass cross-referencing?

I do not need internal links inside the PDF.

Thank you in advance for your help!

@ubmarco
Copy link
Member

ubmarco commented Jan 26, 2024

Do I understand correctly, that your build fails due to the missing references?
So you can't have your PDF without these parts?

Why do you use exclude_patterns at all, can't you just set master_doc to the document you need and run the build?

Edit: Btw, if your issue is runtime, that should be ok as most time is consumed by writing, not reading. And writing is scoped to the master_doc and below.

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