Template:HexRow: Difference between revisions
Jump to navigation
Jump to search
(typo ^^) |
m (the "Chess position" template was deleted from WP; "Chess diagram" has replaced it, but I assume the syntax is different) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 84: | Line 84: | ||
|} | |} | ||
There are 66 "actual" arguments; they are ''not'' named, but they line up intuitively. | There are 66 "actual" arguments; they are ''not'' named, but they line up intuitively. | ||
:(the extra | at the end of a line is part of a hack | :(the extra | at the end of a line is part of a hack) | ||
*The first argument is the data's offset (default is 0x00, maybe it should be blank). | *The first argument is the data's offset (default is 0x00, maybe it should be blank). | ||
*The next 16 arguments are the 16 hex bytes. | *The next 16 arguments are the 16 hex bytes. | ||
Line 99: | Line 99: | ||
The rest (cell spacing/padding, border, alignment on page, background color, etc) is set at table level. | The rest (cell spacing/padding, border, alignment on page, background color, etc) is set at table level. | ||
</noinclude> | </noinclude><noinclude> | ||
[[Category:Table templates]]</noinclude> |
Latest revision as of 21:21, 27 March 2020
Here's an all-ASCII alternative to GIF/PNG snapshots of hex data.
Editable by anyone, "right there", in parallel with related documentation.
Either embedded in the article using it, or in a subpage of the article.
- (in that case, transcluded and made directly editable via a header)
- (but if one wants to keep the doc in sync, it's not such a good idea)
- Usage
The following input :
{|border=1 cellspacing=0 {{HexRow|0x00| |01|51|02|00|01|00|00|06|AD|DE|AD|DE|AD|DE|AD|DE| |FF|FF|FF|FF|FF|FF|FF|FF|00|00|00|00|00|00|00|00| |00|00|00|00|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF| |00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00| |Who needs this?°}} {{HexRow|0x10| |AD|DE|AD|DE|AD|DE|AD|DE|AD|DE|AD|DE|AD|DE|AD|DE| |00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00| |FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF| |00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00| }} |}
produces the following output :
0x00: | 01 | 51 | 02 | 00 | 01 | 00 | 00 | 06 | AD | DE | AD | DE | AD | DE | AD | DE | Who needs this?° |
0x10: | AD | DE | AD | DE | AD | DE | AD | DE | AD | DE | AD | DE | AD | DE | AD | DE | °°°°°°°°°°°°°°°° |
There are 66 "actual" arguments; they are not named, but they line up intuitively.
- (the extra | at the end of a line is part of a hack)
- The first argument is the data's offset (default is 0x00, maybe it should be blank).
- The next 16 arguments are the 16 hex bytes.
- Then you have the RGB components of every byte's background :
- 16 "red" bytes
- 16 "green" bytes
- 16 "blue" bytes
- Finally, you can add an ASCII translation if you so wish.
- Most of the time it's actually irrelevant
- I'd systematically show nonsensical ASCII as ° : it's less distractive.
- If all 16 chars are nonsense, simply omit the last argument (the default value is °°°°°°°°°°°°°°°°)
- Same for confirmed garbage in the hex fields : you can fill it with °.
Only the fixed-size font is specified in this template, as well as bold for offset and ASCII.
The rest (cell spacing/padding, border, alignment on page, background color, etc) is set at table level.