Blog

Article Tags

Hua Feature Completion

By William Jeffrey Rankin, Sat Apr 6 2024

With the inclusion of paging for tagged-with-* files (revision 140), Hua is now feature complete. There's still work to do: for example, I want to simplify some of the code and I'm very interested in how well Hua performs with a large number of articles. But, for now, the tool does everything I want it to do while retaining the flexibility and simplicity I envisioned from the beginning.

Related Articles

    Article Tags

    Hua Paging Support

    By William Jeffrey Rankin, Tue Mar 26 2024

    Revision 99 of Hua supports paging. The number of entries appearing on the index page(s) is controlled using the entries_pp variable in the config file. Index file(s) are named using the index_file config variable, as before. Pages following the first are named *-2.html, *-3.html, etc.

    I'm considering implementing this for the tagged-with files as well.

    Related Articles

        Article Tags

        Hua Meta-information Support

        By William Jeffrey Rankin, Sun Feb 11 2024

        As of revision 63, released on Feb 10, 2024, Hua (my PowerShell-based static content generator) supports meta-information (description, keywords, and author) for individual articles. Meta information is maintained in a separate delimited file. Meta-info isn't required (but is certainly desirable) and Hua will provide defaults (the 000000 record in the meta database) if an individual article isn't represented in the file.

        Initially, I considered simply using article tags for keywords. But I believe keywords to be finer-grained than tags and should therefore be separated. There will be, no doubt, some common entries in both lists.

        Related Articles

            Article Tags

            Generating Running Statistics

            By William Jeffrey Rankin, Tue Jan 30 2024

            About

            For the past several years, I've been recording my running data in a simple spreadsheet. Previously, I'd used services like Dailymile (now long defunct) and Strava (which moved many of its features to the premium version). Wanting to do something useful with the data, I wrote a set of scripts to answer the following questions:

            • For a given month or year, what do my running stats look like? For example, total number of runs, distance, time, as well as average time per run, distance, pace, etc.
            • What does the distance profile look like for the period, i.e., how many short runs? medium-length runs? long runs?
            • Were there any notable events (e.g., poor weather, injury, etc.)
            • How many miles do I have on my current shoes?
            • What's my best time for a particular route?

            The data look like this:

            22-Jan-24,Rest day
            23-Jan-24,Run,River Road,32.38,Saucony Cohesion TR15,3,Icy!
            24-Jan-24,Run,River Road,58.53,Saucony Cohesion TR15,6
            25-Jan-24,Run,River Road,38.83,Saucony Cohesion TR15,4
            

            With fields consisting of:

            date, activity, route title, time, shoes, distance, notes
            

            The scripts were written in the Rexx programming language. Initially, I was only going to prototype using that language, but I was so pleased with some of its text formatting capabilities that I stuck with it.

            Usage & Sample Output

            The script produces a report that includes basic statistics, distance profile, and notes. In the example below, a report is generated for January 2024 based upon data in data.csv. To output data for the entire year, pass - rather than a three-letter month name.

            jeffr@CALLISTO: D:\Documents\wo-data $ regina .\rs.rex .\data.csv 24 Jan
            
            ----------------------------Running Statistics-----------------------------
            
            Total entries:  31
            Total runs:     22
            Total time:     14.33 hours
            Avg. time:      39.09 minutes
            Total distance: 87 miles
            Avg. distance:  3.95 miles
            Avg. pace:      9.89 minutes per mile
            Min. distance:  3 miles
            Max. distance:  6 miles
            
            -----------------------------Distance Profile------------------------------
            
            <3
            3 to <6  *****************19
            6 to <9  **3
            9 to <12
            12+
            
            -----------------------------------Notes-----------------------------------
            
            02-Jan-24: First run of 2024!
            06-Jan-24: Snow run.
            19-Jan-24: Snow run.
            23-Jan-24: Icy!
            

            eq.rex outputs the number of miles on a pair of shoes:

            jeffr@CALLISTO: D:\Documents\wo-data $ regina .\eq.rex .\data.csv saucony cohesion tr15
            
            saucony cohesion tr15: 75 miles
            

            bt.rex shows the best time for a given route (in this case, route is a combination of route title and distance):

            jeffr@CALLISTO: D:\Documents\wo-data $ regina .\bt.rex .\data.csv 6 River Road
            
            17-Oct-21, Time: 48.00, 8.00 minutes per mile
            

            gd.rex outputs planned runned data (an empty dataset) so you aren't required to key in a new month manually. Route title, shoes, and rest day are configurable.

            jeffr@CALLISTO: D:\Documents\wo-data $ regina .\gd.rex 24 Feb 29
            01-Feb-24,Run (planned),River Road,,Saucony Cohesion TR15,
            02-Feb-24,Run (planned),River Road,,Saucony Cohesion TR15,
            03-Feb-24,Run (planned),River Road,,Saucony Cohesion TR15,
            ...
            

            Download

            wo-data.zip, 11K

            Future Plans

            • Elevation gain
            • Standard deviation for time period (may require moving the scripts to PowerShell or Python)
            • HTML/Markdown output

                Article Tags

                Hua Enhancements

                By William Jeffrey Rankin, Tue Dec 26 2023

                I've made some enhancements to Hua, my PowerShell based static content generator, over the past few days. Formerly, all tagged-with-* files, as well as index and archive files were regenerated every time Hua was run. Now, Hua runs a comparison to determine if the files have actually changed, and replaces them accordingly. In this way, files that haven't really changed are not reuploaded to a remote server by tools that rely simply on date as change criteria (among other use cases).

                Related Articles

                    Next Page