lua-filters icon indicating copy to clipboard operation
lua-filters copied to clipboard

Put individual filter tests in $FILTER/tests subdirs?

Open jkr opened this issue 6 years ago • 3 comments

When I open up a filter folder, it takes a bit for my eye to find the filter itself. I think it might be off-putting for users pointed from pandoc-discuss or elsewhere.

What about

|-- bibexport
|    |-- README.md
|    |-- bibexport.lua
|    +-- tests
|         |-- Makefile
|         |-- coffee.bib
|         |-- expected.bibexport.aux
|         +-- ...
|
|-- section-refs
|    |-- README.md
|    |-- section-refs.lua
|    +-- tests
|         |-- Makefile
|         |-- bibliography.bib
|         +-- ...
...

and then just change FILTERS in the top Makefile to point accordingly?

jkr avatar Jan 11 '18 15:01 jkr

Yes, maybe this is a good idea. On the other hand, the sample.md files one sees are sometimes helpful as documentation. Anyone else have thoughts on this?

+++ Jesse Rosenthal [Jan 11 18 07:43 ]:

When I open up a filter folder, it takes a bit for my eye to find the filter itself. I think it might be off-putting for users pointed from pandoc-discuss or elsewhere.

What about |-- bibexport | |-- README.md | |-- bibexport.lua | +-- tests | |-- Makefile | |-- coffee.bib | |-- expected.bibexport.aux | +-- ... | |-- section-refs | |-- README.md | |-- section-refs.lua | +-- tests | |-- Makefile | |-- bibliography.bib | +-- ... ...

and then just change FILTERS in the top Makefile to point accordingly?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.

References

  1. https://github.com/pandoc/lua-filters/issues/7
  2. https://github.com/notifications/unsubscribe-auth/AAAL5GBV_4qeo-uVFSCfcMGENB-k01XEks5tJiw_gaJpZM4RbBAj

jgm avatar Jan 11 '18 15:01 jgm

Fine with me. Alternatively, we could prefix files not intended to be inspected by users with test-, but a subdir approach seems cleaner.

tarleb avatar Jan 20 '18 22:01 tarleb

Yes, maybe this is a good idea. On the other hand, the sample.md files one sees are sometimes helpful as documentation. Anyone else have thoughts on this?

Could the sample.md remain in the main folder, and the test would just reference it? E.g.,

test:
	@pandoc --lua-filter=myfilter.lua --output=output.md ../sample.md
	@$(DIFF) expected.md output.md
	@rm -f output.md

frederik-elwert avatar Jun 10 '20 08:06 frederik-elwert