diff --git a/manual.pdf b/manual.pdf index 6137004..5274b78 100644 Binary files a/manual.pdf and b/manual.pdf differ diff --git a/manual.typ b/manual.typ index 0cc7aec..f325654 100644 --- a/manual.typ +++ b/manual.typ @@ -1,7 +1,5 @@ #import "@preview/tidy:0.4.0" - #import "src/lib.typ" - #import "gallery/readme_banner.typ" as banner #set document( @@ -19,6 +17,25 @@ } } ) +#set heading(numbering: (..num) => if num.pos().len() < 4 { + numbering("1.1", ..num) +}) + +#let code-block(code) = { + let txt = code.text + txt = txt.replace("$version", str(lib.version)) + return box( + raw( + txt, + lang: code.lang, + block: true + ), + fill: luma(95%), + inset: 1em, + radius: 0.5em, + stroke: luma(80%) + 0.5pt + ) +} #align(center)[ #v(1cm) @@ -52,13 +69,33 @@ inset: 1em, outline( indent: 1em, - target: heading.where(level: 2) + depth: 2 ) ) +#pagebreak(weak: true) + += Introduction + +This package provides several common hashing algorithms and other related functions. All functions are directly available in the package's namespace (i.e. no need to import sub-modules). + +To use it, you can simply import the package as a whole:\ +#pad(left: 1em, code-block(```typ +#import "@preview/jumble:$version" +... +#jumble.md5(msg) +```)) +or import specific functions (or all):\ +#pad(left: 1em, code-block(```typ +#import "@preview/jumble:$version": md5 +... +#md5(msg) +```)) #pagebreak(weak: true) += Reference + #let mod = tidy.parse-module.with( scope: (jumble: lib), preamble: "#import jumble: *;" @@ -66,7 +103,7 @@ #let sha-doc = mod( read("src/sha.typ"), - name: "sha" + name: "SHA" ) #tidy.show-module(sha-doc) @@ -74,7 +111,7 @@ #let md-doc = mod( read("src/md.typ"), - name: "md" + name: "MD" ) #tidy.show-module(md-doc)