getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.45k stars 941 forks source link

Feature request: load_data for TSV and other non-comma-separated CSV #2576

Open aterenin opened 2 months ago

aterenin commented 2 months ago

I'm the author for the Academic Workshop Zola theme: https://aterenin.github.io/academic-workshop/.

This theme is meant for hosting an academic workshop. Part of its functionality is being able to present a list of accepted papers, similar to https://gp-seminar-series.github.io/neurips-2022/

I'd like to store these in TSV format rather than CSV, because the list of authors usually contains commas. However, it appears that Zola's CSV functionality requires comma delimiters.

It would be great to get an optional argument that allows load_data to read non-comma-separated files.

aterenin commented 2 months ago

...and right after posting this, I've realized that part of the CSV spec is that if field is surrounded by quotes, it's processed verbatim, even if it has commas inside it.

Therefore, my use case now works fine without having to switch to TSVs. But someone else might want quotes inside there too, or something hard-to-escape, so perhaps it makes sense to consider such an option anyway?

Keats commented 2 months ago

In theory it shouldn't be a big lift to add TSV, semi-column SV etc I think? Not that we should add it unless people actually want it.