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

Table Thingy #12

Closed
bennyboer opened this issue Jul 20, 2020 · 8 comments · Fixed by #56
Closed

Table Thingy #12

bennyboer opened this issue Jul 20, 2020 · 8 comments · Fixed by #56
Labels
enhancement New feature or request thingy
Projects
Milestone

Comments

@bennyboer
Copy link
Owner

A Thingy #TABLE# to create tables.

@bennyboer bennyboer created this issue from a note in v0.1 (To do) Jul 20, 2020
@bennyboer bennyboer added this to the v0.1 milestone Jul 20, 2020
@bennyboer bennyboer added thingy enhancement New feature or request labels Jul 21, 2020
@bennyboer
Copy link
Owner Author

Things to consider

  • Import from CSV or HTML file (for example ``#TABLE, src="my-file.csv"#`
  • Specify content directly: #TABLE, '<table><!--...--></table>'# using HTML pr CSV to specify tables
  • Styling for tables: Maybe #TABLE, style=TABLE_STYLE# for a custom style? TABLE_STYLE should be in the style file. We probably need a new table-specific style block.
  • Should also support captions

@bennyboer bennyboer moved this from To do to Ready in v0.1 Sep 6, 2020
@bennyboer bennyboer moved this from Ready to To do in v0.1 Sep 28, 2020
@bennyboer bennyboer moved this from To do to In progress in v0.1 Oct 4, 2020
@bennyboer bennyboer self-assigned this Oct 4, 2020
@bennyboer
Copy link
Owner Author

bennyboer commented Oct 5, 2020

TODO

  • General table layout logic
    • Support for layouting table cells
    • Support for merging cell spans
    • Support for setting individual row and column sizes
  • Create table thingy
    • new table paragraph type and handler
    • Option src for specifying a CSV file
    • When option src is not specified we are looking into the first argument of the thingy for the table contents
    • Option format defined the input format we expect. For v0.1 we will only support CSV.
      • format=CSV we expect CSV format. This allows the use of the csv-separator option where you can define a custom separator to use for CSV parsing. Default separator is |.
    • Option class should work by taking the proper table style to use. This way you can style individual tables using the Thaw style file the way you want!
    • Option caption and caption-prefix to generate a caption like for images or code paragraphs.
  • New style selectors specifically for a table thingy
    • Basic selector for tables: table. e. g. table { font-size: 14pt; }. This should select all table thingies.
    • Selecting a specific class of table using table.my-special-class { ... }.
    • Selecting a specific row using table.my-special-class:row(1). Will select the first row of a table with class my-special-class.
    • Selecting a specific column using table.my-special-class:column(1). Same as for rows.
    • Selecting a range of rows using table.my-special-class:rows(1, 5) should select the first to the fifth row.
    • Selecting a range of columns using table.my-special-class:columns(2, 3). See above for selecting multiple rows.
    • Selecting a specific cell using table.my-special-class:cell(1, 1). Should select the cell in the first row and column.
    • Selecting a range of cells using table.my-special-class:cells(1, 1, 3, 3). Should select all cells in rows 1, 2 and 3 and columns 1, 2 and 3.
    • Priority of applying the pseudo selectors is cell, row, column, rows, columns, where cell is the most important and columns is the least important.

Using the style selectors you should be able to style each table the way you need it.

For example you should be able to

  • ... set individual borders to single cells or rows and columns
  • ... set indivdual background colors to single cells or rows and columns
  • ... set indivdual sizes to rows and columns (cells not supported)
  • ... merge cells to cell spans using something like table.my-special-class:cells(1, 1, 3, 3) { merge: true; }
  • ... horizontally and vertically align cell contents using both text-align and vertical-align.

@bennyboer
Copy link
Owner Author

Branch is table.

@bennyboer
Copy link
Owner Author

The general table layout logic has been implemented. It should suffice our layouting needs as it even supports cell span merging.

@bennyboer
Copy link
Owner Author

We need to change the selector:

  • table will only mean the table paragraph itself (no pseudo-classes allowed)
  • table-cell will take the place of the old table selector (having pseudo-classes cells, cell, row, ...)

We need this separation to allow specific margin and padding to the whole table as well as individual cells.

@bennyboer
Copy link
Owner Author

Only the general margin and padding of the table has to be applied and the caption typeset for the issue to be closed.

@bennyboer
Copy link
Owner Author

bennyboer commented Oct 7, 2020

Leftovers

  • Typeset caption
    • Get caption and caption-prefix from thingy
  • Apply general table margin and padding from table style block (with correct class!)
  • Handle when we have no more space available for the next row (push new page)

bennyboer added a commit that referenced this issue Oct 8, 2020
@bennyboer bennyboer linked a pull request Oct 8, 2020 that will close this issue
@bennyboer
Copy link
Owner Author

Merged to master branch. Issue is thereby done.

v0.1 automation moved this from In progress to Done Oct 8, 2020
@bennyboer bennyboer removed their assignment Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request thingy
Projects
v0.1
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant