Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4922143pxu; Thu, 10 Dec 2020 08:34:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOwZBk1nI9SBNY2Vn+b8J7nnqGJyVgS5+zToCqhYLnmTdegFLzzVWdF+murfr2fsVXvIiR X-Received: by 2002:a17:906:4809:: with SMTP id w9mr7199336ejq.139.1607618042776; Thu, 10 Dec 2020 08:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607618042; cv=none; d=google.com; s=arc-20160816; b=ixNAQQAWb/kIWyG5++D3CIG1yA6AGDwCv/+QyII/iC+kI8zcDivvjNCM1Efv6k8krG Zw5Y/cwOtkGYh0SL6Irwwp7P5IpLf7aqdks9R9/mKq5hFR6qjwPIEzUesRxTGfR1kfbd QPPcVrs4+yiI2tAt2c41vRMzaNIosxdxKbdKze4h961C8ka131l8fRcmuDcwH2S2Afac e5IunhrkTSnVPG00Ptjw+8urMfGKSTaCjtdQ8UsNb3qRQuHWznPEdM2cxvPmFMWDaDc2 6jE8fB9CjGnIpcDtJyyb3UfJeQHGp7n/s9Pc5gca8BwHzxqYb5qpqTA2m4ahd7JTkZS+ JrZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:dkim-signature :date; bh=VIUzUmBeJgQgCDSZK78pNsyjh+plyINFmEqHrtd2hW0=; b=CYt82diXn6b+aZNRvsYZEwYvmy4vN2Cy9IkVV4yvRUxkKNw6Zpz043V5rwotdJ1w/K eRFhoaffs+TsYOjYB+CVg5Dk3kY/sM/R+M5K0tpOH7E7kHtk2CEKbEPg2xHUxtsLJPEA IyqhgN/KfiqdbLecIrTHpePl5pZdLlihBJ5VAn4JBRiKQImikAvs78HtpeUsbZm8y0KS XVgA/EvnXqba6UfvczbmjU8UWYNA6ssRemXZM4T3G4zkOYjMF2DkgOlGefUiwZ3A+Lhe mPjwseeTsGLNOgGcxLvzSiZdh3nd9U9vsZUQ3GpLNy14j9jVBGGt5uQJOJQhkPfMDNPu b5nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oh2ptG4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c22si2844947ejx.290.2020.12.10.08.33.38; Thu, 10 Dec 2020 08:34:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oh2ptG4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392244AbgLJQao (ORCPT + 99 others); Thu, 10 Dec 2020 11:30:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:54358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392278AbgLJQaY (ORCPT ); Thu, 10 Dec 2020 11:30:24 -0500 Date: Thu, 10 Dec 2020 17:29:38 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607617783; bh=wKoP18O5gMPLwquu/buxQ4EvFVAv2YOC8QSG6GaC+jQ=; h=From:To:Cc:Subject:In-Reply-To:References:From; b=Oh2ptG4ZVLCMhVKtFV4GX1Gr3/bKm6NIJvSboVEyeZe8uQ6hHt+N5rAoM6rTaduxl HBY/f7WQvd8dGxp7rx23DFyZvq88hR0kzzYMIih8BJkGprPE1CD86gtYhYH89Fx1DJ IMagpqVjLXGhdAvmefQ+Mt5yMPxbzdltgskX9uuEt4moX1l7Q4dJ6QpI+ZzCfGJoaz UlHTa7aAni8ENe685aHLxDw1KIk+XFDpx/zx5jguM7xY8yo3ZZHPd/zmLN4z2+C7Z/ dZcf2NkEnqo8uLifUlVUC7moDPP4zQYh5J9ys9/4VC7Owhv/8l6YSuF/KxfzKku3ZU /+zpsr0pxkbYg== From: Mauro Carvalho Chehab To: "Jonathan Corbet" , Linux Doc Mailing List Cc: Masahiro Yamada , Mauro Carvalho Chehab , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH RFC] docs: experimental: build PDF with rst2pdf Message-ID: <20201210172938.3b3086b6@coco.lan> In-Reply-To: References: <20201210074845.4eb67f22@lwn.net> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, 10 Dec 2020 17:01:19 +0100 Mauro Carvalho Chehab escreveu: > Add an experimental PDF builder using rst2pdf > > Signed-off-by: Mauro Carvalho Chehab I opened an issue at: https://github.com/rst2pdf/rst2pdf/issues/958 Let's hope someone at rst2pdf could help fixing this ;-) Regards, Mauro > --- > Documentation/Makefile | 5 +++++ > Documentation/conf.py | 21 +++++++++++++++------ > Documentation/userspace-api/media/Makefile | 1 + > Makefile | 4 ++-- > 4 files changed, 23 insertions(+), 8 deletions(-) > > diff --git a/Documentation/Makefile b/Documentation/Makefile > index 61a7310b49e0..c3c8fb10f94e 100644 > --- a/Documentation/Makefile > +++ b/Documentation/Makefile > @@ -115,6 +115,10 @@ pdfdocs: latexdocs > > endif # HAVE_PDFLATEX > > +rst2pdf: > + @$(srctree)/scripts/sphinx-pre-install --version-check > + @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,pdf,$(var),pdf,$(var))) > + > epubdocs: > @$(srctree)/scripts/sphinx-pre-install --version-check > @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,epub,$(var),epub,$(var))) > @@ -140,6 +144,7 @@ dochelp: > @echo ' htmldocs - HTML' > @echo ' latexdocs - LaTeX' > @echo ' pdfdocs - PDF' > + @echo ' rst2pdf - PDF, using experimental rst2pdf support' > @echo ' epubdocs - EPUB' > @echo ' xmldocs - XML' > @echo ' linkcheckdocs - check for broken external links' > diff --git a/Documentation/conf.py b/Documentation/conf.py > index 66e121df59cd..6f2788aac81e 100644 > --- a/Documentation/conf.py > +++ b/Documentation/conf.py > @@ -123,6 +123,12 @@ if (major == 1 and minor > 3) or (major > 1): > else: > extensions.append("sphinx.ext.pngmath") > > +# Enable experimental rst2pdf, if available > +try: > + extensions.append("rst2pdf.pdfbuilder") > +except: > + sys.stderr.write('rst2pdf extension not available.\n') > + > # Add any paths that contain templates here, relative to this directory. > templates_path = ['_templates'] > > @@ -614,12 +620,15 @@ epub_exclude_files = ['search.html'] > # > # See the Sphinx chapter of https://ralsina.me/static/manual.pdf > # > -# FIXME: Do not add the index file here; the result will be too big. Adding > -# multiple PDF files here actually tries to get the cross-referencing right > -# *between* PDF files. > -pdf_documents = [ > - ('kernel-documentation', u'Kernel', u'Kernel', u'J. Random Bozo'), > -] > + > +# Add all LaTeX files to PDF documents as well > +pdf_documents = [] > +for l in latex_documents: > + doc = l[0] > + fn = l[1].replace(".tex", "") > + name = l[2] > + authors = l[3] > + pdf_documents.append((doc, fn, name, authors)) > > # kernel-doc extension configuration for running Sphinx directly (e.g. by Read > # the Docs). In a normal build, these are supplied from the Makefile via command > diff --git a/Documentation/userspace-api/media/Makefile b/Documentation/userspace-api/media/Makefile > index 81a4a1a53bce..8c6b3ac4ecb0 100644 > --- a/Documentation/userspace-api/media/Makefile > +++ b/Documentation/userspace-api/media/Makefile > @@ -59,6 +59,7 @@ all: $(IMGDOT) $(BUILDDIR) ${TARGETS} > html: all > epub: all > xml: all > +pdf: all > latex: $(IMGPDF) all > linkcheck: > > diff --git a/Makefile b/Makefile > index 43ecedeb3f02..db4043578eec 100644 > --- a/Makefile > +++ b/Makefile > @@ -264,7 +264,7 @@ no-dot-config-targets := $(clean-targets) \ > cscope gtags TAGS tags help% %docs check% coccicheck \ > $(version_h) headers headers_% archheaders archscripts \ > %asm-generic kernelversion %src-pkg dt_binding_check \ > - outputmakefile > + outputmakefile rst2pdf > no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease > single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/ > > @@ -1654,7 +1654,7 @@ $(help-board-dirs): help-%: > > # Documentation targets > # --------------------------------------------------------------------------- > -DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \ > +DOC_TARGETS := xmldocs latexdocs pdfdocs rst2pdf htmldocs epubdocs cleandocs \ > linkcheckdocs dochelp refcheckdocs > PHONY += $(DOC_TARGETS) > $(DOC_TARGETS): Thanks, Mauro