All of the scripts and code snippets are in freely downloadable public repositories on GitHub. To read further, and to get the GitHub repository links, click these tabs.



JavaScript

These are JavaScript code for HTML files in online help documents.

If the final output of your online help files is HTML, you can include these code snippets in your HTML transforms. The files use the jQuery and the jQuery UI libraries, and are implemented through the class attribute of HTML elements. Therefore, the code will work on any HTML or DITA element that takes a class attribute.

The following effects are ready for your use:

  • For getting rid of copy-paste, use content referencing in HTML
  • For progressive disclosure, show or hide blocks of content on demand
  • For usability, show the content of a footnote on hover rather than on click (though click is retained as an option)
  • For consumability, display the sections on a page in horizontal tabs instead of vertical sections

See JavaScript for online help files. The entire repository is downloadable as a .zip file. Each JavaScript effect has its own modular set and can, therefore, be used separately or together.


Python

These are scripts to make the everyday life of a technical writer a wee bit easier.

  • Word list scanner: A script that reports the occurrences of a list of words and phrases in DITA topic files in a directory
  • Orphan files scanner: A script that reports the files that are not called by the DITA files in a directory
  • Extra links scanner: A script that reports links that occur more than once in DITA topic files in a directory

To run these scripts, you need Python 2.7.5. Download and install Python from www.python.org. You need Python only to run the script; you don't need to know Python to run the scripts.

Word list scan

The script scans all DITA files in a directory, recursively, for occurrences of an entire list of words and phrases that you specify.

Usage scenario

You want to scan all files in a directory for several words, all at once. Maybe these words are a list of do-not-use words that your style guide specifies, but you don't have an automated word checker to look for such occurences. Maybe you want to know if you've used certain DITA tags in your files but do not want to run a system search for each tag, one by one. This script searches for multiple words at one go, and also phrases and DITA tags. You specify a list of words and phrases, and tell the script which directory it should scan. The script runs the checks and gives you a report that you can read and act upon.

Download and installation

See word-list-scan.

Orphan files scan

The script scans all files in a directory, recursively, and reports the files that are not called by any DITA file in the directory.

Usage scenario

You have several image files, topic files, and other files in the directory but hesitate to delete them because you are not sure if any of these files are referenced by the DITA files in that directory. You tell the script which directory it should scan. The script runs the checks and gives you a report that you can read and act upon to clean up your workspace.

Download and installation

See orphan-scan.


Infographics

Sometimes, a diagram is the best way to convey information. Complicated task flows, for example, or large data sets often make more sense if presented visually.

Sometimes, the inbuilt functions of Microsoft Excel and OpenOfficeCalc are sufficient for drawing charts ( ). At other times, data needs to be processed first before it can be fed into a spreadsheet ( ). At still other times, data needs be run through a script ( ). At all of these times, the data becomes more appealing and understandable when presented as an image. See Turn data into stories.

The data-processing scripts (and the data source files) are in this GitHub repository: Visualisations repo.


Fun projects

Playing with words and images

  • Picture puzzles: A drag-and-drop picture puzzle game. Photos, mine; javascript code, borrowed.
  • The Mahabharat project: ...under construction...
  • Vedic gods and their adversaries: The gods and non-gods, condensed from the thousands of words of the Rig Veda into one not-too-lengthy web page. Because, that's what technical communicators do.

© Anindita Basu