<p dir="ltr">Hi Alexandre,</p>
<p dir="ltr">Thanks for your efforts. I later saw your yesterday chat with Richard (sorry!) and it looks like things has progressed since... <br>
Being able to see the docs without having built it will likely make docs writing and review more comfortable. This could really help eg to review many of the Processing help pull requests that are awaiting for reviewers for weeks (reader, in case you wonder, this was a call for people to review the new description files of our beloved algorithms - just comment if it's right and makes sense to you, it's in good english and complete enough). <br>
If it could then attract more writers, Bingo...</p>
<p dir="ltr">About the icons/text replacement, i think duplication is a no-go: a single place to list them all and UPDATE them when they change; tracking those occurences will be a nightmare (yes, i like exageration!!!). <br>
But do you mean that we would need to list in each rst file the substitutions we used in it (with relative paths)? Png files would all be at the single place but reference to each of them will be recreated in each file they are used? Tracking won't be easier, neither (+ relative paths errors/failures when section moves). I'm not sure this really eases the writing process. There's no way to just mention them like we do now? Any other github/sphinx guru around to help for the missing gaps/bits? I just discover the :class: role so cannot be of any help. </p>
<p dir="ltr">Honestly, in case i well understood the proposal, i'm balanced because of the replacement management. <br>
Keen to hear others' opinion... <br>
And again, thanks for tackling this. Would be a nice feature for docs team :-) </p>
<p dir="ltr">Regards, <br>
Harrissou</p>
<div class="quote">Le 22 déc. 2017 23:49, Alexandre Neto <senhor.neto@gmail.com> a écrit :<br type='attribution'><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><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>
</blockquote></div>