Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72762

Discussion About Dynamic .sthlp Stata Help files (similar to Doxygen or Roxygen)

$
0
0
Before I post this, I searched both "Roxygen" and "Doxygen" to see if anyone has mentioned the problem I am facing right now, but there was no luck. So here I open a discussion about a package I started writing a couple of hours ago. I assumed it would be nice to hear from Statalist folks if they have any input / suggestion / idea to make the package more general and useful.

Problem
=========
The package is trying to solve this problem: Generating dynamic Stata help files (.sthlp). My supervisor recently asked me to cooperate with him on a Stata package, which he has been working on himself. But as we all know, software documentation was invented to make programmers torture one another. Everyone expect others to do it well, but no one wishes to do it himself. When it comes to collaborative programming, it becomes rather more complex to comprehend what the developer has done, for maintenance purpose. Besides, I hate to update the help files manually anytime I add a new features. Wouldn't it be nicer if the documentation could be done within the script file, a classic literate programming approach?

Packages
=========
Yes, there are tons of literate programming packages out for Stata, but none generates Dynamic Help files, simply because no one likes to mess up with SMCL language.

Solution
=========
Long story short, we need a package for Dynamic Stata Help File (.sthlp) generator. By "We", I literally mean my supervisor and myself, because I really don't want to spend days making sense of undocumented codes. So I came up with the idea to develop a package "real quick", so that we also "Test It" in a real life cooperative example. I started a bit ago and have a clean idea how the package should look like. If you have anything to add / discuss / suggest, please do.

As I'm developing this at the moment, I assumed some of you might have ideas to make it better. So I can explain what I am programming and I hope to get some feedback / ideas...
  1. The package can process one Stata script file, do, ado, or mata at a time
  2. The package adds a simple template Header to script files. The header defines:
    1. version
    2. Introductory Description of the package, which is usually the first paragraph in Stata help files, i.e. packageName -- a module for ...
    3. Authors(s) section
  3. It recognizes Markdown syntax and can convert it to SMCL. So it's going to be a package that does not require the user to master SMCL language
  4. It automatically reads the syntax of the Stata program and generate the brief section of the syntax (only for ado-files and haven't given it a try yet. but I think it's not difficult to program)
  5. The package defines syntax similar to MarkDoc for adding text description. So text paragraphs begin with "/***" sign to separate text that meant to be included in the help file from other comments.
  6. It supports both {smcl} and {asis} modes. But mostly SMCL mode.
  7. That's where I am right not....

Viewing all articles
Browse latest Browse all 72762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>