Skip to content

Add support for row- and column-span in tables #385

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

Merged
merged 4 commits into from
Sep 21, 2022

Conversation

QuietMisdreavus
Copy link
Contributor

Bug/issue #, if applicable: rdar://98017880

Summary

This PR loads the new Markdown support for row- and column- span in tables and emits it in Render JSON. For more information about the Markdown syntax, see the swift-cmark PR linked below.

Dependencies

Testing

Use the following sample Markdown to test the new feature:

| one | two | three |
| --- | --- | ----- |
| big      || small |
| ^        || small |

Steps:

  1. Add the above Markdown to Swift-DocC's top-level article.
  2. Build the above-linked Swift-DocC-Render PR and add the resulting dist directory to the DOCC_HTML_DIR environment variable.
  3. swift run docc preview Sources/SwiftDocC/SwiftDocC.docc --fallback-display-name SwiftDocC --fallback-bundle-identifier org.swift.SwiftDocC --fallback-bundle-version 1.0.0
  4. Compare the added content to the below screenshot.

image

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

QuietMisdreavus and others added 4 commits September 21, 2022 19:03
`extendedData` provides supplementary per-cell data for tables. It's
indexed with a generated string key with the format 'X_Y', as described
in its "description" field. For the most part this can be omitted, but
here it introduces the 'colspan' and 'rowspan' properties, with the
following semantics:

- the default value of each of these is 1. the property will be absent
  in this case.
- if all values in an `extendedData` object are the default, it will not
  be included in the Render JSON.
- a value greater than one has the same semantic meaning as the
  attributes of the same name on the HTML `tr`/`th` elements - that
  this cell should fill in the space of more than one column and/or row.
- a value of zero means that the cell should not be rendered in HTML
  because another cell has a span that overwrites it.
@QuietMisdreavus
Copy link
Contributor Author

Rebased.

@swift-ci Please test

@QuietMisdreavus QuietMisdreavus merged commit 9efd8c7 into swiftlang:main Sep 21, 2022
@QuietMisdreavus QuietMisdreavus deleted the table-spans branch September 21, 2022 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants