로그인하고 있지 않습니다. 편집하면 당신의 IP 주소가 공개적으로 기록됩니다. 계정을 만들고 로그인하면 편집 시 사용자 이름만 보이며, 위키 이용에 여러 가지 편의가 주어집니다.스팸 방지 검사입니다. 이것을 입력하지 마세요!=== 코드 입력(syntaxhighlight) === [[C (프로그래밍 언어)|C]]나 [[파이썬]]처럼 [[프로그래밍 언어]]의 코드를 보여줄 때에는 div, pre나 code 태그 등을 사용하여 설명할 수 있습니다. 하지만 syntaxhighlight를 사용하면 에디터처럼 자동으로 구문에 강조나 색이 입혀집니다. 총 사용방법은 <code><nowiki><syntaxhighlight lang="{언어}" line="(line)" start="시작번호" highlight="줄번호" (inline)>코드</syntaxhighlight></nowiki></code>입니다. 편집기상에서 키보드로 직접 탭 문자(<code> </code>)를 입력할 수는 없어, 대신 띄어쓰기(스페이스 바) 4개를 입력하거나 이를 복사해 붙여넣어야 합니다. ; 언어 : 코드에 맞는 언어의 이름을 입력합니다. 지원하는 언어는 아래의 표와 같습니다. : {| class="wikitable" |- ! 입력 ! 결과 ! 설명 |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="c"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight></pre> | <syntaxhighlight lang="c"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight> | rowspan="2" | C(위)와 파이썬(아래)의 Hello, world! 코드 비교. |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="python"> print("Hello, world!") </syntaxhighlight></pre> | <syntaxhighlight lang="python"> print("Hello, world!") </syntaxhighlight> |- |} : {| class="wikitable collapsible collapsed" style="width: 100%; font-size: 85%; margin: auto;" ! 지원 언어 목록 (출처: [[mw:Extension:SyntaxHighlight#Supported languages|지원 언어]]) |- | <div style="text-align: center">위키 마크업도 사용하실 수 있습니다. 아직 정식 지원은 안됩니다. 정식 지원이 될때까지 <big>html+handlebars</big>를 이용하시면 됩니다.<ref>Pygments does not yet provide a "wikitext" or "mediawiki" lexer (phab:T29828). Use "html+handlebars" or "moin" instead.</ref></div> <div style="font-weight: bold; margin: auto;">프로그래밍 언어</div> {{세로목록|열너비=15em|목록= * ActionScript * Ada * Agda (literate 포함) * Alloy * AMPL * ANTLR * APL * AppleScript * Assembly (여러 종류) * Asymptote * Augeas * AutoIt * Awk * BBC Basic * Befunge * BlitzBasic * Boa * Boo * Boogie * BrainFuck * C, C++ (아두이노 같은 변형 포함) * C# * Chapel * Charm++ CI * Cirru * Clay * Clean * Clojure * CoffeeScript * ColdFusion * Common Lisp * Component Pascal * Coq * Croc (MiniD) * Cryptol (Literate Cryptol 포함) * Crystal * Cypher * Cython * D * Dart * DCPU-16 * Delphi * Dylan (console 포함) * Eiffel * Elm * Emacs Lisp * Email * Erlang (shell sessions 포함) * Ezhil * Factor * Fancy * Fantom * Fennel * FloScript * Forth * Fortran * FreeFEM++ * F# * GAP * Gherkin (Cucumber) * GLSL shaders * Golo * Gosu * Groovy * Haskell (Literate Haskell 포함) * HLSL * HSpec * Hy * IDL * Idris (Literate Idris 포함) * Igor Pro * Io * Jags * Java * JavaScript * Jasmin * Jcl * Julia * Kotlin * Lasso (templating 포함) * Limbo * LiveScript * Logtalk * Logos * Lua * Mathematica * Matlab * Modelica * Modula-2 * Monkey * Monte * MoonScript * Mosel * MuPad * NASM * Nemerle * NesC * NewLISP * Nimrod * Nit * Notmuch * NuSMV * Objective-C * Objective-J * Octave * OCaml * Opa * OpenCOBOL * ParaSail * Pawn * PHP * Perl 5 * Pike * Pony * PovRay * PostScript * PowerShell * Praat * Prolog * Python (console sessions과 tracebacks 포함) * QBasic * Racket * Raku a.k.a. Perl 6 * REBOL * Red * Redcode * Rexx * Ride * Ruby (irb sessions 포함) * Rust * S, S-Plus, R * Scala * Scdoc * Scheme * Scilab * SGF * Shell scripts (Bash, Tcsh, Fish) * Shen * Silver * Slash * Slurm * Smalltalk * SNOBOL * Snowball * Solidity * SourcePawn * Stan * Standard ML * Stata * Swift * Swig * SuperCollider * Tcl * Tera Term language * TypeScript * TypoScript * USD * Unicon * Urbiscript * Vala * VBScript * Verilog, SystemVerilog * VHDL * Visual Basic.NET * Visual FoxPro * Whiley * Xtend * XQuery * Zeek * Zephir * Zig }} |- | <div style="font-weight: bold; margin: auto;">템플릿 언어</div> {{세로목록|열너비=15em|목록= * Angular templates * Cheetah templates * ColdFusion * Django / Jinja templates * ERB (Ruby templating) * Evoque * Genshi (the Trac template language) * Handlebars</translate> * JSP (Java Server Pages) * Liquid * Myghty (the HTML::Mason based framework) * Mako (the Myghty successor) * Slim * Smarty templates (PHP templating) * Tea * Twig }} |- | <div style="font-weight: bold; margin: auto;">기타 마크업</div> {{세로목록|열너비=15em|목록= * Apache config files * Apache Pig * BBCode * CapDL * Cap'n Proto * CMake * Csound scores * CSS * Debian control files * Diff files * Dockerfiles * DTD * EBNF * E-mail headers * Extempore * Flatline * Gettext catalogs * Gnuplot script * Groff markup * Hexdumps * HTML * HTTP sessions * IDL * Inform * INI-style config files * IRC logs (irssi style) * Isabelle * JSGF notation * JSON, JSON-LD * Lean theorem prover * Lighttpd config files * Linux kernel log (dmesg) * LLVM assembly * LSL scripts * Makefiles * MoinMoin/Trac Wiki markup * MQL * MySQL * NCAR command language * Nginx config files * Nix language * NSIS scripts * Notmuch * POV-Ray scenes * Puppet * QML * Ragel * Redcode * ReST * Roboconf * Robot Framework * RPM spec files * Rql * RSL * Scdoc * SPARQL * SQL, also MySQL, SQLite * Squid configuration * TADS 3 * Terraform * TeX * Thrift * TOML * Treetop grammars * USD (Universal Scene Description) * Varnish configs * VGL * Vim Script * WDiff * Windows batch files * XML * XSLT * YAML * Windows Registry files }} |- |} ; 줄(line) : <code>line="line"</code>을 넣으면 코드 왼쪽에 줄 번호가 추가됩니다. : {| class="wikitable" |- ! 입력 ! 결과 |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="c" line="line"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight></pre> | <syntaxhighlight lang="c" line="line"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight> |- |} ; 시작 번호 : 첫 번째 줄의 번호를 설정합니다. ('줄(line)'을 설정해야 함) : {| class="wikitable" |- ! 입력 ! 결과 |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="c" line="line" start="100"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight></pre> | <syntaxhighlight lang="c" line="line" start="100"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight> |- |} ; 줄 강조 : 강조하고 싶은 줄 번호를 입력하면, 해당 줄이 다른 색으로 강조됩니다. : {| class="wikitable" |- ! 입력 ! 결과 ! 설명 |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="c" line="line" highlight="2"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight></pre> | <syntaxhighlight lang="c" line="line" highlight="2"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight> | |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="c" line="line" highlight="2,4"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight></pre> | <syntaxhighlight lang="c" line="line" highlight="2,4"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight> | 떨어져 있는 줄들을 강조할 때에는 반점(,)을 사용합니다. |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="c" line="line" highlight="3-6"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight></pre> | <syntaxhighlight lang="c" line="line" highlight="3-6"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight> | 연속된 줄들을 강조할 때에는 붙임표(-)를 사용합니다. |- |} ; 인라인(inline) : <code>inline</code>을 넣으면, code 태그를 사용한 것처럼 한 문장 안에 코드를 넣을 수 있습니다. : {| class="wikitable" |- ! 입력 ! 결과 |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;">앞말 앞말 <syntaxhighlight lang="c" inline>return 0;</syntaxhighlight>뒷말 뒷말</pre> | 앞말 앞말 <syntaxhighlight lang="c" inline>return 0;</syntaxhighlight>뒷말 뒷말 |} ; 클래스(class)와 스타일(style) : 다른 태그와 마찬가지로 class와 style을 사용할 수 있습니다. 아래 예시는 style을 사용하여 검은색 테두리를 입혔습니다. : {| class="wikitable" |- ! 입력 ! 결과 |- | <pre style="white-space: pre-wrap; background: #E0E0E03F; border: none; border-radius: 0; margin: 0; padding: 1em;"><syntaxhighlight lang="c" line="line" style="border: 1px solid black;"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight></pre> | <syntaxhighlight lang="c" style="border: 1px solid black;"> #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } </syntaxhighlight> |- |} 요약: 리브레 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0 라이선스로 배포됩니다(자세한 내용에 대해서는 리브레 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요. 글이 직접 작성되었거나 호환되는 라이선스인지 확인해주세요. 리그베다 위키, 나무위키, 오리위키, 구스위키, 디시위키 및 CCL 미적용 사이트 등에서 글을 가져오실 때는 본인이 문서의 유일한 기여자여야 하고, 만약 본인이 문서의 유일한 기여자라는 증거가 없다면 그 문서는 불시에 삭제될 수 있습니다. 취소 편집 도움말 (새 창에서 열림) | () [] [[]] {{}} {{{}}} · <!-- --> · [[분류:]] · [[파일:]] · [[미디어:]] · #넘겨주기 [[]] · {{ㅊ|}} · <onlyinclude></onlyinclude> · <includeonly></includeonly> · <noinclude></noinclude> · <br /> · <ref></ref> · {{각주}} · {|class="wikitable" · |- · rowspan=""| · colspan=""| · |} {{lang|}} · {{llang||}} · {{인용문|}} · {{인용문2|}} · {{유튜브|}} · {{다음팟|}} · {{니코|}} · {{토막글}} {{삭제|}} · {{특정판삭제|}}(이유를 적지 않을 경우 기각될 가능성이 높습니다. 반드시 이유를 적어주세요.) {{#expr:}} · {{#if:}} · {{#ifeq:}} · {{#iferror:}} · {{#ifexist:}} · {{#switch:}} · {{#time:}} · {{#timel:}} · {{#titleparts:}} __NOTOC__ · __FORCETOC__ · __TOC__ · {{PAGENAME}} · {{SITENAME}} · {{localurl:}} · {{fullurl:}} · {{ns:}} –(대시) ‘’(작은따옴표) “”(큰따옴표) ·(가운뎃점) …(말줄임표) ‽(물음느낌표) 〈〉(홑화살괄호) 《》(겹화살괄호) ± − × ÷ ≈ ≠ ∓ ≤ ≥ ∞ ¬ ¹ ² ³ ⁿ ¼ ½ ¾ § € £ ₩ ¥ ¢ † ‡ • ← → ↔ ‰ °C µ(마이크로) Å °(도) ′(분) ″(초) Α α Β β Γ γ Δ δ Ε ε Ζ ζ Η η Θ θ Ι ι Κ κ Λ λ Μ μ(뮤) Ν ν Ξ ξ Ο ο Π π Ρ ρ Σ σ ς Τ τ Υ υ Φ φ Χ χ Ψ ψ Ω ω · Ά ά Έ έ Ή ή Ί ί Ό ό Ύ ύ Ώ ώ · Ϊ ϊ Ϋ ϋ · ΐ ΰ Æ æ Đ(D with stroke) đ Ð(eth) ð ı Ł ł Ø ø Œ œ ß Þ þ · Á á Ć ć É é Í í Ĺ ĺ Ḿ ḿ Ń ń Ó ó Ŕ ŕ Ś ś Ú ú Ý ý Ź ź · À à È è Ì ì Ǹ ǹ Ò ò Ù ù · İ Ż ż ·  â Ĉ ĉ Ê ê Ĝ ĝ Ĥ ĥ Î î Ĵ ĵ Ô ô Ŝ ŝ Û û · Ä ä Ë ë Ï ï Ö ö Ü ü Ÿ ÿ · ǘ ǜ ǚ ǖ · caron/háček: Ǎ ǎ Č č Ď ď Ě ě Ǐ ǐ Ľ ľ Ň ň Ǒ ǒ Ř ř Š š Ť ť Ǔ ǔ Ž ž · breve: Ă ă Ğ ğ Ŏ ŏ Ŭ ŭ · Ā ā Ē ē Ī ī Ō ō Ū ū · à ã Ñ ñ Õ õ · Å å Ů ů · Ą ą Ę ę · Ç ç Ş ş Ţ ţ · Ő ő Ű ű · Ș ș Ț ț 이 문서는 다음의 숨은 분류 1개에 속해 있습니다: 분류:유튜브 영상이 포함된 문서