GNOME Bugzilla – Bug 735930
[PATCH] Support for UMLet (and other formats) using a configurable image converter script
Last modified: 2018-07-30 10:30:21 UTC
Created attachment 285204 [details] [review] proposed implementation Summary ------- The following patch adds a new command for include images which are converted using a configurable shell script. Motivation ---------- I wanted to add support for UMLet diagrams in a similar way as it was done for Dia diagrams. UMLet is a free, open-source UML tool with a simple user interface: - http://www.umlet.com - https://code.google.com/p/umlet/ While studying the various diffs in the Git repository, I came up with a new idea: Why not generalize the image conversion process and let a (user supplied) script do the work? This will have the following advantages: 1. Adding new formats will be much easier in the future 2. Let's the user add support for formats without general interest (or proprietary/inhouse tools) 3. The user may tweak the parameters, add special processing (e.g. watermarking) The disadvantage is that a little script must be supplied by the user. Proposed implementation ----------------------- Add a new command \\extimagefile with a syntax mix of \\image and \\diafile: \\extimage <file> ["caption" [<sizeindication>=<size>]] Since this command may be used for different formats, the <file> must contain the extension. Processing: 1. Doxygen searches the input image file similar as other files (new configuration option EXTIMAGEFILE_DIRS) 2. Depending on the output format Doxygen invokes the configured script (configuration EXTIMAGE_CONVERTER) passing absolute paths of input and output file. 3. The script determines the input and output format depending on the file extension. Being pragmatic this would suffice in most cases. If one will use the same extension for different input formats, the script may use file magic (see file command)… 4. The script convert the file and write the output file 5. Doxygen writes the other output (e.g. <img> tag for html output) Configuration ------------- - EXTIMAGE_CONVERTER Configure executable and optional arguments. At least on windows platform the script mostly must be invoked by it's interpreter. Example: EXTIMAGE_CONVERTER = "bash" ".\image_converter.sh" Example script skeletons are provided in the manual. - EXTIMAGEFILE_DIRS Similar to other *_DIRS configuration. - EXTIMAGE_MAPPING Output format mapping: Define the output format depending on the input file extension. This mapping is applied only for HTML at the moment (defaults to png if not configured). Other formats will use the following formats: RTF: png LaTeX: eps/pdf depending on the configuration USE_PDFLATEX DocBook: png
Created attachment 285205 [details] Showcase for \\extimagefile command Demonstration for the new feature. Note: You'll have to tweak the hard coded paths in the scripts matching your installation.
Tests done ---------- - Platform: Only windows using Visual Studio 2013 compiler (converted and tweaked solution file). - Scripts: Cygwin bash and Windows PowerShell - Input formats: UMLet (12.2) and Dia portable (0.97.2) Output formats: - HTML (viewed in Firefox 31.0 and IE 11) - RTF (viewed in MS Word) - LaTeX (TeX Live), booth latex and pdflatex: - For images files containing space in the file name I had to add the grffile package so it works at least for pdflatex. - DocBook: Only inspected the generated XML and png files - XML output: Inspected the generated XML file.
As discussed in https://github.com/doxygen/doxygen/pull/734 , Doxygen has moved its issue tracking to https://github.com/doxygen/doxygen/issues All Doxygen tickets in GNOME Bugzilla have been migrated to Github. You can subscribe and participate in the new ticket in Github. You can find the corresponding Github ticket by searching for its Bugzilla ID (number) in Github. Hence I am closing this GNOME Bugzilla ticket. Please use the corresponding ticket in Github instead. Thanks a lot!