Writing an online help file, a user manual, an eBook or any other format handled by HelpNDoc is usually lengthy ongoing and non-linear process. Oftentimes, as the content evolves, the overall topic hierarchy can become sub-optimal and a re-organization is required in order to make the documentation easier to read and navigate. Even though HelpNDoc provides tools to easily re-organize the table of contents, in some cases the process can be lengthy and error-prone, such as when an alphabetical sorting of topics is required. Thankfully, HelpNDoc includes scripts to automatically re-order topics by title. Let’s see how rapidly and easily this can be done.

Run the topic sorting script

Not only does HelpNDoc include powerful scripting capabilities, it also comes bundled with useful script sources such as the “SortAllTopics” and “SortChildTopics” scripts which are able to automatically sort topics by title.

Topics sorting script

Once you’ve added some topics to your documentation and perhaps organized them, HelpNDoc’s scripting capabilities come in handy to help automate the topic sorting task:

  1. From HelpNDoc’s “Tools” ribbon tab, click “Script Editor”
  2. From the script editor window, click the arrow next to the “Load script” button
  3. Click “SortAllTopics.hnd.pas” to load the topic sorting script
  4. Click “Run script”… and voilà! The whole table of contents is sorted by title

That was easy enough. But what if you only need to sort some topics, and not all of them ? Simply select one topic in the table of contents, load and run the “SortChildTopics.hnd.pas” script as explained above, and all its children will be sorted alphabetically.

Custom sorting and special requirements

Script editor

Sorting topics by title isn’t always useful and some projects might need automated sorting of topics based on some other attributes, such as the topics’ help identifiers. For those special requirements, the bundled scripts can serve as a starting point and can easily be customized using HelpNDoc’s powerful and extensive API.

From its straightforward user interface to its advanced scripting capabilities, HelpNDoc provides all the tools needed to produce amazing help files, product manuals, eBooks… as rapidly and easily as possible. And the best part is that HelpNDoc is completely free for personal use and evaluation purposes. Try it now, and enjoy documenting!

See also...

HelpNDoc's character analyzer illustration [illustration] [Featured]
Tech Writers' Secret Weapon: The Unique Advantages of Using HelpNDoc's Characters Analyzer

HelpNDoc has been a go-to solution for professionals seeking to create high-quality, engaging, and user-friendly documentation. However, it’s not just its user-friendly interface or its versatile …

Read More →
Happy technical writer using HelpNDoc [happy] [Featured]
Making the Most of HelpNDoc: How the "Keep Temporary Files" Feature Can Benefit Technical Writers

When working on technical documentation, every tool and feature at our disposal can make a big difference in productivity and efficiency. One such feature in HelpNDoc, often underutilized, is the …

Read More →
Converting Legacy WinHelp HLP to Modern Documentation [converting] [Featured]
Revitalize Your Help Files: Converting Legacy WinHelp HLP to Modern Documentation with HelpNDoc

In an age where information is consumed on a plethora of devices and platforms, the classic WinHelp HLP files — once the standard in Windows-based help documentation — are now relics of a bygone era. …

Read More →
HelpNDoc vs WordPress [versus] [Featured]
Mastering Multi-Channel Publishing: Why HelpNDoc Leaves WordPress in the Dust

In today’s interconnected digital world, the concept of multi-channel publishing has become more critical than ever. As audiences seek information through various platforms and formats, content …

Read More →

Categories: articles