<div dir="ltr"><div><div><div><div><div><div>Hi all,<br><br></div>I have been fiddling with QGIS documentation trying to go back to Richrd objective of seeing the figures and inline image substitutions on github markdown preview. I think I made it! But we may need to do some changes, so I would like to discuss that with you.<br><br></div><div>For Figure preview on github we arlready knew what needed to be done. We need to move the images to a folder above the rst file in a "image" or "img" folder. But we had the problem with internationalization of the images. I found out that all we need to do is add this line to the conf.py file:<br><br>figure_language_filename = '{path}{language}/{basename}{ext}'<br><br></div><div>And then, put any language specific figure, with the exact same name as the english version inside a images/[language_code] folder.<br></div><div>When building a different language, sphinx will look into those folders and if an equal filename exists, replaces the "english" figure.<br></div><div><br></div><div>This even allow us to clean up all that mumbo jumbo of copying the resourses forlder according to the language to a temporary static folder<br><br></div><div>For inline substitutions to be previewed in github, I found out that we need to put the substitution command inside the rst file itself (instead of added by conf.py as a rst_epilog), we need to be able to set a relative path from the rst to the image, and  and we need set the class as inline. but we all need to have the image available from github.<br><br></div><div>So, either we put the necessary icons files in each "image/common" folder as needed (which may lead to duplicates), and the substitution would look like this:<br><br><span style="font-family:monospace">.. |add| image:: /static/common/mActionAdd.png<br>   :class: inline<br>   :width: 1.5em</span><br><br>or we put them all together in a static folder in source, and we set relative paths from the rst file, like this:<br></div><div><br></div><div></div><span style="font-family:monospace">.. |add| image:: </span>../../../static/common/mActionAdd.png<br><span style="font-family:monospace">   :class: inline<br>   :width: 1.5em<br></span><div><br></div>I would prefer the second option.<br><br></div>Here's an example of this kind of working:<br><br><a href="https://github.com/SrNetoChan/QGIS-Documentation/blob/test_inline/source/docs/user_manual/introduction/qgis_gui.rst">https://github.com/SrNetoChan/QGIS-Documentation/blob/test_inline/source/docs/user_manual/introduction/qgis_gui.rst</a><br><br></div>you will notice that there is a image folder, and inside a PT_pt folder.<br><br></div>Let me know what you think before I start creating a pull request to change all images the conf.py and the makefile.<br><br></div>Thanks!<br></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Alexandre Neto</div><div>---------------------</div><div>@AlexNetoGeo</div><div><a href="http://sigsemgrilhetas.wordpress.com">http://sigsemgrilhetas.wordpress.com</a></div><a href="http://gisunchained.wordpress.com">http://gisunchained.wordpress.com</a><br></div></div>