Blog

Article Tags

Hua Article Mode

By William Jeffrey Rankin, Thu Sep 26 2024

As of revision 165, Hua has an article mode that enables processing of an individual article. This is useful in instances where an article is in development and requires review. In this mode only the specified article is generated; index, archive, and tagged-with files are not touched. Since only one article is processed, this mode is significantly faster as well.

Article Mode Usage & Performance (this blog)

jeffr@CALLISTO: D:\Documents\wjr-blog $ Measure-Command { ..\Hua\hua.ps1 .\hua.cfg -A '00100' | Out-Default }

...
Seconds           : 0
Milliseconds      : 375
...

Normal Mode Usage & Performance (this blog)

jeffr@CALLISTO: D:\Documents\wjr-blog $ Measure-Command { ..\Hua\hua.ps1 .\hua.cfg | Out-Default }

...
Seconds           : 3
Milliseconds      : 27
...

Related Articles

    Article Tags

    Hua Error Status Codes

    By William Jeffrey Rankin, Thu Sep 19 2024

    As of revision 157 (released Sep 18, 2024) Hua outputs specific codes based upon error condition. Normally, if all goes well, Hua exits with a status of 0. But when an error condition results, Hua outputs a message and, depending upon the severity of the error, either continues processing content or stops entirely. When the latter occurs, a non-zero exit status is generated. It can be output as seen in the examples below.

    PowerShell Session

    jeffr@CALLISTO: D:\Documents\wjr-blog $ ..\Hua\hua.ps1 .\wrong.cfg
    Config file error. Config file path specified as .\wrong.cfg . Quitting.
    jeffr@CALLISTO: D:\Documents\wjr-blog $ $LASTEXITCODE
    2
    

    Bash Session

    jeffr@Phobos: ~/Hua $ pwsh ./hua.ps1 hua.cfg 
    Meta info file error. Meta file path set as .\met.csv. Quitting.
    jeffr@Phobos: ~/Hua $ echo $?
    9
    

    This is useful in instances where Hua is invoked from a script or as part of a toolchain and exit status needs to be introspected. For more information, refer to the Errors section of the main Hua page.

    Related Articles

        Article Tags

        Hua Paging Labels

        By William Jeffrey Rankin, Thu July 4 2024

        Hua now supports custom labels for paging. Labels are specified in the Hua configuration file:

        next_label = Next Page
        prev_label = Previous Page
        

        Note: Spaces in labels are represented by  .

        Related Articles

            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

                    Newer Articles Older Articles