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

마크다운 렌더러 라이브러리 적용 #37

Merged
merged 8 commits into from Aug 26, 2019
Merged

Conversation

love-adela
Copy link
Owner

BaseFormatter를 상속한 Formatter 생성하여 라이브러리 적용.

라이브러리는 Misaka, Hoedown, Mistune를 선정하였음.

  • Misaka

    • Sundown Python 바인딩. Sundown은 현재 deprected.
    • 코드 하이라이팅 기능 있음
  • python-hoedown 라이브러리

    • Deprected Sundown 라이브러리를 포크한 Python
      바인딩(Hoedown)
    • Misaka 라이브러리의 기능을 가지고 있음
    • Pypy compatible
    • Footnote 기능 있음
  • Mistune

    • Python-Markdown 라이브러리보다 4배 빠르다고 함
    • 최신 라이브러리. 2018-10-11에 Version 0.8.4 release
    • Full featured. autolink, strikethrough, table, fenced code, footnotes 지원

autoescape 대신 safe 적용

1. FormatterA, FormatterB, FormatterC 클래스를 동적으로 생성하기 위해
Post 클래스에 format이 FormatterA와 같을 경우 Formatter의 text를
반환하도록 작성하였으나, Formatter를 여러개 사용하다가 하나를 고를
예정이기 때문에 format을 추가할 때마다 Post 모델을 손봐야 했음.
따라서 Post 모델에 영향을 주지 않고 포맷을 추가하는 방식으로 구현.

2. View 단에 BaseFormatter, FormatterA를 import 시켰고 post_list에
formatter로 넘겨주었음
라이브러리는 Misaka, Hoedown, Mistune를 선정하였음.

* [Misaka](https://misaka.61924.nl/#)
  - Sundown Python 바인딩. Sundown은 현재 deprected.
  - 코드 하이라이팅 기능 있음

* [python-hoedown](https://github.com/hhatto/python-hoedow) 라이브러리
  - Deprected Sundown 라이브러리를 포크한 Python
바인딩(Hoedown)
  - Misaka 라이브러리의 기능을 가지고 있음
  - Pypy compatible
  - Footnote 기능 있음

* [Mistune](https://mistune.readthedocs.io/en/latest/)
  - Python-Markdown 라이브러리보다 4배 빠르다고 함
    - lepture/mistune#1
  - 최신 라이브러리. 2018-10-11에 Version 0.8.4 release
  - Full featured. autolink, strikethrough, table, fenced code, footnotes 지원
@dalinaum
Copy link
Collaborator

Conflict를 해겨해야할 듯. master를 django_markdown에 머지하고 충돌을 해결할 것.

@love-adela love-adela merged commit 3fd83a5 into master Aug 26, 2019
@dalinaum dalinaum deleted the django_markdown branch August 26, 2019 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants