-
Notifications
You must be signed in to change notification settings - Fork 147
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
Making the HTML renderer part of public interface? #82
Comments
Note: I'm understanding: provide the renderer as a library, not as an application.
As for the naming: as I already wrote I think either libmd4crenderer is more clear and straightforward. Hope that helps, feel free to ping me for more info/feedback if needed. And thanks a lot for asking! |
Here my 2 cents:
I like the generic approach As far as the name is concerned I do not really have an opinion, since I would keep it all in one library. |
I have created the PR #89 addressing it. In short, I tried the approach all-sources-in-one-dir but standalone renderer build target (library) with its own public header, for reasons specified below. all-sources-in-one-dir rationale: To be honest, I'm not that sure it is a good idea -- actually I generally prefer one-target-per-dir approach. But I simply failed to come up with a dir structure which would really provide some value and which would scale well if we implement more renderers. I assume most renderes will just need one source + one header; and also that likely all (or most of them) will need to reuse the standalone renderer lib rationale: I don't want to have a big lib with a dozen of renderers, if/when those are implemented. And I also don't like an idea of a "priviledged" renderer which would live together. Both in general and also specifically here (although I understand that Markdown and HTML are historically close to each other, I also think this relation is much weaker for languages as C which are not that much used for writing webapps.) Imho, it should still be easy to use: HTML-generating app can just include (Feedback is welcome.) |
I included your fantastic code into my Textosaurus and I moved renderer files into |
I wonder if a different two-directory (or even three-directory) approach might make sense:
Most applications using the library will need a renderer, but few will need the standalone
I really like this approach. Most applications are going to need a renderer of some sort, most likely the HTML renderer, so making that a library makes a lot of sense. But different applications will sometimes need different renderers (thinking of e.g. PDF or manpage converters), or their own custom renderer, and this allows maximum flexibility. I hope we can see this merged into master soon!
|
@martinrotter Imagine we do it that way and that the dir absorbs 5 other renderers you are not interested in (e.g. to man, pdf, rtf etc.). You would have then in your project filter what you link into it and what not. So, would it still be preferred in one dir? |
The standalone lib for every renderer is in my head more or less decided. The source dir structure is not but at least that one is not subject of ABI, so we can likely proceed anyway and change the dir structure later if needed.
That might be a reasonable compromise. I'm still not sure whether it is ideal, but it is definitely better then all in one dir: People likely don't need to reuse the utility sources so it makes good sense to separate that. I'll adapt the PR #89 that way.
If there are no complains in a week or two after the PR update, I will then merge it. |
The PR has been merged. Closing the issue. |
I'm not really sure where else to put this, so I'm just putting it here. I have written Python bindings for MD4C based on the updates from this issue: PyMD4C. After PR #89 makes it into a MD4C release, I will make the first release for PyMD4C and add it to PyPI. Meanwhile, a beta version is available at the link. (Side note: "PyMD4C" seemed like a logical name but if you prefer something that bears less similarity to "MD4C," I can change it.) |
Good to know. Feel free to make a PR adding the link into the README.md to get some visibility if you like. There are already some links to some SW based on MD4C.
No objections at all. |
It seems there is some (growing?) demand to have the HTML renderer (implemented in
md2html/render_html.[hc]
+md2html/entity.[hc]
) available for easy reuse. See e.g. #80 or https://www.reddit.com/r/rust/comments/b5cul0/benchmarking_markdown_libraries_comrak/ejg6c8m/In some ways, I see it as quite a big step, especially if it becomes part of some "stable official API", and twice so if some Linux distros start to ship it and it becomes subject of some inter-package dependencies; and also because it could possibly make sort of a precedent for the future if some other renderers to more output formats perhaps get implemented.
So I have a lot of questions (and although I may have some opinions about some of them I am still open to discussion and interested in opinion of other people in different roles).
md4c/
?libmd4c.a
?libmd4c.so
?render_html.h
be merged intomd4c.h
or live as a standalone?In any case it should likely undergo some renaming (
render_html.h
or potentiallibrender_html.[a|so]
is likely not specific enough; the names should contain some "md4c" to mitigate name conflicts etc.), also its API should be reviewed and polished before making it officially public so do not expect this to happen instantly.Feedback? Opinions? Complains?
(cc @perezmeyer @ec1oud @hvoigt)
The text was updated successfully, but these errors were encountered: