ADDED build/update-wiki Index: build/update-wiki ================================================================== --- /dev/null +++ build/update-wiki @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +set -e + +cd "$(dirname "${BASH_SOURCE[0]}")/.." + +tclNanoVersion=0.1 +tclNanoReleaseDate='09-Jul-2018' +wikiPageManual='Manual' + +manPage="$(groff -mandoc -Thtml nano.man | sed -r 's@]*|)>@@g;//,/<\/head>/ d' | sed "s/@@VERS@@/${tclNanoVersion}/g;s/@@SHORT_DATE@@/${tclNanoRelaseDate}/g" | sed 's/\[/\[/g;s/\]/\]/' | tail -n +5)" + +oldManPage="$(fossil wiki export "${wikiPageManual}" 2>/dev/null)" || oldManPage='' + +if [ "${oldManPage}" != "${manPage}" ]; then + echo "${manPage}" | fossil wiki commit --mimetype text/x-fossil-wiki "${wikiPageManual}" || \ + echo "${manPage}" | fossil wiki create --mimetype text/x-fossil-wiki "${wikiPageManual}" +fi + +exit 0 Index: nano.man ================================================================== --- nano.man +++ nano.man @@ -21,10 +21,18 @@ If the optional .B -json argument is used and specified as true the result is a JSON representation, otherwise a Tcl dict representation is used. .. +.de RR +The +.I representation +portion of the command name may be one of +.B dict +or +.BR json . +.. .PU .TH NANO N "@@SHORT_DATE@@" "nano @@VERS@@" .SH NAME nano \- Tcl bindings for Nano .SH SYNOPSIS @@ -417,10 +425,11 @@ .BI ::nano::block:: representation ::toBlock .I blockRepresentation .RI " -> " blockData Converts from one of the internal representations (either Tcl dictionary or JSON) to a Nano block. +.RR .TP .B ::nano::block::json::fromDict .I blockDict .RI " -> " blockJSON @@ -442,10 +451,11 @@ .XI ? -signKey= privateKey ? .RI " -> " blockRepresentation Parses a Nano block and returns either a Tcl dictionary or a JSON object. .XN +.RR .TP .BI ::nano::block:: representation ::sign .I blockRepresentation .I privateKey @@ -459,10 +469,11 @@ option is used, return the object with the updated attribute. If the .B -signature option is used, return just the signature. .HB +.RR .TP .BI ::nano::block:: representation ::verifySignature .I blockRepresentation .RI " -> " boolean @@ -472,10 +483,11 @@ .B account attribute of that object. This may not work correctly for old-style blocks unless you manually add the .B account attribute. +.RR .TP .BI ::nano::block:: representation ::work .I blockRepresentation .RB ? -update | -work " ?" -hex | binary ?? @@ -492,10 +504,11 @@ option is used, return the object with the updated attribute. If the .B -work option is used, just return the work. .HB +.RR .TP .BI ::nano::block:: representation ::validateWork .I blockRepresentation .RI " -> " boolean @@ -503,10 +516,11 @@ Validate the proof-of-work (PoW) in the object specified as .I blockRepresentation with the attribute .B work is valid for the block passed in. +.RR .TP .B ::nano::block::hash .I blockData .RB ? -hex | -binary ? @@ -873,11 +887,10 @@ puts "Generated seed: $seed" for {set index 0} {$index < 10} {incr index} { set accountPrivateKey [::nano::key::fromSeed $seed $index -hex] set accountAddress [::nano::address::fromPrivateKey $accountPrivateKey] - puts " - $index: $accountAddress" } .EE .SS Example 2