15link.adoc 2.54 KB
Newer Older
heywon.choi's avatar
heywon.choi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
= 링크와 참조
Heywon Choi <heywon.choi@bankwareglobal.com>

[abstract]
.문서개요
--
이 문서는 AsciiDoc 에서 {doctitle} 를 표현하는 방법에 대해 설명합니다.
--

== Link
문서에서 주소 지정 가능한 다른 리소스에 대한 링크(일명 하이퍼링크)를 만드는 다양한 방법을 제공한다.
[NOTE]
====
* 링크의 대상: 웹 주소라고도 하는 URL(Uniform Resource Locator)
* 링크 텍스트: 해당 대상으로 이동하기 위해 클릭하는 텍스트
====
문서에서 링크를 표현하기 위해서는 pass:[link:+++URL+++["링크 텍스트"]] 를 사용하고 결과물은 다음과 같다.

[#link_asciidoc_source]
=== AsciiDoc 소스
Link를 작성하는 AsciiDoc 소스는 다음과 같다.
[source,asciidoc]
----
The homepage for the Asciidoctor Project is link:+++https://asciidoctor.org/+++["AsciiDoctor Home"].
Email us at hello@example.com to say hello.

-- <1>
Once launched, the site will be available at \https://example.org.
If you cannot access the site, email \help@example.org for assistance.
--
----
<1> 자동 링크를 피하려면 URL앞에 \ 를 붙인다.

=== 결과
Link를 사용하는 경우 본문 형태는 다음과 같다.
****
The homepage for the Asciidoctor Project is link:++https://asciidoctor.org/++["AsciiDoctor Home"].
Email us at hello@example.com to say hello.


Once launched, the site will be available at \https://example.org.
If you cannot access the site, email \help@example.org for assistance.
****

== 상호 참조 (xref)
문서에서 상호 참조를 표현하기 위헤서는 pass:[xref:문서명#앵커ID["링크 텍스트"]] 를 사용하고 결과물은 다음과 같다.

=== AsciiDoc 소스
상호 참조를 작성하는 AsciiDoc 소스는 다음과 같다.
[source,asciidoc]
----
[#manual_id] <1>
Manually set id

[#link_asciidoc_source] <2>
=== AsciiDoc 소스

xref:./15link.adoc#manual_id["Manual ID"] <3>
xref:./15link.adoc#link_asciidoc_source["링크 AsciiDoc 소스"] <3>
----
<1> 앵커 설정
<2> 현 문서의 링크의 AsciiDoc 소스 섹션에 앵커 설정
<3> 참조 호출

[CAUTION]
====
.앵커 설정 규칙
* # 다음에 오는 첫 번째 문자는 소문자로 한다.
* 선택적 다음 문자는 소문자, 콜론, 밑줄, 하이픈, 마침표 또는 숫자여야 한다.
* ID에는 공백 문자를 사용할 수 없다.
====

=== 결과
상호 참조를 사용하는 경우 본문 형태는 다음과 같다.
****
[#manual_id]
Manually set id

xref:./15link.adoc#manual_id["Manual ID"]
xref:./15link.adoc#link_asciidoc_source["링크 AsciiDoc 소스"]
****