owickstrom / pandoc-include-code

A Pandoc filter for including code from source files
Mozilla Public License 2.0
141 stars 17 forks source link

Export additional functions #11

Open chrissound opened 6 years ago

chrissound commented 6 years ago

Hello! Many thanks for making and releasing this!

I'd like to use the 'sections' functionality in another project that does not use Pandoc. It would be great if the export list could be opened up to allow this sort of reuse, or possibly an 'internal' module that could then be imported.

I suppose I would be looking at: runInclusion' and the related constructors.

owickstrom commented 6 years ago

Hey! That does make sense, it should be possible to make the core stuff in this plugin decoupled from Pandoc.

I think I'd prefer keeping the Inclusion monad transformer stack an implementation detail, and not expose that, but instead refactor includeCode' to :

Then the Pandoc specifics could wrap the decoupled includeCode, doing parsing and Block -> Text as appropriate. I think it would make sense to keep these as two separate packages, but in one repository. We could have a multi-package Stack configuration.

Does this sounds OK and aligned with what you have in mind? Also, would you be open to sending a PR when we have nailed a design?

chrissound commented 6 years ago

That approach sounds good. I'm guessing the multi package config would result in two hackage packages?

As for the PR, it probably won't be anytime soon but happy to give this a go.