Giter VIP home page Giter VIP logo

Comments (7)

benjamin-awd avatar benjamin-awd commented on July 17, 2024 1

@lamyergeier you can try https://github.com/astanin/python-tabulate -- it's pretty good at handling different types of markdown formats.

from csv2md.

lzakharov avatar lzakharov commented on July 17, 2024

Hello, thank you for the issue.

Columns are not aligned. Both, center and right alignment are not working.

What do you mean by that? As I can see, output contains right align colons in the header row. Can you please add expected output for this case?

Standardized input to option: -C option takes values like comma-separated list of column indices or ranges, may be similar syntax can be used for -r and -c.

You're right, it looks a bit inconsistent. But in my opinion, it's better to support multiple values for -C as it's done for -r and -c. Feel free to create PR with improvement.

Also if -r and -c is used with -C then the colmnn number for -r and -c should not be the affected by -C but original column number. Currently this is not the case!

I'm not sure if this is more expected behavior than the current ones. Can you please add some arguments for the proposed logic? Anyway, comments should be added to the flags.

from csv2md.

lamyergeier avatar lamyergeier commented on July 17, 2024

What do you mean by that? As I can see, output contains right align colons in the header row. Can you please add expected output for this case?

| a           |     b | c          |   d |
|:------------|------:|------------|----:|
| handwritten |   200 | 2024-04-29 |  36 |
| youtube     | 10000 | 2024-04-29 |  21 |
| firefox     |  5000 | 2024-04-29 |  39 |
| epub        |  1000 | 2024-04-29 |  49 |
| android     | 10000 | 2024-04-29 | 179 |

from csv2md.

lzakharov avatar lzakharov commented on July 17, 2024

Sorry, but this it not the right output:

  1. column a should be centered due to -c 0;
  2. values in b and d should not be aligned with spaces. Column alignment managed within the header row.

from csv2md.

lamyergeier avatar lamyergeier commented on July 17, 2024

@lzakharov Your point 1 is correct. I made a mistake in the desired output. It should be as follows

|      a      |     b | c          |   d |
|:-----------:|------:|------------|----:|
| handwritten |   200 | 2024-04-29 |  36 |
|   youtube   | 10000 | 2024-04-29 |  21 |
|   firefox   |  5000 | 2024-04-29 |  39 |
|    epub     |  1000 | 2024-04-29 |  49 |
|   android   | 10000 | 2024-04-29 | 179 |

as you can see that column with headers a, b, d are all aligned with spaces (which you clarified in second point of yours, that this is not desirable).

from csv2md.

lzakharov avatar lzakharov commented on July 17, 2024

There is no need to align columns with spaces - alignment must be done when rendering the markdown.

from csv2md.

lzakharov avatar lzakharov commented on July 17, 2024

If you want to have tables in such format, you can try to configure additional markdown formatter. But I'm still not sure that anyone uses and supports such a format.

from csv2md.

Related Issues (10)

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.