For AI agents: the complete documentation index is available at https://canary.gukhanmun.org/ko-KR/llms.txt, the full documentation bundle is available at https://canary.gukhanmun.org/ko-KR/llms-full.txt, and this page is available as Markdown at https://canary.gukhanmun.org/ko-KR/guide/rust/markdown.md.
  • 한국어 (한글)
  • Markdown 변환

    markdown 피처가 필요합니다(기본으로 켜짐).

    Markdown 문자열 변환

    use gukhanmun::{Builder, Preset, MarkdownVariant};
    
    let converter = Builder::with_preset(Preset::KoKr).build()?;
    
    // CommonMark
    let output = converter.convert_markdown_to_string(
        "# 漢字\n\nHanja converted to hangul.",
        MarkdownVariant::CommonMark,
    )?;
    
    // GitHub Flavored Markdown (表, 作業 目錄, 取消線)
    let output = converter.convert_markdown_to_string(
        "| 漢字 | 한자 |\n|------|------|\n| 東 | 동 |",
        MarkdownVariant::Gfm,
    )?;

    변환되는 대상

    Gukhanmun은 다음 안의 한자를 변환합니다:

    • 단락 텍스트
    • 헤딩
    • 리스트 항목
    • 인용 블록 내용
    • 표 셀(GFM)
    • 인라인 HTML 텍스트 노드

    다음은 손대지 않습니다:

    • 펜스/들여쓰기 코드 블록
    • 인라인 코드 스팬(`…`)
    • 날(raw) HTML 블록
    • 링크와 이미지 URL

    반복자(iterator) 판

    출력을 토큰 단위로 처리하려면 convert_markdown_iter를 사용합니다:

    use gukhanmun::MarkdownVariant;
    
    for token in converter.convert_markdown_iter(source, MarkdownVariant::CommonMark) {
        print!("{}", token.as_str());
    }