diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dfbde7c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +docs/build diff --git a/docs/example.lisp b/docs/example.lisp new file mode 100644 index 0000000..e303615 --- /dev/null +++ b/docs/example.lisp @@ -0,0 +1,13 @@ +* (let ((stream (flexi-streams:make-in-memory-output-stream))) + (binary:write-u32 stream 1024) + (binary:write-u32 stream 1024 :endian :big) + (format t "Stream contents: ~A~%" + (flexi-streams:get-output-stream-sequence stream))) +#(0 4 0 0 0 0 4 0) +NIL +* (let ((stream (flexi-streams:make-in-memory-input-stream #(0 4 0 0 0 0 4 0)))) + (format t "Read ~A~%" (binary:read-u32 stream)) + (format t "Read ~A~%" (binary:read-u32 stream :endian :big))) +Read 1024 +Read 1024 +NIL diff --git a/docs/manifest.lisp b/docs/manifest.lisp new file mode 100644 index 0000000..93c5c21 --- /dev/null +++ b/docs/manifest.lisp @@ -0,0 +1,7 @@ +(:docstring-markup-format :scriba + :systems (:binary) + :documents ((:title "Binary" + :authors ("Kyle Isom") + :output-format (:type :multi-html + :template :minima) + :sources ("manual.scr")))) \ No newline at end of file diff --git a/docs/manual.scr b/docs/manual.scr new file mode 100644 index 0000000..3d28cc3 --- /dev/null +++ b/docs/manual.scr @@ -0,0 +1,72 @@ +@begin(section) +@title(Index) + +@b(binary) contains functions for reading and writing integers from +binary streams + +@begin(deflist) + +@term(Source) +@begin(def) + +The source code may be obtained from +@link[uri="https://github.com/kisom/binary/"](Github). + +@end(def) + +@term(Setup and Usage) +@begin(def) + +@b(binary) requires +@link[uri="https://quicklisp.org/"](Quicklisp). The repository should +be cloned into the @c(local-projects) directory under the Quicklisp +home. + +To use @b(kutils), either add it to the @c(:depends-on) section of +your project's @c(.asd), or @c(ql:quickload :kutils). + +@end(def) + +@term(License) +@begin(def) + +@b(binary) is released under the +@link[uri="https://raw.githubusercontent.com/kisom/binary/master/LICENSE"](MIT) +license. + +@end(def) +@end(deflist) +@end(section) + +@begin(section) +@title(Overview) + +The @b(binary) package was written to parse and serialise certain +network messages while working on implementing a client library for a +certain protocol in Common Lisp. + +@code(@include[path=example.lisp]()) +@end(section) + +@begin(section) +@title(API Reference) + +@cl:with-package[name="binary"]( +@cl:doc(function read-U8) +@cl:doc(function read-U16) +@cl:doc(function read-U32) +@cl:doc(function read-U64) +@cl:doc(function read-I8) +@cl:doc(function read-I16) +@cl:doc(function read-I32) +@cl:doc(function read-I64) +@cl:doc(function write-U8) +@cl:doc(function write-U16) +@cl:doc(function write-U32) +@cl:doc(function write-U64) +@cl:doc(function write-I8) +@cl:doc(function write-I16) +@cl:doc(function write-I32) +@cl:doc(function write-I64)) + +@end(section)