Template:Codeblock: Difference between revisions

From TF2 Classified Wiki
Jump to navigation Jump to search
NinjaV (talk | contribs)
mNo edit summary
NinjaV (talk | contribs)
m fixed width with src/lang
Line 4: Line 4:
<onlyinclude><!--
<onlyinclude><!--
         --><div style="max-width:{{{width|unset}}}; 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.52rem<!--lines-->; text-indent:0; white-space:pre-wrap; margin: {{{margin|.3em 0 .3em 0}}}"><!--
         --><div style="max-width:{{{width|unset}}}; 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.52rem<!--lines-->; text-indent:0; white-space:pre-wrap; margin: {{{margin|.3em 0 .3em 0}}}"><!--
             -->{{#if:{{{src|{{{lang|}}}}}}|<div style="max-width:{{{width|unset}}}; display:flex;justify-content:space-between;background-color:rgba(88, 58, 49, 1);
             -->{{#if:{{{src|{{{lang|}}}}}}|<div style="width=100%; display:flex;justify-content:space-between;background-color:rgba(88, 58, 49, 1);
border-bottom:1px solid rgba(164, 145, 126, 1); font-family:monospace,monospace; color: white; line-height:1.125rem<!--header-->; text-indent:0; white-space:pre-wrap; padding:.5em"><!--
border-bottom:1px solid rgba(164, 145, 126, 1); font-family:monospace,monospace; color: white; line-height:1.125rem<!--header-->; text-indent:0; white-space:pre-wrap; padding:.5em"><!--
--><!--
--><!--
Line 81: Line 81:
height=250px| <!--cannot be percentage-->
height=250px| <!--cannot be percentage-->
width=25%|
width=25%|
lang=txt|
<nowiki>A1
<nowiki>A1
B2
B2

Revision as of 23:21, 17 August 2025

See Also: Template:Code


Documentation

Just go to Valve Dev Community for their documentation, only difference is formatting (styling). Link: VDC Code Documentation

Examples

With header

tf2classic/scripts/items/items_game.txt (directory)
txt (file type)
(code) This is a test! "Beep Boop!" - Soldier ''no italics'' - - - '''no bold''' <nowiki> tag makes formatting no format for code stuff!

yes italics - - - yes bold

Codey code code

Without header

(code) Hello, world! I'm headerless :( ''"blah blah blah"''

With lines enabled + Locked Height/Width

Note:It is not fully aligned and may break with lots of lines. Fast scrolling also breaks alignment but will refix.

The source was not specified
txt
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
A1 B2 C3 D4 Start of Long Line ----------------- End of Long Line You can also leave gaps 9 10 11 12 13 14 15 16