walk

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package walk는 위키 문서 순회를 담는다. lint, status, 이어지는 promote 와 new 커맨드가 같은 순회를 쓴다. 순회 규칙(page_dirs 아래 .md 문서와 root_files, 숨김 디렉토리 제외, 경로 정렬)이 두 벌이 되면 한쪽만 고치는 사고가 반드시 나므로 이곳이 단일 진실원이다.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnclosed = errors.New("프론트매터가 닫는 --- 구분자 없이 끝났다")

ErrUnclosed 는 프론트매터가 닫는 구분자 없이 끝났음을 나타낸다. 위반 규칙 분류를 에러 문자열 매칭 없이 하기 위해 센티널로 둔다.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	Rel     string  // 위키 루트 상대 슬래시 경로
	Root    bool    // root_files(색인) 문서인가
	Content string  // BOM 과 CRLF 를 정규화한 원문
	Parsed  doc.Doc // 파싱 결과. Err 이 nil 일 때만 유효하다
	Err     error   // 프론트매터 파싱 실패. ErrUnclosed 인지 errors.Is 로 구분한다
}

Doc은 문서 하나의 순회 결과다. 경로, 원문, 파싱 결과와 파싱 오류가 함께 실리므로 호출자는 파일을 다시 읽거나 파싱하지 않는다.

func Files

func Files(wikiRoot string, cfg config.Config) ([]Doc, error)

Files는 위키의 문서를 경로순으로 순회해 파싱까지 마친 결과를 반환한다. 파싱에 실패한 문서도 목록에 남되 Err 을 싣는다. 검사한 파일 수를 셀 때 파싱 실패 문서가 숨지 않게 하기 위해서다.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL