-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyKOMORAN용 문서 사이트 구출;; #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shin285
PyKOMORAN을 apidoc을 위한 Sphinx 설정 내용에 대해서 코멘트를 추가하였습니다.
확인 부탁드립니다.
# | ||
import os | ||
import sys | ||
sys.path.insert(0, os.path.abspath('../python/')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sphinx-apidoc의 경우 자동으로 autodoc을 이용하는 .rst 문서를 생성하고, 이 .rst 문서가 make 시점에 docstring을 가져오는 구조입니다.
'sphinx.ext.githubpages', | ||
'sphinxcontrib.napoleon', | ||
'sphinx_sitemap', | ||
'javasphinx', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc을 위한 javasphinx extention을 추가합니다.
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
'sphinx.ext.autodoc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python docstring을 위한 autodoc을 추가합니다.
|
||
# -- Extension configuration ------------------------------------------------- | ||
# JavaSphinx | ||
javadoc_url_map = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc 내에서 @see annotation을 이용하여 참고하는 pacakge가 아래 패키지명을 기준으로 링크가 걸리게 됩니다.
} | ||
|
||
# sphinx-apidoc | ||
apidoc_module_dir = '../python/PyKomoran' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 python을 위한 sphinx-apidoc을 위한 설정 부분입니다. 실제로는 Makefile에서 이 설정을 주고 있어서 안 쓰이는 것처럼 보입니다;;;
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
api: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API 문서 생성을 위한 make api
명령어를 추가하였습니다.
각 인자는 한 번씩만 쓰일 것이기에 별도 변수로 빼지는 않았습니다.
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
api: | ||
sphinx-apidoc -f -e -H "Python API" --ext-autodoc --ext-coverage --ext-githubpages -o api/python ../python/PyKomoran /\*tests\*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python용 docstring을 가져오는 명령어입니다.
-f
강제로 문서를 업데이트 하며,
-e
모듈별로 문서를 생성하며,
-H
"Python API"라는 제목을 갖도록 하며,
--ext-*
각 extension을 사용하도록 하며
-o
'api/python' 경로에 문서를 넣고
../pythonPyKomoran
경로에 있는 python docstring을 읽어오되,
/\*tests\*/
tests 문자열이 들어간 파일/디렉토리는 제외합니다.
|
||
api: | ||
sphinx-apidoc -f -e -H "Python API" --ext-autodoc --ext-coverage --ext-githubpages -o api/python ../python/PyKomoran /\*tests\*/ | ||
javasphinx-apidoc -f --title "Java API" -o api/java/ ../java/src/main/java/kr/co/shineware/nlp/pykomoran/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc을 가져오는 명령어입니다.
-f
강제로 문서를 업데이트하며,
--title
"Java API"라는 제목을 갖도록 하며, (packages.rst 파일이)
-o
'api/java' 경로에 문서를 넣고
../java/src/main/java/kr/co/shineware/nlp/pykomoran/
경로에 있는 java 파일들의 javadoc을 읽어옵니다.
sphinx-apidoc -f -e -H "Python API" --ext-autodoc --ext-coverage --ext-githubpages -o api/python ../python/PyKomoran /\*tests\*/ | ||
javasphinx-apidoc -f --title "Java API" -o api/java/ ../java/src/main/java/kr/co/shineware/nlp/pykomoran/ | ||
|
||
docs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make docs
명령어를 추가합니다.
이 명령어는 make api
로 api 문서 생성 후, make html
로 html을 생성합니다.
make api
의 -B
옵션은 make가 디렉토리 생성 여부로 skip하는 것을 방지하고 매번 강제로 실행하게 하기 위해 추가하였습니다.
56e4de0
to
ab06ed4
Compare
docs.komoran.kr을 일괄적으로 pydocs.komoran.kr로 수정해야 합니다. |
@shin285 |
@shin285 @dolpang2 |
@shin285 @dolpang2 |
* Sphinx 기본 설정 및 apidoc 문서 추가 relate #10 * KOMORANDocs 저장소의 PyKOMORAN 문서 이동 related #11 * 의존성 추가 * 품사표 링크 추가 * base_url 변경 related #13 comment * docstring 및 javadoc 업데이트 * Token/Pair 참조 제거 * 작업 중인 파일이 잘못 포함되어 되돌림 * Token/Pair 참조 제거 반영 * PyKOMORAN 문서 사이트로 주소 변경 및 DOI 제거/BibTeX 추가 related #10 and #14 * 기존 konlpy 내의 Komoran 사용자를 위한 method 추가 등 * 미사용 method 제거 * vscode java plugin 등 추가
No description provided.