From c7d3b0217e248194e333fd3b6ac177e2c920ef69 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Fri, 16 Sep 2022 14:11:41 +0200 Subject: [PATCH] Improve template (axes footer) --- HOWTO.adoc | 3 -- doc/classes/ItemStack.adoc | 2 - include/footer.adoc | 4 -- templates/standard.adoc | 108 +++++++++---------------------------- 4 files changed, 25 insertions(+), 92 deletions(-) delete mode 100644 include/footer.adoc diff --git a/HOWTO.adoc b/HOWTO.adoc index f8bea59..a1a5bef 100644 --- a/HOWTO.adoc +++ b/HOWTO.adoc @@ -44,7 +44,6 @@ local emin, emax = vm:read_from_map(p1, p2) -- Emerged minimum and maximum posit The use of Admonitions (`NOTE`, `TIP`, `IMPORTANT`, `CAUTION`, and `WARNING`) are useful for bringing the reader's attention to a specific idea or statement. The use of these should generally follow these situation guidelines: - NOTE: This information is noteworthy. You will find it insightful to understand something. TIP: This information is helpful. You will have an easier time doing something if you follow this. @@ -158,5 +157,3 @@ All types should link somewhere at some point (cross-reference or outside). * `another_property:` `type` ** A description. ---- - -include::include/footer.adoc[] diff --git a/doc/classes/ItemStack.adoc b/doc/classes/ItemStack.adoc index e22a753..9c8304f 100644 --- a/doc/classes/ItemStack.adoc +++ b/doc/classes/ItemStack.adoc @@ -459,5 +459,3 @@ local taken = stack:peek_item(item) |=== | `taken` | `ItemStack` | The item(s) copied from the stack. |=== - -include::../../include/footer.adoc[] diff --git a/include/footer.adoc b/include/footer.adoc deleted file mode 100644 index 5a291d6..0000000 --- a/include/footer.adoc +++ /dev/null @@ -1,4 +0,0 @@ - -''' - -Made with https://asciidoctor.org/[AsciiDoctor] | Contribute on {url-docs-repo}[GitHub] diff --git a/templates/standard.adoc b/templates/standard.adoc index 9ebbf8b..c72bac4 100644 --- a/templates/standard.adoc +++ b/templates/standard.adoc @@ -8,23 +8,19 @@ This is the standard template of how a good AsciiDoc should be structured. This paragraph describes the purpose of the document. In this example, an imaginary API for a vehicle will be documented. -== Vehicle Properties - -* `Vehicle.make`: `{type-string}` -* `Vehicle.model`: `{type-string}` -* `Vehicle.year`: `{type-number}` -* `Vehicle.trim`: `{type-string}` -* `Vehicle.color`: `ColorSpec` +== Properties +[%autowidth, frame=none] +|=== +| `make` | `{type-string}` | ... +| `model` | `{type-string}` | ... +| `year` | `{type-number}` | ... +| `trim` | `{type-string}` | ... +| `color` | `ColorSpec` | ... +|=== -== Vehicle Methods -=== Vehicle.new +=== `Vehicle.new(pos, properties)` Spawns a new instance of a `Vehicle` at a given position and returns the new object. -==== Usage ----- -vehicle = Vehicle.new(pos, properties) ----- - ==== Arguments [%autowidth, frame=none] |=== @@ -42,7 +38,7 @@ vehicle = Vehicle.new(pos, properties) ==== [source,lua] ---- -local minivan = vehicle.new(vector.new(35, 2, 36), { +local minivan = Vehicle.new(vector.new(35, 2, 36), { make = "Toyota", model = "Previa", year = 1992, @@ -52,13 +48,10 @@ local minivan = vehicle.new(vector.new(35, 2, 36), { ---- ==== -=== Vehicle:set_properties -Sets the properties of the vehicle. +== Methods -==== Usage ----- -vehicle:set_properties(properties) ----- +=== `:set_properties(properties)` +Sets the properties of the vehicle. ==== Arguments [%autowidth, frame=none] @@ -66,65 +59,34 @@ vehicle:set_properties(properties) | `properties` | `{type-table}` | A list of <>. |=== -==== Returns -_None_ - -=== Vehicle:set_properties +=== `:get_properties()` Gets the properties of the vehicle. -==== Usage ----- -vehicle:get_properties() ----- - -==== Arguments -_None_ - ==== Returns [%autowidth, frame=none] |=== | `properties` | `{type-table}` | A list of <>. |=== -=== Vehicle:set_pos +=== `:set_pos(pos)` Instantly moves the vehicle to the given position. -==== Usage ----- -vehicle:set_pos(pos) ----- - ==== Arguments [%autowidth, frame=none] |=== | `pos` | `{class-vector}` | The position to move the vehicle to. |=== -==== Returns -_None_ - -=== Vehicle:get_pos +=== `:get_pos()` Gets the current position of the vehicle. -==== Usage ----- -vehicle:get_pos() ----- - -==== Arguments -_None_ - ==== Returns [%autowidth, frame=none] |=== | `pos` | `{class-vector}` | The current position of the vehicle. |=== -=== Vehicle:set_gear -==== Usage ----- -success = vehicle:set_gear(gear) ----- +=== `:set_gear(gear)` ==== Arguments [%autowidth, frame=none] @@ -142,24 +104,16 @@ success = vehicle:set_gear(gear) | `success` | `{type-bool}` | Whether placement was successful. |=== -=== Vehicle:get_gear +=== `:get_gear()` Returns the current gear of the vehicle as a number. See <> for expected values. -==== Usage ----- -gear = vehicle:get_gear() ----- - -==== Arguments -_None_ - ==== Returns [%autowidth, frame=none] |=== | `gear` | `{type-number}` | Gear the vehicle is currently in. |=== -=== Vehicle:some_function +=== `:some_method(...)` Does a thing. NOTE: This is a note. @@ -169,19 +123,19 @@ NOTE: This is a note. 1:: + ---- -stuff = Vehicle:some_function(foo) +stuff = vehicle:some_method(foo) ---- 2:: + ---- -different, things = Vehicle:some_function(foo, bar) +different, things = vehicle:some_method(foo, bar) ---- ==== Arguments [%autowidth, frame=none] |=== | `foo` | `{class-vector}` | Something. -| `bar`? | `{class-vector}` | Something else. +| `bar` | `{class-vector}` | Optional. Something else. |=== ==== Returns @@ -203,14 +157,9 @@ different, things = Vehicle:some_function(foo, bar) == Vehicle Helpers -=== gear_to_name +=== `gear_to_name(gear)` Returns the name of the given gear. -==== Usage ----- -name = gear_to_name(gear) ----- - ==== Arguments [%autowidth, frame=none] |=== @@ -231,14 +180,9 @@ a! `3` a! `third` !=== |=== -=== vehicle_type +=== `vehicle_type(make, model)` Determines the vehicle type based on the make and model. -==== Usage ----- -vtype = vehicle_type(make, model) ----- - ==== Arguments [%autowidth, frame=none] |=== @@ -270,5 +214,3 @@ end ---- ==== - -include::../include/footer.adoc[]