-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
193 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
**STRUCT** | ||
# `MarkdownTable` | ||
|
||
**Contents** | ||
- [Properties](#properties) | ||
- `markdown` | ||
- [Methods](#methods) | ||
- `init(headers:data:)` | ||
|
||
**Declaration** | ||
```swift | ||
public struct MarkdownTable: MarkdownConvertible | ||
``` | ||
|
||
**Infered Type** | ||
```swift | ||
MarkdownTable.Type | ||
``` | ||
|
||
Render a two dimmensional Markdown table. | ||
|
||
| | Name | Department | | ||
| - | ---- | ---------- | | ||
| 🍏 | Apple | Fruits | | ||
| 🍊 | Orange | Fruits | | ||
| 🥖 | Bread | Bakery | | ||
|
||
*Notes*: | ||
- Markdown tables are not supported by all Markdown readers. | ||
- Table headers are required. | ||
- Table cells cannot contain multiple lines. New line characters are replaced by a space. | ||
|
||
-------------------- | ||
|
||
## Properties | ||
### `markdown` | ||
|
||
**Declaration** | ||
```swift | ||
public var markdown: String | ||
``` | ||
|
||
**Infered Type** | ||
```swift | ||
String | ||
``` | ||
|
||
Generated Markdown output | ||
|
||
-------------------- | ||
|
||
## Methods | ||
### `init(headers:data:)` | ||
|
||
**Declaration** | ||
```swift | ||
public init(headers: [String], data: [[String]]) | ||
``` | ||
|
||
**Infered Type** | ||
```swift | ||
(MarkdownTable.Type) -> ([String], [[String]]) -> MarkdownTable | ||
``` | ||
|
||
MarkdownTable initializer | ||
|
||
- Parameters: | ||
- headers: List of table header titles. | ||
- data: Two-dimensional `String` array with the table content. Rows are defined by | ||
the outer array, columns are defined by the inner arrays. | ||
|
||
An array of rows, each row containing an array of columns. All rows should contain the same | ||
number of colums as the headers array, to avoid formatting issues. | ||
|
||
#### Parameters | ||
| Name | Description | | ||
| ---- | ----------- | | ||
| `headers` | List of table header titles. | | ||
| `data` | Two-dimensional `String` array with the table content. Rows are defined by the outer array, columns are defined by the inner arrays. | ||
An array of rows, each row containing an array of columns. All rows should contain the same number of colums as the headers array, to avoid formatting issues. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters