[QGIS-Developer] plugin size

matteo matteo.ghetta at gmail.com
Thu Nov 30 04:25:42 PST 2017


Hi Tim,

> You might want consider using the messaging framework we developed for InaSAFE. We used to use sphinx in the same way you do and struggled with it a) being very large to include in the plugin and b) requiring two separate translation workflows (Qt based and gettext based). The messaging package is currently bundled in InaSAFE here:
> 
> https://github.com/inasafe/inasafe/tree/develop/safe/messaging
> 
> But we could probably easily hive it of to its own pip package. The usage semantics allow for production of rich content which can be displaced in a web widget or exported to standalone pages. For example we produce http://manual.inasafe.org from the same code base we have in the plugin. Here is a simple example of how you use it to make a help page for a dialog:
> 
> https://github.com/inasafe/inasafe/blob/develop/safe/gui/tools/help/dock_help.py#L51
> 
> I would say the learning curve is not much higher than learning RsT and you have the advantage of your code and documentation all being managed in one place. I’d love to see this moved into QGIS core one day as I guess this is a really common requirement for plugin authors (and core devs…).

oh, this sounds really good. I will have a look and try to dive in it.

In the meanwhile I solved the issue not directly with sphinx but with a
script that moves the images folder, removes the other ones and with sed
-i I'm replacing the correct paths in the html files (thanks Tom for the
hint)

The ugly script is here (that's maybe my second time with bash so it's
reeeealy ugly):

https://github.com/ghtmtt/DataPlotly/blob/master/help/replace_script.sh


Before with 2 languages the zip was 20 MB now with 3 languages is 16 MB.
Each language weights around 3MB. I did not try to move also the _static
folder in the same way I did for the _images one.

I know it's not the cleanest solution but (for the moment but not
forever ;) ) the problem seems solved.

Thanks again

Matteo




More information about the QGIS-Developer mailing list