-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support for RST importer #378
Comments
While Markdown is in general still more popular due to it's simplicity, RST has become the de-facto standard for documentation in Python projects. That alone is already a very good reason to support it. PreparationFirst order of business: checking RST parsers. So far OFT has no external dependencies (with the exception of the Java runtime). We need to decide: a) we keep it this way → we need to write the parser ourselves Criteria for an RST parser we could accept:
|
@orzelmichal, I did some research. I found no active Java project that provides a RST parser. There are two abandoned projects, but that's it. So I will have to write a parser that is based on the one we use for Markdown. In fact it will for the most part probably be the same code. My goal here is not to cover the whole feature set of RST, but instead a very limited subset that makes defining requirements possible. For instance, support for extensions is definitely out-of-scope. In our discussions you mentioned that headlines were the one thing that gives you trouble sofar, so that's what I will put my main focus on. The underlined headline style is one that in Markdown exists too, but I did not support it in the Markdown parser sofar, since there is a more commonly used alternative that is also easier to parse. I am guessing here that in the end the Markdown parser will gain the capability to parse that headline style too, even if I have yet to see someone use it. Anyway, that's a nice side effect. |
@redcatbear Thanks for the investigation. Yes, the headline would be a good starting point. Markdown supports only =,- whereas |
#384 adds support for underline-style titles to the Markdown importer. Which means, we cracked the tricky part already. Next step: extracting common code. |
@orzelmichal, the code for underline-style headlines in Markdown is now on |
Co-authored-by: kaklakariada <christoph@users.sourceforge.net>
Description
These days more and more documents are written in ReST format (especially in the open source projects), whereas at the moment, OFT expects a document to be written in Markdown format. It would be great to meet users' expectations by adding support for the new format which is more powerful and supports more complex data structures. Despite many similarities, converting from one format to another takes a long time.
Intermediate solution
With the following modification, we can hack OFT to detect RST files as if they were MD files. However, due to differences in heading format, the tool is no longer able to detect the title.
The text was updated successfully, but these errors were encountered: