Template:Codeblock: Difference between revisions
Jump to navigation
Jump to search
just bare with this for a bit, im checking some stuff out for a custom weapon tutorial |
reformatted! looks acceptable now. examples! |
||
| Line 2: | Line 2: | ||
<onlyinclude><!-- | <onlyinclude><!-- | ||
--><div style="overflow:hidden;background-color:{{#switch:{{{style|}}}|1=rgba( | --><div style="overflow:hidden;background-color:{{#switch:{{{style|}}}|1=rgba(241, 233, 203, 1)|rgba(241, 233, 203, 1)}};{{#switch:{{{style|}}}|1=border:1px solid rgba(48,48,48,1);|}}border-radius:4px; font-family:monospace,monospace; color: black; line-height:1.5rem<!--lines-->; text-indent:0; white-space:pre-wrap; margin: {{{margin|.3em 0 .3em 0}}}"><!-- | ||
-->{{#if:{{{src|{{{lang|}}}}}}|<div style="display:flex;justify-content:space-between;background-color:rgba( | -->{{#if:{{{src|{{{lang|}}}}}}|<div style="display:flex;justify-content:space-between;background-color:rgba(88, 58, 49, 1); border-bottom:1px solid rgba(0,255,0,.1); font-family:monospace,monospace; color: white; line-height:1.125rem<!--header-->; text-indent:0; white-space:pre-wrap; padding:.5em"><!-- | ||
--><!-- | --><!-- | ||
--><div>{{{src|The source was not specified}}}</div><!-- | --><div>{{{src|The source was not specified}}}</div><!-- | ||
| Line 11: | Line 11: | ||
--><!-- | --><!-- | ||
--><div style="width:100%"><!-- | --><div style="width:100%"><!-- | ||
--><div style="scrollbar-color:# | --><div style="scrollbar-color:#f1e9cb #583a31; position:relative;width:100%;display:flex;max-height:{{{height|unset}}};overflow:auto"><!-- | ||
-->{{#if:{{{lines|}}}|<div style="z-index:1;display:flex;position:sticky;left:0;height:100%;padding:.5em | -->{{#if:{{{lines|}}}|<div style="z-index:1;display:flex;position:sticky;left:0;height:100%;padding:.45em .5em;color: white;background-color:{{#switch:{{{style|}}}|1=rgb(0,0,255)|rgb(0, 255, 0)}};border-right:1px solid rgb(48,48,48)"><!-- | ||
--><ol start="{{{start|1}}}" style="text-align:right;pointer-events:none;white-space:nowrap;list-style-position:inside;margin-left:8px;margin-top:0;user-select:none;margin-right:-10px;text-indent:0"><!-- | --><ol start="{{{start|1}}}" style="text-align:right;pointer-events:none;white-space:nowrap;list-style-position:inside;margin-left:8px;margin-top:0;user-select:none;margin-right:-10px;text-indent:0"><!-- | ||
-->{{padright:|{{#expr:5 * {{{lines}}}}}|<li> }}{{#ifexpr:{{{lines}}} > 100<!-- | -->{{padright:|{{#expr:5 * {{{lines}}}}}|<li> }}{{#ifexpr:{{{lines}}} > 100<!-- | ||
| Line 23: | Line 23: | ||
--></div>}}<!-- | --></div>}}<!-- | ||
--><!-- | --><!-- | ||
--><div style="width:100%;text-indent:0;line-height:1. | --><div style="width:100%;text-indent:0;line-height:1.6rem<!--code-->;white-space:{{#if:{{{softwrap|}}}|pre-wrap|pre}};height:100%;tab-size:4;"><!-- | ||
-->{{#if:{{{lightamount1|{{{lightstart1|}}}}}}|<div style="position:sticky;z-index:0"><!-- | -->{{#if:{{{lightamount1|{{{lightstart1|}}}}}}|<div style="position:sticky;z-index:0"><!-- | ||
--><div style="width:100%;background:rgba(255,128,0,0.1);margin-top:calc((1.6em * ({{{lightstart1|1}}} - 1)) + .45em);margin-bottom:.45em;height:calc(1.6em * {{{lightamount1|1}}});position:absolute;left:0;user-select:none;pointer-events:none"><!-- | --><div style="width:100%;background:rgba(255,128,0,0.1);margin-top:calc((1.6em * ({{{lightstart1|1}}} - 1)) + .45em);margin-bottom:.45em;height:calc(1.6em * {{{lightamount1|1}}});position:absolute;left:0;user-select:none;pointer-events:none"><!-- | ||
| Line 45: | Line 45: | ||
</includeonly> | </includeonly> | ||
== Examples == | |||
with header | |||
{{codeblock| | |||
lang=txt (file type)| | |||
src=tf2classic/scripts/items/items_game.txt (directory)| | |||
<nowiki>(code) | |||
This is a test! | |||
"Beep Boop!" - Soldier | |||
''no italics'' - - - '''no bold''' | |||
<nowiki> tag makes formatting no format for code stuff! </nowiki> | |||
''yes italics'' - - - '''yes bold''' | |||
Codey code code | |||
}} | |||
without header | |||
{{codeblock| | |||
<nowiki>(code) | |||
Hello, world! | |||
I'm headerless :( | |||
''"blah blah blah"'' | |||
</nowiki> | |||
}} | |||
The line code is partially broke and isnt aligned fully | |||
{{codeblock| | |||
lines=16| <!--amount of number lines--> | |||
height=100px <!--height of it, if list is longer, scroll appears. Ignore to make it fully expand--> | |||
|<nowiki>A1 | |||
B2 | |||
C3 | |||
D4 | |||
E5 | |||
F6 | |||
G7 | |||
H8 | |||
I9 | |||
J10 | |||
K11 | |||
L12 | |||
M13 | |||
N14 | |||
O15 | |||
P16</nowiki>}} | |||
Revision as of 22:28, 16 August 2025
Examples
with header
without header
The line code is partially broke and isnt aligned fully