Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FWIW you can get code-formatting by prefixing lines with a 4-space indent:

    parse_dns_header(raw_packet) ->
      <<
          ID:16,
          QR:1, OPCODE:4, AA:1, TC:1, RD:1, RA:1, Z:3, RCODE:4,
          QDCOUNT:16,
          ANCOUNT:16,
          NSCOUNT:16, ARCOUNT:16,
          Tail/binary
      >> = raw_packet,
Also for readers, this does depend on customisable (per-segment/field) defaults: `ID:16` is a shorthand for `ID:16/big-unsigned-integer-unit:1` aka "16-bits wide segment parsed as an unsigned integer in big endian"


> FWIW you can get code-formatting by prefixing lines with a 4-space indent

ah thank you ! that is very good to know.

will it be possible to have some formatting guidelines / examples on the site somewhere ? similar to what we see on reddit ?


> will it be possible to have some formatting guidelines / examples on the site somewhere ?

https://news.ycombinator.com/formatdoc

Sadly HN has jack shit formatting-wise (the most annoying part being you can't escape asterisks so half the time it's going to emphasise a comment section and remove your asterisks despite that not being what you wanted)


> Sadly HN has jack shit formatting-wise

it is 'spartan' :)


I'd be fine with spartan (only support for code blocks) or more featureful (escapes at least), but as things are it's less spartan and more annoyingly half-assed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: