linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Including images on Sphinx documents
@ 2016-11-07  9:55 Mauro Carvalho Chehab
  2016-11-07 10:53 ` Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2016-11-07  9:55 UTC (permalink / raw)
  To: Jonathan Corbet, linux-kernel, linux-media
  Cc: Jani Nikula, linux-doc, ksummit-discuss

Hi Jon,

I'm trying to sort out the next steps to do after KS, with regards to
images included on RST files.

The issue is that Sphinx image support highly depends on the output
format. Also, despite TexLive support for svg and png images[1], Sphinx
doesn't produce the right LaTeX commands to use svg[2]. On my tests
with PNG on my notebook, it also didn't seem to do the right thing for
PNG either. So, it seems that the only safe way to support images is
to convert all of them to PDF for latex/pdf build.

[1] On Fedora, via texlive-dvipng and texlive-svg
[2] https://github.com/sphinx-doc/sphinx/issues/1907

As far as I understand from KS, two decisions was taken:

- We're not adding a sphinx extension to run generic commands;
- The PDF images should be build in runtime from their source files
  (either svg or bitmap), and not ship anymore the corresponding
  PDF files generated from its source.

As you know, we use several images at the media documentation:
	https://www.kernel.org/doc/html/latest/_images/

Those images are tightly coupled with the explanation texts. So,
maintaining them away from the documentation is not an option.

I was originally thinking that adding a graphviz extension would solve the
issue, but, in fact, most of the images aren't diagrams. Instead, there are 
several ones with images showing the result of passing certain parameters to
the ioctls, explaining things like scale and cropping and how bytes are
packed on some image formats.

Linus proposed to call some image conversion tool like ImageMagick or
inkscape to convert them to PDF when building the pdfdocs or latexdocs
target at Makefile, but there's an issue with that: Sphinx doesn't read
files from Documentation/output, and writing them directly at the
source dir would be against what it is expected when the "O=" argument
is passed to make. 

So, we have a few alternatives:

1) copy (or symlink) all rst files to Documentation/output (or to the
   build dir specified via O= directive) and generate the *.pdf there,
   and produce those converted images via Makefile.;

2) add an Sphinx extension that would internally call ImageMagick and/or
   inkscape to convert the bitmap;

3) if possible, add an extension to trick Sphinx for it to consider the 
   output dir as a source dir too.

Comments?

Regards,
Mauro

^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2016-11-21 19:48 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07  9:55 Including images on Sphinx documents Mauro Carvalho Chehab
2016-11-07 10:53 ` Jani Nikula
2016-11-07 11:46   ` Mauro Carvalho Chehab
2016-11-07 17:05     ` [Ksummit-discuss] " Josh Triplett
2016-11-08 10:50       ` Mauro Carvalho Chehab
2016-11-16 16:03         ` Arnd Bergmann
2016-11-16 20:26           ` Mauro Carvalho Chehab
2016-11-17 11:07             ` Arnd Bergmann
2016-11-17 11:28               ` Jani Nikula
2016-11-17 12:39                 ` Mauro Carvalho Chehab
2016-11-17 14:52               ` Theodore Ts'o
2016-11-17 15:16                 ` Mauro Carvalho Chehab
2016-11-17 15:28                   ` Johannes Berg
2016-11-17 16:25                   ` James Bottomley
2016-11-17 15:32               ` Mauro Carvalho Chehab
2016-11-17 16:02               ` Linus Torvalds
2016-11-17 16:04                 ` Linus Torvalds
2016-11-18  9:15                 ` Jani Nikula
2016-11-18 10:23                   ` Daniel Vetter
2016-11-19 17:15                 ` Jonathan Corbet
2016-11-19 17:38                   ` Andrew Lunn
2016-11-19 17:50                   ` Bart Van Assche
2016-11-19 17:55                   ` David Woodhouse
2016-11-19 18:45                     ` Linus Torvalds
2016-11-19 22:59                       ` David Woodhouse
2016-11-20 14:26                         ` Mauro Carvalho Chehab
2016-11-19 20:54                   ` Mauro Carvalho Chehab
2016-11-19 21:09                     ` Linus Torvalds
2016-11-21 10:39                   ` Johannes Berg
2016-11-21 14:06                     ` Mauro Carvalho Chehab
2016-11-21 15:41                       ` James Bottomley
2016-11-21 15:44                         ` Johannes Berg
2016-11-21 15:47                           ` Jani Nikula
2016-11-21 19:48                           ` Mauro Carvalho Chehab
2016-11-13 21:00     ` Jonathan Corbet
2016-11-14 14:16       ` Mauro Carvalho Chehab
2016-11-09 12:27   ` Mauro Carvalho Chehab
2016-11-07 17:01 ` [Ksummit-discuss] " Josh Triplett
2016-11-09  9:22   ` Markus Heiser
2016-11-09 11:16     ` Jani Nikula
2016-11-09 11:27       ` Mauro Carvalho Chehab
2016-11-09 11:45         ` Jani Nikula
2016-11-09 11:27       ` Markus Heiser
2016-11-09 11:58         ` Jani Nikula
2016-11-09 22:11           ` Markus Heiser
2016-11-10 10:35             ` Jani Nikula
2016-11-11 11:22               ` Jani Nikula
2016-11-11 11:45                 ` Markus Heiser
2016-11-11  9:34           ` Mauro Carvalho Chehab
2016-11-13 19:52 ` Jonathan Corbet
2016-11-14 13:30   ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).