-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Working on v2 #463
Comments
Thank you for revisiting our project. I agree with your comment that our project depends on the old library and it should be updated to the latest version. Further, I am happy to hear that I could collaborate with you again. Let's reboot our project and make it better. In my opinion, I would like to use unified-latex libarary. Even if we use the latex-utensils, we need to momdify the upstream code to make it work with our project. I think that it is time to change the library to unified-latex because it is more feature-rich. (For my personal preference, I tend to use the new library for better experience 😉.) |
Hello, I am glad to hear that you are doing well! |
This may be resolved by |
Looking at the reference, markdown-to-ast, it appears that whitespace, etc. caused by List nesting is simply ignored. |
I have written a sample that works to some extent, but have found additional problems and reported them to unified-latex. |
Because latex combines elements of formatting and text, it is often difficult to express in ASTs prepared for mere text. I am currently struggling with the \begin{description}
\item[item1] desc
\item[item2] desc
\end{description} I have three ideas. 1. Consider headings and their descriptions to be lists.- item1
- desc
- item2
- desc textlint AST will be as follows:
2. Consider the heading as a
|
Since Re:VIEW also has definition list, I examined the behavior of textlint-plugin-review. As a result, it output AST similar to the idea 1. input (test/chunker-test.js)
output: |
I have made some modifications since I became one of the maintainers, but I have not been able to actively participate in the development over the past few years.
I had discovered some problems but had put them off due to the complexity of the current code base.
Several major events have occurred during this time.
latex-utensils
a good idea? James-Yu/LaTeX-Workshop#3877This project is a viable solution for using textlint in LaTeX, even in the year 2024, with no alternative.
I began to think that it might be appropriate to rebuild the entire project once in order to maintain it on an ongoing basis.
This means building v2 from scratch.
Which parser library is better for us?
For v2 I re-evaluated several LaTeX parsers written in TypeScript or JavaScript.
Sample TeX source is as follows:
latex-utensils v6.2.0
Generated AST of sample tex source is here.
space
,linebreak
,softbreak
do not have location information.completeComment
func is implemented for this.unified-latex v1.6.0
Generated AST of sample tex source is here.
whitespace
has location information.whitespace
andparbreak
around\item
has no location informationwhitespace
may be asoftbreak
softbreak
: https://github.com/pddg/eval-js-latex-parsers/blob/88f3ed88f8da01540da3e73d64b4d076ad6c94fb/latex-utensils/output.json#L310-L312whitespace
(softbreak
is not defined in unified-latex): https://github.com/pddg/eval-js-latex-parsers/blob/88f3ed88f8da01540da3e73d64b4d076ad6c94fb/unified-latex/output.json#L514-L528"module": "Node16"
siefkenj/unified-latex#72"module": "ESNext"
and"moduleResolution": "Bundler"
, now.latex-utensils
a good idea? James-Yu/LaTeX-Workshop#3877 (comment)completeBlank
andcompleteComment
is hard to maintain. I think it might be worth the transition.LaTeX.js v0.12.6
(As far as I could tell) this could not be used as a mere parser.
It may be possible to define a Generator that generates textlint ASTs from LaTeX ASTs.
However, I do not know how to create a Generator. Document says
TODO
, now.https://latex.js.org/api.html#class-generator
Create original one
Another option would be to make your own, but the reason other parsers produce such output in the first place is because that is the way TeX syntax is written.
Therefore, it is difficult to imagine that a home-built parser would be significantly easier for us to use.
Goal of v2
Non Goal
How do we do
As maintainers, we should work on one of the following
Which one do you think is better? @tani @kn1cht
The text was updated successfully, but these errors were encountered: