Skip to content

question(usage): basic loadcsv usage #1

@Kristinita

Description

@Kristinita

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions