Skip to content
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

Merged
merged 10 commits into from
Apr 9, 2019

Conversation

9bow
Copy link
Member

@9bow 9bow commented Apr 5, 2019

No description provided.

@9bow 9bow requested review from gamamoe and shin285 April 5, 2019 10:55
@9bow 9bow self-assigned this Apr 5, 2019
@9bow 9bow added the enhancement New feature or request label Apr 5, 2019
Copy link
Member Author

@9bow 9bow left a 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/'))
Copy link
Member Author

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',
Copy link
Member Author

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',
Copy link
Member Author

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 = {
Copy link
Member Author

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'
Copy link
Member Author

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:
Copy link
Member Author

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\*/
Copy link
Member Author

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/
Copy link
Member Author

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:
Copy link
Member Author

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하는 것을 방지하고 매번 강제로 실행하게 하기 위해 추가하였습니다.

@9bow 9bow changed the title PyKOMORAN용 문서 사이트 구출 PyKOMORAN용 문서 사이트 구축 Apr 5, 2019
@9bow 9bow changed the title PyKOMORAN용 문서 사이트 구축 PyKOMORAN용 문서 사이트 구출;; Apr 5, 2019
@9bow 9bow force-pushed the #10_add_sphinx_and_generate_apidoc branch from 56e4de0 to ab06ed4 Compare April 6, 2019 06:47
@shin285
Copy link
Member

shin285 commented Apr 6, 2019

docs.komoran.kr을 일괄적으로 pydocs.komoran.kr로 수정해야 합니다.

@9bow
Copy link
Member Author

9bow commented Apr 7, 2019

@shin285
docs.komoran.kr 을 pydocs.komoran.kr 로 수정하였습니다.

@9bow 9bow marked this pull request as ready for review April 7, 2019 14:42
@9bow
Copy link
Member Author

9bow commented Apr 7, 2019

@shin285 @dolpang2
현재까지 내용을 바탕으로 리뷰 부탁드립니다 (_ _)

@9bow
Copy link
Member Author

9bow commented Apr 9, 2019

@shin285 @dolpang2
여기까지 문서 사이트 분리 관련한 모든 commit을 완료하였습니다.
문서 사이트 분리로 docs.komoran.kr 내에 PyKOMORAN 관련 내용이 사라졌기에 우선 현재까지 내용을 빌드하여 pydocs.komoran.kr 에 배포해두었으니 함께 확인 부탁드립니다.

@9bow 9bow merged commit c776bbe into master Apr 9, 2019
@9bow 9bow deleted the #10_add_sphinx_and_generate_apidoc branch April 9, 2019 12:41
shin285 pushed a commit that referenced this pull request Apr 10, 2019
* 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 등 추가
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants