GithubHelp home page GithubHelp logo

pelican-loadcsv's Introduction

pelican-loadcsv

CSV loader in Python Pelican's templates.

Usage

Within a pelican template:

{% csv 'data-sbp.csv' %}

or

{% csv '''
a,b,c,d,e
1,1,1,1,1
2,2,2,2,2
3,3,3,3,3
4,4,4,4,4
5,5,5,5,5
'''%}

pelican-loadcsv's People

Contributors

e9t avatar

Watchers

 avatar  avatar

pelican-loadcsv's Issues

question(usage): basic loadcsv usage

1. Summary

I can't begin to use Pelican-loadcsv.

2. Environment

  • Windows 10 Enterprise LTSB 64-bit EN,
  • Python 3.6.5,
  • Pelican 3.7.1,
  • Python Markdown 2.6.11,
  • Pelican-loadcsv 2015-03-20.

3. Configuration

See simple configuration in SashaLoadCSV branch of my demo repository:

Sasha__LoadCSV--debugging.md:

Title: Sasha__LoadCSV--debugging.md
Date: 2018-05-19 11:15:49
Modified: 2018-06-03 20:40:54

Sasha Goddess!

{% csv '''
a,b,c,d,e
1,1,1,1,1
2,2,2,2,2
3,3,3,3,3
4,4,4,4,4
5,5,5,5,5
'''%}

Part of pelicanconf.py:

PLUGINS = [
    'loadcsv'
]

4. Steps to reproduce

pelican content -s pelicanconf.py --verbose

5. Expected behavior

Generating tables from CSV in articles.

Support different tables for different articles.

6. Actual behavior

<p>{% csv '''
a,b,c,d,e
1,1,1,1,1
2,2,2,2,2
3,3,3,3,3
4,4,4,4,4
5,5,5,5,5
'''%}</p>

7. Not helped

7.1. Backticks

Try in Sasha__LoadCSV--debugging.md:

```
{% csv '''
a,b,c,d,e
1,1,1,1,1
2,2,2,2,2
3,3,3,3,3
4,4,4,4,4
5,5,5,5,5
'''%}
```

Result:

<div class="highlight"><pre><span></span>{% csv &#39;&#39;&#39;
a,b,c,d,e
1,1,1,1,1
2,2,2,2,2
3,3,3,3,3
4,4,4,4,4
5,5,5,5,5
&#39;&#39;&#39;%}
</pre></div>

7.2. Templates

If I add to base.html:

{% csv '''
a,b,c,d,e
1,1,1,1,1
2,2,2,2,2
3,3,3,3,3
4,4,4,4,4
5,5,5,5,5
'''%}

I get an error in console:

CRITICAL: TemplateSyntaxError: Encountered unknown tag 'csv'.

Else as in this answer:

{{ csv '''
a,b,c,d,e
1,1,1,1,1
2,2,2,2,2
3,3,3,3,3
4,4,4,4,4
5,5,5,5,5
'''}}

I get another error:

CRITICAL: TemplateSyntaxError: expected token 'end of print statement', got 'string'

7.3. Jinja2content

I try enable jinja2content plugin:

PLUGINS = [
    'jinja2content',
    'loadcsv'
]

No effect.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.