HVML / PurC

The prime HVML interpreter for C Language.
GNU Lesser General Public License v3.0
1.05k stars 54 forks source link

add Han decimal numbers as comment #48

Closed tiansiyuan closed 1 year ago

VincentWei commented 1 year ago

For a better manner using HVML, if you want to change the style according to something like the current system language, you can use the following code:

<hvml target="html" lang="$STR.substr($SYS.locale, 0, 2)" silently >
    <head>                                                                      
        <base href=$CRTN.base(! "file://$SYS.cwd" ) hvml:silently />            
        <link rel="stylesheet" type="text/css" href="hvml/assets/fibonacci-html-temp-{$STR.substr($SYS.locale, 0, 2)}.css" />
        ...                        
    </head>
...
</hvml>

Then in the CSS file Source/Samples/hvml/assets/fibonacci-html-temp-zh.css, define the style sheet for the element:

ol {
    list-style-type:cjk-decimal;
}

Do not forget the change the file CMakefiile.txt under Source/Samples/hvml to add the new asset file.

VincentWei commented 1 year ago

Many thanks!