-
Notifications
You must be signed in to change notification settings - Fork 13
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
Code restructuring and collaboration #34
Comments
Thanks for the feedback!
|
Some further thoughts:
`print(1 + 2)`{.python .cb.run example=true} is parsed as
cmark has a similar AST. I believe this is much easier to work with than pandoc's AST. Besides with cmark (it has a python wrapper) it is all in memory, no need to call pandoc to save the file and reload with json.
|
For 1 and 2: I agree that some of the code could be organized better, but I am hesitant to do any refactoring simply on that basis. I prefer to refactor when limitations of the current, working code become apparent, or when refactoring has objective, concrete, well-defined goals. At least in my experience, refactoring as part of adding functionality results in code that mirrors functionality. I've wasted a lot of time in the past by refactoring to make things look nicer, which ultimately produced an architecture that was incompatible with adding future functionality and thus eventually resulted in even more refactoring. For 4: The ASTs produced by marked and cmark are simpler because they don't do nearly as much. Neither parses code block attributes and neither supports inline code attributes, so Codebraid would then have to perform additional AST modifications to get its own, custom AST that contains all the necessary information. Pandoc's AST is more complex, but that's because it does more and as a result is ready to use immediately. Also, everything already works with Pandoc's AST, and being compatible with Pandoc brings a lot of possibities for the future. For 5: I think we simply have philosophical differences here. I'm primarily concerned with Codebraid being easy to use. Letting people run code in their Pandoc documents by adding |
+1 for keeping Pandoc as a core dependency. |
@gpoore
I went through the code, please find below some suggestions. My goal is not to criticize at all the time and work that you have dedicated to the project. Codebraid is filling a very useful niche and am grateful for your efforts. I think a "novice" friendlier code base might attract more people to contribute. Please let me know what you think.
The text was updated successfully, but these errors were encountered: