Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-generated tables #350

Open
brian-bot opened this issue Jun 19, 2020 · 4 comments
Open

data-generated tables #350

brian-bot opened this issue Jun 19, 2020 · 4 comments

Comments

@brian-bot
Copy link

Forgive me if this is a naive question (I'm new to pandoc and manubot) - but I was wondering if there is a way that tables can be generated from data files (either delimited files or json/yaml) as can be done with jekyll (https://jekyllrb.com/docs/datafiles/). Any suggestions?

Thanks in advance!

@dhimmel
Copy link
Member

dhimmel commented Jun 19, 2020

I was wondering if there is a way that tables can be generated from data files

Unfortunately, there is no built-in Pandoc support for this. It would be a nice feature for Manubot, because we want data to be defined in one and only one place.

Some comments on solutions in #339. There are Pandoc filters like pandoc-placetable that enable tables from CSV URLs. You'd have to install a haskel package on CI, which would be possible but perhaps not super easy.

So I think this is something you could add to a Manubot manuscript, but it would require a bit of customization.

@brian-bot
Copy link
Author

Thanks for the note, Daniel - appreciate the response. I'll update this issue if I come up with a customized solution.

@agitter
Copy link
Member

agitter commented Jun 20, 2020

You'd have to install a haskel package on CI, which would be possible but perhaps not super easy.

If you do pursue the pandoc-placetable option and need to install a Haskell package in the GitHub Actions workflow, the actions/setup-haskell can simplify the process. You can check agitter/my-manuscript#16 for an example. The two steps I added are:

      - name: Setup Haskell
        uses: actions/setup-haskell@v1.1
      - name: Test Haskell
        run: |
          cabal update
          cabal install pandoc-placetable

It looks like it installs pandoc-placetable correctly, but I didn't actually test the Pandoc filter.

@dhimmel
Copy link
Member

dhimmel commented Jun 20, 2020

I didn't actually test the Pandoc filter.

@brian-bot the place you'd want to add the filter would be at:

filters:
- pandoc-fignos
- pandoc-eqnos
- pandoc-tablenos
- pandoc-manubot-cite
- pandoc-citeproc

I think you'd want to add - pandoc-placetable. the order won't matter unless there is some interaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants