2. Perform authoring activities
To create an XML template for your article or tutorial, expand developerWorks Author Package and double-click new-article for the article template, or new-tutorial for the tutorial template. Use .vbs files for the Microsoft® Windows® platform and .sh for UNIX®-based operating systems.
Figure 10. Template creation dialog
Replace my-article or my-tutorial with the title of your article or tutorial.
To see the folder created for your article or tutorial, right-click on the developerWorks Author Package and select Refresh from the context menu. Otherwise, simply press F5 while selecting developerWorks Author Package.
Figure 11. Refresh to see the template folder
Figure 12. The template folder appears after refreshment
This activity is the playground for your creativity as an author. Fortunately, IBM Rational Web Developer provides some useful features to let you focus on the content itself rather than how to write it. I list some of these features here:
- Different XML editors
- Source formatting
- Finding and replacing
- Comparing and replacing from local history
- Team development
- Importing illustrations
- Source outlining
- Source code assistant
For more details on using each of these features, refer to "Useful features of IBM Rational Web Developer."
As you make modifications to the template, you need to verify that you made no XML mistakes. The first line of defense is the XML Source Page editor automatic validation, which underlines any incorrect tag and marks the line that contains it.
Figure 13. A highlighted error
If you miss this indication, you can simply right-click on the template file in the Navigator view and select Validate XML File or Run Validation.
Figure 14. Run validation
If the file has any invalid tags, the error message in Figure 15 displays.
Figure 15. Error message
Furthermore, the Problems view displays a list of the errors found in the file. If you click any item on the list, the editor shows the line of code that has the error.
Figure 16. Problems listing
To preview your work, transform the XML file into HTML using the Extensible Stylesheet Language (XSL) stylesheet provided with the author package. To do so, right-click on index.xml in the Navigator view and select Run > XSL Transformation.
Figure 17. Transform XML to HTML using built-in XSLT
As a result of this transformation, an _index_transform.html file is created under the same folder with index.xml. Double-click that HTML file to open it in the default system browser or editor. Otherwise, you can browse it in the built-in Web browser: Right-click on the HTML file, then select Open With > Web Browser.
Figure 18. Preview your work
The built-in browser can help you avoid the security warnings you might get if you use the browser on your system, without having to change either of the two. If you're working off-line, the previewed page is slightly different from the final look, because it references resources on developerWorks' Web server. However, this shouldn't affect your work.
Figure 19. The page looks slightly different when displayed off-line
The developerWorks team needs the XML file, any illustrations, and any sample code that you refer to in your article or tutorial. Select index.xml, as well as any other images that you refer to, then right-click and select Export from the context menu.
Figure 20. Exporting files
Select Zip file and click Next.
Figure 21. Export dialog
Verify the selected files, specify the name of the zip file, and click Finish.
Figure 22. Export to a zip file