However, we think that row and column spanning is a common enough feature that it’s worth extending Markdown in a backwards compatible way to support it here without requiring folks to migrate to an entirely different syntax to achieve this behavior. It’s likely we’ll still want something like this in the future since Markdown tables don’t support multi-line content. Instead of extending Markdown syntax further, we could create a new Swift-DocC directive to support this kind of table layout. We’re definitely interested in feedback on this point in particular. Additionally, the caret is already used in the Swift community to represent a custom attribute in an attributed string so overloading that punctuation further could lead to confusion. I think the ditto symbol is a better choice since it is already intended for this purpose in hand writing, while the caret symbol is generally used to represent an arrow. This symbol has come up in several other proposals on this topic so has the potential to be the more readable and commonly understood symbol. The primary alternative we’re considering to the above proposal is using the caret ( ^) symbol in place of the ditto symbol ( "): | Sloth name | Sloth colors | Sloth powers | Victoria has put together an implementation of this pitch in the swift-cmark repository. We think introducing the new ditto mark syntax and enhancing the existing pipe syntax strikes a good balance of maintaining compatibility with existing Markdown tooling while bringing new features to Swift-DocC and other clients of the Swift Project’s fork of cmark-gfm. Screenshot of a GitHub readme showing the rendered version of the preceding markdown table. Given that input, Swift-DocC would render the following table: | Sloth name | Sloth colors || Sloth powers || In our example table that would look like: # Examples The number of pipes equals the number of columns the cell should span. If the cell in question is at the end of the row, then of course that means that pipes are not optional at the end of that row…. To indicate that a cell should span multiple columns, then simply add additional pipes (|) at the end of the cell, as shown in the example. The ditto mark would be escaped with \" to indicate that the quotation mark should be rendered literally.įor column spanning, we think adopting an existing syntax from MultiMarkdown is the best path forward: | Sloth name | Sloth colors | Sloth powers | Here’s an example of a Markdown table that includes row spanning with the new ditto syntax: # Examples In a Markdown table it would be used for this same purpose – to indicate that the above cell contains information that should be conveyed in the current one. It’s often used in math since it can more clearly convey what is actually changing between two lines of an equation. The ditto mark is generally used in hand-writing as a shorthand to indicate that a given line should be the same as the one above. – Ditto Definition & Meaning | Britannica Dictionary We propose adding the following syntax to Markdown tables: the “ditto mark”.Ī pair of marks " used underneath a word to save space and show that the word is repeated where the marks are By researching existing discussions on the topic in the CommonMark forums, we’ve developed a solution that preserves Markdown’s philosophy of using punctuation characters to convey formatting in a way that is still readable in plain text and renders in a reasonable way with standard Markdown parsers. Proposed Solutionįor row spanning specifically, there isn’t much prior art in commonly-used, shipping Markdown parsers for us to pull from. In keeping with the philosophy of Markdown, we’d like to enhance the Swift Project’s fork of GitHub Flavored Markdown to add support for this feature in a way that continues to be backwards compatible with standard Markdown parsers. Row and column spanning is a common tool documentation authors reach for when conveying complex information in a table but is currently unsupported in both CommonMark and GitHub Flavored Markdown. This will affect existing clients of Swift’s cmark-gfm fork who choose to opt into the enhancement – including Swift Markdown and Swift-DocC. Victoria ( and I are excited to pitch an enhancement to Swift-DocC’s Markdown support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |