-
Notifications
You must be signed in to change notification settings - Fork 19
Description
With speed-type-pandoc depending on the website the user is converting he might want to filter certain annoying patterns. These patterns are specific to the structure of the website and the pandoc-conversion (which is a best effort conversion). It can get very specific, so the user knows best what patterns he might want to filter. Applying a general rule would be a overkill for other users.
An example what a user might want to filter are references on wikipedia-pages: ([3]).
The mechanism should also allow to skip whole sections and start where it get's interesting for the user.
For example wikipedia-pages come often we a big language-list at the start which needs to be skipped before the content starts. There is currently only the workaround to store manually an entry in the speed-type-statistic-filename which sets speed-type--continue-at-point to the desired continue-point.
Considering the above the new procedure should look something like: pick -> put-text-property -> filter -> replace -> trim -> pick -> put-text-property -> filter -> replace -> trim -> pick -> ... until enough typing-material is collected or end of buffer is reached.
The procedure and existing function (step by step):
- pick =
speed-type--pick-continue-text-bounds - put-text-property =
speed-type--put-text-property-orig-pos - filter -> [To be implemented]
- replace =
speed-type--replace-map-adjust-properties - Repeat
Finally: trim =string-trimorspeed-type--trim
This procedure should be used for all commands. If the custom-variable is nil the filter-step should be skipped (it should be behave as is). Therefore it's an opt-in feature. The custom filters should be formulated general enough to work for all commands (the filter-function should a some context-arguments (e.g. identifies the used command). So the individual custom-function decides if it filters something or not depending on the context.
It should be documented in detail how these filter-functions are expected and which context-arguments are provided. It should show some example cases for the context-arguments, when to use them and when to ignore them.
The content-buffer should stay untouched so continue-at-point doesn't get corrupted.