# Generate a Markdown Template for your Post

Your task is simple: Write a program (or function) that takes no input and outputs something like this:

## *name*, *length* bytes
*code*


Where *name* is the name of the language you are using, *length* is the number of bytes in your code, and *code* is your program's source code. If *code* contains multiple lines, it have four spaces before each line.

Here's a 124-byte example implementation in Python 3:

s = "## Python 3, 124 bytes{2}    s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
print(s.format(s,chr(34),chr(10)))


The output is:

## Python 3, 124 bytes
s = "## Python 3, 124 bytes{2}    s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
print(s.format(s,chr(34),chr(10)))


Which in Markdown is:

## Python 3, 124 bytes

s = "## Python 3, 124 bytes{2}    s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
print(s.format(s,chr(34),chr(10)))


This is , so the shortest answer (in bytes) wins.

• I'm pretty sure this is a dup, but can't find the old one...
Nov 6 '16 at 22:14
• Related Nov 6 '16 at 22:20
• I'd say this is different enough from that one because it's generating one for itself. The idea is similar, but you need to write a quine for this one. Nov 6 '16 at 22:23
• Should we assume standard quine rules (e.g. no opening your own code and reading it)? Nov 6 '16 at 22:32
• @GabrielBenamy Yes. Nov 6 '16 at 22:49

# RProgN 2, 28 Bytes

«"  %s"F"#RProgN 2, 28 Bytes"

• As is, this isn't a serious contender and subject to deletion. Please golf your answer. Jul 5 '17 at 17:32
• @Dennis Golfed. Jul 5 '17 at 20:56
• Nice! The dot after the byte count doesn't seem to be required, but there should be four spaces (or a tab) before the code. Jul 5 '17 at 21:09

(#Underload, 48 bytes
)(~:S(    ):S*aSaS(:^)S):^

• Post is exactly as produced by the code. The quine is payload-capable (place the payload after the final S), thus making it a true quine by one widely-used definition, but uses a string eval (that said, string eval is the only way to do a loop in Underload; it's fairly fundamental to the language).
– user62131
Nov 12 '16 at 12:35
• After a discussion in Underload quines in chat, we decided this is also a quine by the other widely-used definitions too; the :^ at the end of the program is encoded by the :^ a little earlier, and thus one part of the program encodes a different part.
– user62131
Dec 2 '16 at 23:23
• You can discuss in Underload quines? (Cool!:aSS)Cool!:aSS Jun 21 '17 at 21:23
• @CalculatorFeline Unfortunately, that doesn't work because of the (!). Nov 28 '17 at 3:30

## Python 2, 58 bytes

_='## Python 2, 58 bytes\n    _=%r;print _%%_';print _%_

• The contents of this post are exactly as printed by the code. Nov 8 '16 at 13:00

## reticular, 58 bytes

"'34'c: 4*91+c:s:e:t:y:b: 85: :,:r:a:l:u:c:i:t:e:r: :#dqO;


Try it online!

Explanation: :c pushes the single-char string c. This builds the string "## reticular, 58 bytes", backwards character by character, reverses the stack, and Outputs everything, including the string captured by the initial quote.

## CJam, 33 bytes

{"## CJam, 33 bytes"N@S4*\"_~"}_~


Stack trace (N represents \n)

{"## CJam, 33 bytes"N@S4*\"_~"}
{"## CJam, 33 bytes"N@S4*\"_~"} {"## CJam, 33 bytes"N@S4*\"_~"}
{"## CJam, 33 bytes"N@S4*\"_~"} "## CJam, 33 bytes"
{"## CJam, 33 bytes"N@S4*\"_~"} "## CJam, 33 bytes" N
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"}
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"} " "
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"} " " 4
"## CJam, 33 bytes" N {"## CJam, 33 bytes"N@S4*\"_~"} "    "
"## CJam, 33 bytes" N "    " {"## CJam, 33 bytes"N@S4*\"_~"}
"## CJam, 33 bytes" N "    " {"## CJam, 33 bytes"N@S4*\"_~"} "_~"
<implicit output>


# V, 25 bytes

ñi#V, 25 bytes<esc>o´ Ñ<esc>~"qpx


(This is not counted in the generated markdown, because I like providing explanations for my code :P)

Here is a hexdump, since the source code contains unprintable/non-ASCII characters:

00000000: f169 2356 2c20 3235 2062 7974 6573 1b6f  .i#V, 25 bytes.o
00000010: b420 d11b 7e22 7170 78                   . ..~"qpx


This answer is just a trivial modification of the standard extensible V quine.

Explanation:

ñ                                   " Run the following code one time, storing it in
" register 'q'
i                                  "   Enter insert mode
#V, 25 bytes<esc>                 "   And insert the header
o                "   Open up a newline, and enter insert mode again
´ Ñ             "   Enter four spaces, then a 'Ñ' character.
"   (The reason we insert it uppercase, is because
"   lowercase would end the loop now)
~       "   Toggle the case of the char under the cursor ('Ñ')
"qp    "   Paste the contents of register 'q' (this is the
"   same as the entire program minus the initial 'ñ',
"   followed by a 'ÿ' character because V is weird)
x   "   Delete the last character (the ÿ)


# JS, 504927 30 bytes

f=_=>#JS, 30 bytes\n    f=+f


## Try It

f=_=>#JS, 30 bytes\n    f=+f
console.log(f())