diff options
| author | Maurizio M. Gavioli <mmg@vistamaresoft.com> | 2024-04-14 17:18:08 +0200 |
|---|---|---|
| committer | Maurizio M. Gavioli <mmg@vistamaresoft.com> | 2024-04-14 17:18:08 +0200 |
| commit | a0cff82320840e4be6d40cee8a2432645773a53e (patch) | |
| tree | dbb5b972d03b14f636ef0aa120da8075ee906fc0 /core/sys/info | |
| parent | 21969fec612b78d34f14b60ad761a3c37860b36b (diff) | |
Fix the format of some `doc.odin` files of the `core` library which did not made into the documentation.
`c/frontend/tokenizer`:
add proper "Example:" header to demo example code,
removed empty lines.
`container/bit_array`:
moved comment before package;
aligned narrative lines to left margin;
converted case lines into bulleted lines ("- ");
converted individual examples to single-tab-indented preformatted text.
`dynlib`:
removed "//+build ignore" line;
added newline at EOF.
`image/netpmb`:
converted indented lines of "Reading", "Wrting" and "Some syntax..." into bulleted lists;
"Formats" indented lines kept as they are as the preformatted text seems relevant to keep the alignments;
doubly indented lines kept as single-indented to keep them different (as the format does not allow for two-level bulleted lists);
removed empy lines.
`os/os2`: WIP, not modified
`sys/info`:
removed "//+build ignore" line;
converted tab-indented initial description into regular left-margin comment;
moved uncommented sample code within the doc comment as an "Example:";
moved simple- and double-tabbed separate comments with sample Windows and macOS outputs within the doc comment as bulleted headlines with preformatted output listings;
removed now empty comments and blank lines after the package line.
`text/i18n`:
removed "//+build ignore" line;
moved the pacakge line at the end;
de-indented the tab-indented introductory narrative;
moved sample code comments into the doc comment as tab-indented code with a proper "Example:" heading;
removed "```" MD attempts at code formatting.
`text/table`:
unindented the comment lines of a descriptive kind;
headlines of major subdivisions are marked as bold;
kept code samples as tab-indented preformatted text (as there are several of them, the standard "Example:" and "Output:" headings cannot be used) removing the "```" MD attempts at code formatting;
removed in-between blank lines.
Diffstat (limited to 'core/sys/info')
| -rw-r--r-- | core/sys/info/doc.odin | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/core/sys/info/doc.odin b/core/sys/info/doc.odin index 81c3fb342..15af0d4b3 100644 --- a/core/sys/info/doc.odin +++ b/core/sys/info/doc.odin @@ -1,78 +1,78 @@ /* - Copyright 2022 Jeroen van Rijn <nom@duclavier.com>. - Made available under Odin's BSD-3 license. +Copyright 2022 Jeroen van Rijn <nom@duclavier.com>. +Made available under Odin's BSD-3 license. - Package `core:sys/info` gathers system information on: - Windows, Linux, macOS, FreeBSD & OpenBSD. +Package `core:sys/info` gathers system information on: +Windows, Linux, macOS, FreeBSD & OpenBSD. - Simply import the package and you'll have access to the OS version, RAM amount - and CPU information. +Simply import the package and you'll have access to the OS version, RAM amount +and CPU information. - On Windows, GPUs will also be enumerated using the registry. +On Windows, GPUs will also be enumerated using the registry. - CPU feature flags can be tested against `cpu_features`, where applicable, e.g. - `if .aes in si.aes { ... }` -*/ -//+build ignore -package sysinfo +CPU feature flags can be tested against `cpu_features`, where applicable, e.g. +`if .aes in si.aes { ... }` + +Example: + + import "core:fmt" + import si "core:sys/info" -import "core:fmt" -import si "core:sys/info" + main :: proc() { + fmt.printf("Odin: %v\n", ODIN_VERSION) + fmt.printf("OS: %v\n", si.os_version.as_string) + fmt.printf("OS: %#v\n", si.os_version) + fmt.printf("CPU: %v\n", si.cpu_name) + fmt.printf("RAM: %v MiB\n", si.ram.total_ram / 1024 / 1024) -main :: proc() { - fmt.printf("Odin: %v\n", ODIN_VERSION) - fmt.printf("OS: %v\n", si.os_version.as_string) - fmt.printf("OS: %#v\n", si.os_version) - fmt.printf("CPU: %v\n", si.cpu_name) - fmt.printf("RAM: %v MiB\n", si.ram.total_ram / 1024 / 1024) + fmt.println() + for gpu, i in si.gpus { + fmt.printf("GPU #%v:\n", i) + fmt.printf("\tVendor: %v\n", gpu.vendor_name) + fmt.printf("\tModel: %v\n", gpu.model_name) + fmt.printf("\tVRAM: %v MiB\n", gpu.total_ram / 1024 / 1024) + } + } - fmt.println() - for gpu, i in si.gpus { - fmt.printf("GPU #%v:\n", i) - fmt.printf("\tVendor: %v\n", gpu.vendor_name) - fmt.printf("\tModel: %v\n", gpu.model_name) - fmt.printf("\tVRAM: %v MiB\n", gpu.total_ram / 1024 / 1024) +- Example Windows output: + + Odin: dev-2022-09 + OS: Windows 10 Professional (version: 20H2), build: 19042.1466 + OS: OS_Version{ + platform = "Windows", + major = 10, + minor = 0, + patch = 0, + build = [ + 19042, + 1466, + ], + version = "20H2", + as_string = "Windows 10 Professional (version: 20H2), build: 19042.1466", } -} + CPU: AMD Ryzen 7 1800X Eight-Core Processor + RAM: 65469 MiB + GPU #0: + Vendor: Advanced Micro Devices, Inc. + Model: Radeon RX Vega + VRAM: 8176 MiB -/* - Example Windows output: - Odin: dev-2022-09 - OS: Windows 10 Professional (version: 20H2), build: 19042.1466 - OS: OS_Version{ - platform = "Windows", - major = 10, - minor = 0, +- Example macOS output: + + ODIN: dev-2022-09 + OS: OS_Version{ + platform = "MacOS", + major = 21, + minor = 5, patch = 0, build = [ - 19042, - 1466, + 0, + 0, ], - version = "20H2", - as_string = "Windows 10 Professional (version: 20H2), build: 19042.1466", - } - CPU: AMD Ryzen 7 1800X Eight-Core Processor - RAM: 65469 MiB - - GPU #0: - Vendor: Advanced Micro Devices, Inc. - Model: Radeon RX Vega - VRAM: 8176 MiB - - Example macOS output: - ODIN: dev-2022-09 - OS: OS_Version{ - platform = "MacOS", - major = 21, - minor = 5, - patch = 0, - build = [ - 0, - 0, - ], - version = "21F79", - as_string = "macOS Monterey 12.4 (build 21F79, kernel 21.5.0)", - } - CPU: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz - RAM: 8192 MiB + version = "21F79", + as_string = "macOS Monterey 12.4 (build 21F79, kernel 21.5.0)", + } + CPU: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz + RAM: 8192 MiB */ +package sysinfo |