Template:HexRow: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (oops)
m (another try)
Line 1: Line 1:
<includeonly>|-style="font-family:courier"
<includeonly>|-style="font-family:courier"
!{{{0|0x00}}}
!{{{1|0x00}}}
|BGCOLOR="#{{{17|FF}}}{{{33|FF}}}{{{49|FF}}}"|{{{1|00}}}
|BGCOLOR="#{{{18|FF}}}{{{34|FF}}}{{{50|FF}}}"|{{{2|00}}}
|BGCOLOR="#{{{18|FF}}}{{{34|FF}}}{{{50|FF}}}"|{{{2|00}}}
|BGCOLOR="#{{{19|FF}}}{{{35|FF}}}{{{51|FF}}}"|{{{3|00}}}
|BGCOLOR="#{{{19|FF}}}{{{35|FF}}}{{{51|FF}}}"|{{{3|00}}}
Line 17: Line 16:
|BGCOLOR="#{{{31|FF}}}{{{47|FF}}}{{{63|FF}}}"|{{{15|00}}}
|BGCOLOR="#{{{31|FF}}}{{{47|FF}}}{{{63|FF}}}"|{{{15|00}}}
|BGCOLOR="#{{{32|FF}}}{{{48|FF}}}{{{64|FF}}}"|{{{16|00}}}
|BGCOLOR="#{{{32|FF}}}{{{48|FF}}}{{{64|FF}}}"|{{{16|00}}}
!{{{65|°°°°°°°°°°°°°°°°}}}</includeonly><noinclude>
|BGCOLOR="#{{{33|FF}}}{{{49|FF}}}{{{65|FF}}}"|{{{17|00}}}
!{{{66|°°°°°°°°°°°°°°°°}}}</includeonly><noinclude>
Here's an all-ASCII alternative to GIF/PNG snapshots of hex data.
Here's an all-ASCII alternative to GIF/PNG snapshots of hex data.


Line 83: Line 83:
!°°°°°°°°°°°°°°°°
!°°°°°°°°°°°°°°°°
|}
|}
There are 65 arguments; they are ''not'' named, but they line up intuitively.
There are 66 arguments; they are ''not'' named, but they line up intuitively.
*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.

Revision as of 15:34, 17 November 2006

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 arguments; they are not named, but they line up intuitively.

  • 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 all non-printable chars as °.
    • If all 16 chars are non-printable, leave the last argument blank (the default value is °°°°°°°°°°°°°°°°)

Only the fixed-size font is specified in this template, as well as bold for offset for offset and ASCII.

The rest (cell spacing/padding, border, alignment on page, background color, etc) is set at table level.