Skip to content

MkDocs

MKDocs 는 글쓰기 도구입니다. 글쓰기 도구에는 sphinx, read docs 등 다양한 도구들이 있습니다. MKDocs 는 간편하고, 마크다운 방식으로 글쓰기를 하며, serve 라는 명령어를 통해서 실시간으로 글쓰는 모습을 확인할수 있어서 선택하였습니다.

Categories

Plugins

Markdown Extensions

mkdocs.yml 파일에 다음과 같이 추가하면 된다:

markdown_extensions:
  - md_in_html
  - pymdownx.arithmatex:
      generic: true

상세 목록은 Python-Markdown#Extensions 항목 참조.

sitemap.xml 생성 방법

mkdocs.yml 파일에 site_url을 설정해야 sitemap.xml이 생성됩니다:

site_name: "My Docs"
site_url: "https://example.com/docs/"

Linking to pages

WARNING

링크에 절대 경로를 사용하는 것은 공식적으로 지원되지 않습니다. 상대 경로는 MkDocs에서 조정하여 항상 페이지에 상대적이 되도록 합니다. 절대 경로는 전혀 수정되지 않습니다. 즉, 절대 경로를 사용하는 링크는 로컬 환경에서는 잘 작동할 수 있지만 프로덕션 서버에 배포하면 끊어질 수 있습니다.

Troubleshooting

Doc file 'Index.md' contains a link 'mutex.md', but the target is not found among documentation files.

링크했지만 파일을 찾을 수 없을 경우 방생되는 경고.

INFO    -  Doc file '1BITDRAGON.md' contains an absolute link '/Music.md', it was left as is.
INFO    -  Doc file '1BITDRAGON.md' contains an absolute link '/Scorewriter.md', it was left as is.

로그를 숨기고 싶다면 mkdocs.yml 파일에:

validation:
  links:
    absolute_links: ignore

See also

Favorite site