![]() |
Atomineer Documentation Preprocessing & Conversion RulesIf you have existing documentation comments in a format that Atomineer can parse, you can configure Atomineer to read it and convert it to your new Atomineer style. This page describes several methods that can be used to facilitate comment conversions into the configured Atomineer format:
Details of all these options are given below. |
Custom <Conversion> RulesIn addition, Rules.xml contains a special section, <Conversions>, which tells Atomineer how to convert the entries it finds when converting legacy comments. This can:
Note that at this time, the primary conversion process that is supported is Doxygen/JavaDoc/Qt to DocXML, simply because there has so far been no demand to convert DocXML the other way. However, basic conversions are already in place to convert from DocXml if required. Please email support@atomineerutils.com if you encounter any markup that is not converted well, and where possible we will try to upgrade Atomineer to support your conversion needs. (Also, the macro preprocessing approach described later on this page may help you to handle your conversion needs for yourself) To convert between Doc Comment styles/formats, you may do any of the following:
If an 'incorrect' entry is converted (such as a param or exception entry that describes a parameter or exception that is not present in the code), the entry will be converted correctly, but then added at the bottom of the new comment with '###' prepended ('deleted' entry), just as would happen if you removed that param/exception and updated an existing comment. If unwanted, just execute the DocComment command a second time to clean away these 'deleted' entries. Note that if the old comment format diverges too far from what Atomineer expects (such as using Doxygen aliases or custom Documentation XML elements not mentioned in the Conversions rules), the conversion may not work so well - you may need to 'tidy up' the comment (manually or perhaps using a Macro preprocessing script - see below) before applying the Atomineer conversion. For example, the following Doxygen/JavaDoc comment uses the alternate format described by the prefs XML above, with JavaDoc-style entries: /** * @brief This is the brief description * @returns true if it feels like it * @param exampleParam An example parameter. * @date 15/04/2010 * @author Jason */ ...and it is converted to the following Documentation XML (in this case, using the default Atomineer format, with the entries rearranged in the order dictated by the default template): //////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> This is the brief description. </summary> /// <author> Jason. </author> /// <date> 15/04/2010. </date> /// /// <remarks> Jason Williams, 16/04/2010. </remarks> /// /// <param name="exampleParam"> An example parameter. </param> /// /// <returns> true if it feels like it. </returns> //////////////////////////////////////////////////////////////////////////////////////////////////// Note that the author and date are recognised tags and thus preserved in the resulting comment - but if these are not set as 'legal' entries in your templates, they can be removed by simply executing ths DocComment command a second time to update the new comment. (Note also that the 'remarks' was not supplied, so a new auto-generated entry is added that records the author/date of the conversion). However, as you can see, Atomineer does the bulk of the conversion work for you. |
Preprocessing MacrosVisual Studio provides a powerful built-in Visual Basic Macro system that provides excellent access to many of the internal functions of the IDE. These can be used to pre-process legacy documentation comments to convert them into a format that Atomineer can parse. Atomineer can then apply its formatting and layout rules to complete the task of converting the comments to the new format.To enable this processing, you will need to first create a macro to be executed. Below is one to get you started. To install the macro, do the following:
If you now select an entire legacy comment in a form that this macro can process, such as this: /*********************************************************** * Usage: Open the datafile for reading * * Return Value: true if the file was opened successfully * * Notes: * Preconditions: * The filename must have been set in Init() ***********************************************************/ ...and turn it into this: /*********************************************************** * \brief Open the datafile for reading * * \returns true if the file was opened successfully * * \remarks * Preconditions: * The filename must have been set in Init() ***********************************************************/ This is now in a form Atomineer can parse and convert to whatever form you have configured. If this does not match your block format, you will need to set up an Alternate format (see the top of this page) so that Atomineer can recognise this partially-converted comment. In this example, set the preference options to: <Alt-Separator value="/***********************************************************" /> <Alt-LineHeader value=" * " /> <Alt-SeparatorB value="***********************************************************/" /> You should now be able to convert the preprocessed comment by executing Add Doc Comment on the method. The last step is to tell Atomineer to execute the preprocessing macro for you. Edit the Preprocessing Rules (in the Atomineer preferences, go to Advanced Customisation and click the Preprocessing button) and uncomment the example entry: <ConvertComment macro="Macros.Atomineer.Custom.ConvertExistingComment"/> Now, when you execute Add Doc Comment, Atomineer should detect the legacy comment, select the entire comment block, execute your macro code to preprocess it, and then parse and update it to finish the conversion process. It is recommended that when you have finished converting legacy comments, you disable the Preprocessing Rule so that Atomineer no longer tries to execute your macro - the mechanism that must be used involves selecting the comment (so it flickers terribly) and executing the macro slows down comment processing a bit. |
| Copyright © 1996-2012 Atomineer. All Rights Reserved. Contact us |