![]() | ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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/QDoc 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/extension 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/Extension 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 Macro/Extension CommandsVisual Studio (versions up to VS2010) provides a powerful built-in Visual Basic Macro system that provides excellent access to many of the internal functions of the IDE. All versions allow users to write add-ins or extensions that allow them to extend the functionality of the IDE.These macros, or commands exposed from addins/extensions, 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. (Please note: As of Visual Studio 2012, macros are no longer supported by Visual Studio, so this mechanism is unfortunately only available for use in 2005, 2008 and 2010. In 2012 it is necessary to write an extension that provides the command) To enable this processing, you will need to first create a macro/extension command to be executed. Below is the processing code needed to get you started. To install this code as a macro (VS 2005, 2008, 2010), do the following:
In Visual Studio versions form 2012 onwards, it will be necessary to write your code into a Command within an extension, and install the extension within your copy of Visual Studio. If you now select an entire legacy comment in a form that this macro/extension 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/extension command for you. Edit the Preprocessing Rules (in the Atomineer preferences, go to the 'Doc Advanced' tab 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/extension command 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/extension command - the mechanism that must be used involves selecting the comment (causing flickery redraws) and executing the macro/extension command can slow down comment processing quite significantly. |
Copyright © 1996-2023 Atomineer. All Rights Reserved. Any trademarks reproduced in this text are the property of their respective owners - Contact us - Company Info |