Closed mgaitan closed 9 years ago
Hi,
As you probably know, I wrote pymarkups library with ReText in mind, and ReText is the main consumer of this library.
In ReText, there is a file name associated with a document, but the text of the document does not necessarily match the file contents. For example, user can open a file, change something and click "Preview", then change something again and click "Preview" again. Because of this,
That said, you should probably fork this library for yourself if you want a different behaviour. I can also accept pull requests, but they should not break compatibility with the current version or have worse performance.
Dmitry, in first place, let me say that this project could be very useful for many people.
However, I don't understand (or like?) the current API. Let me show what it's an obvious use pattern for me:
Every markup method (to get body, title, etc,) needs the document source as parameter, which is too verbose and (IMHO) not DRY. Why not to read the content of the given filename/path and store it as an instance attribute?
I would like that the mandatory parameter be a path (or a file-handler like object) or the raw source content. For example:
let me know what do you think. I'll be glad to send a PR if you are interested