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

マークダウンパーサを自前実装する #1

Open
yud0uhu opened this issue Feb 22, 2023 · 0 comments
Open

マークダウンパーサを自前実装する #1

yud0uhu opened this issue Feb 22, 2023 · 0 comments

Comments

@yud0uhu
Copy link
Owner

yud0uhu commented Feb 22, 2023

  1. 字句解析器(Lexer)の構築
  • パースするマークダウンテキストをトークンに分割する
    • ヘッダー、段落、リストアイテム、リンク、画像などのトークンを定義する
    • トークン化を行うためのライブラリ...nom、pest、regex
  1. 抽象構文木(AST)の構築
  • パースされたトークンから抽象構文木(AST)を構築する
    • ASTは、パースされたテキストを構造化された形式で表現するために使用する。例えば、ヘッダーは、ヘッダーのレベルとテキストを含むノードにマップされる。リストアイテムは、順序、マーカー、およびテキストを含むノードにマップされる
    • ASTを構築するためのライブラリ...syn、quote
  1. レンダリング
  • 構築されたASTから、HTML、Markdown、LaTeXなどの別のフォーマットに変換する
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

No branches or pull requests

1 participant