pystitch / stitch

Write reproducible reports in Markdown
https://pystitch.github.io
MIT License
441 stars 20 forks source link

New options and API #64

Closed kiwi0fruit closed 6 years ago

kiwi0fruit commented 7 years ago

See changes description here.

kiwi0fruit commented 7 years ago

What do you mean by review? ("Let me know when you're ready for review, and I'll try to make time.") And time for what?

TomAugspurger commented 7 years ago

What do you mean by review?

Reviewing the rest of the code before merging the pull request. I haven't had a chance yet to look at the changes to the library itself. Unfortunately, I don't have much time for maintining stitch these days, so it'll be a little bit before I get around to it.

kiwi0fruit commented 6 years ago

I'm going to rewrite the whole my additions. Remove them from Stitch. Only few of them still will be inside Stitch. This pull request is postponed.

PS: old commits are now here.

kiwi0fruit commented 6 years ago

That's all additions for the pull request. They all except one are document and chunks options for more convenient workflow. The last one is adding stitch.ast_filter function to the API so it can be used inside Pandoc filters.

I recommend reading NEW.md before the reading the code.

kiwi0fruit commented 6 years ago

@TomAugspurger , Hello. What's the status of this pull request? What do you this about these much fewer changes?

kiwi0fruit commented 6 years ago

@TomAugspurger By the way. May be you know the way how to create an interactive document like in rmarkdown (see 7. Interactive Docs).

Now this can be done:

  1. via converting Stitch document to jupyter notebook and passing code there. Then we run Jupyter notebook and have interactive plot there.
  2. or we can convert Stitch document to html and open it in a browser. And this document is actually a front-end that is connected to the running Jupyter server directly or via some kind of proxy. Do you have some advice on how to implement this feature?

UPD My current assumption is that the second option requires too many work and the first option is prefferable: some jupyter notebook desing tweaks and to ipynb expoter (that is needed anyway).

TomAugspurger commented 6 years ago

I'll finish reviewing and merge it this week, sorry for the delay.

What are your plans for "NEW.md"? If you could post comments on the lines that should be included in the docs, I'll make a PR for that repo to update them.

kiwi0fruit commented 6 years ago

Then I'll comment the NEW.md.

UPD: Also note that function I added (UPD: already deleted) to API is not actually a filter. The function needs more arguments than filters get from pandoc (stitch.Stitch class needs them too).

I'm planing to use stitch.Stitch class inside Panflute filter. I need to have a modular workflow with pipelined python pre-filters, then pandoc AST filters then python post-filters (they all are simply combined via reading/writing from/to stdin). Stitch would be one of pandoc filters (so Stitch filter would get additional arguments from metadata - directly or via wrapper).

kiwi0fruit commented 6 years ago

Now I'm thinking about rewriting API into common pandoc filter that reads extra args from metadata. It would be more elegant solution.

UPD maybe I'll do this later. For now new Stitch.stitch_ast method is enough.

TomAugspurger commented 6 years ago

This looks good to me. Ready to merge?

kiwi0fruit commented 6 years ago

@TomAugspurger Yep, everything is ready.

kiwi0fruit commented 6 years ago

@TomAugspurger And now even the docs are ready.

kiwi0fruit commented 6 years ago

@TomAugspurger What about merging?

TomAugspurger commented 6 years ago

👍, thanks!