-
Notifications
You must be signed in to change notification settings - Fork 0
formula spec #7
Comments
If the only thing If you want to allow searching (e.g. |
About searching: It depends if we want to clone all formulae locally. If we do, then searching for But there are other reasons an index might be helpful. e.g. depending on the auto-filter for pandocfilters in #9 and formula spec in #7, if we have a key for the name of the "main" function in the pandocfilters (i.e. the name of that function can be arbitrary, e.g. "abc"), then we need a dict to quickly lookup for the name of the function when using auto-filter. In this case, the index format would better be not yaml but something builtin, say a dict in pkl, so that the autofilter can load it fast. |
Another useful key will be something like "(in)compatibility" to indicate which other filter is incompatible with this. At the beginning this can be just an info that can be displayed or show in the gallery. In the future, auto-filters might emit warning msg if known pairs of incompatible filters are listed, for example. |
I opened pandoc-extras/pandocpm-formulae which will be where we put the centralized formulae. I also quickly gathered the existing formulae/spec we have discussed so far. In the new structure the index reduces to very simple. (however, I'm thinking if it would be beneficial to define the "main" function name in the index too. Say someone write the "action" function as I expanded the spec a bit in pandocpm-formulae/spec.yaml at master · pandoc-extras/pandocpm-formulae. Many of the keys are copied from # This would just copy the files to the $datadir/filters folder
# question: how would a single url point to 2 files? Does the URL suppose to be the path to `xyz.py` instead then?
# should they copied to `xyz` and `abc`, i.e. no extension?
# May be situation like these should be splited into 2 formulae?
files: [xyz.py, abc.py] |
To expand my concern a bit: I can see why one would have 2 filters under the same repository. But if a single formula installing both of them, would these 2 filters be really related in any way? Personally I do, pantable and pantable2csv, but is it common enough to justify this structure? e.g. I think I might split pantable and pantable2csv into 2 formulae even if such feature is given. The downside of allowing this is, people might get lazy to submit different formula for different, unrelated filters. Then an auto-gallery won't be very helpful. Of course we can still allow this feature but when there's pull request that includes unrelated filters this way, we can then tell them not to. |
Current YAML example
Formula
Index
Proposed spec
From #2 (comment):
Get rid of index?
Should we get rid of index, or build index automatically from individual formula? Excerpt from #2 (comment):
The text was updated successfully, but these errors were encountered: