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

Markdown table support #2857

Open
podborski opened this issue May 16, 2024 · 1 comment
Open

Markdown table support #2857

podborski opened this issue May 16, 2024 · 1 comment

Comments

@podborski
Copy link
Contributor

Where is bikeshed on markdown table support? I'm investigating the possibilities of how I can best port the AV1 specification to bikeshed.

Take a look at this file for example 06.bitstream.syntax.md. Basically, every single syntax element is defined in a table, and I want to avoid writing HTML for each table.

I see there was a quite extensive discussion in #1128 on this topic and it seems like there was no agreement on adding this. Is this still the case? If yes, what would be the best way forward for me?

PS: Also it would be good to document that the markdown tables are not supported. At least I could not find anything about it in the documentation.

@tabatkins
Copy link
Collaborator

Right, I'm still moderately against Markdown tables. They don't actually save you any meaningful typing over just using HTML with omitted end tags, and they're (by a significant margin) more complex to parse than any other block. The main reason they're used is because many Markdown processors just don't support HTML, or don't support mixing it with Markdown well; Bikeshed very intentionally supports mixing the two syntaxes well.

PS: Also it would be good to document that the markdown tables are not supported. At least I could not find anything about it in the documentation.

Right, that's because "Markdown tables" aren't Markdown - they're just a common extension. The docs are clear that I support CommonMark with some documented exceptions and additions.

Parsing is... ill-defined, generally, for tables. For example, the first table in the page you link is making some interesting assumptions about how the table syntax parses. Instead, it could be written:

<table class=syntax>
	<tr>
		<td>
			<pre>
			open_bitstream_unit( sz ) {
			    obu_header()
			    if ( obu_has_size_field ) {
			        @@obu_size
			    } else {
			        obu_size = sz - 1 - obu_extension_flag
			    }
			    startPosition = get_position( )
			    if ( obu_type != OBU_SEQUENCE_HEADER &&
			         obu_type != OBU_TEMPORAL_DELIMITER &&
			         OperatingPointIdc != 0 &&
			         obu_extension_flag == 1 )
			    {
			        inTemporalLayer = (OperatingPointIdc \>\> temporal_id ) & 1
			        inSpatialLayer = (OperatingPointIdc \>\> ( spatial_id + 8 ) ) & 1
			        if ( !inTemporalLayer \|\| ! inSpatialLayer ) {
			            drop_obu( )
			            return
			        }
			    }
			    if ( obu_type == OBU_SEQUENCE_HEADER )
			        sequence_header_obu( )
			    else if ( obu_type == OBU_TEMPORAL_DELIMITER )
			        temporal_delimiter_obu( )
			    else if ( obu_type == OBU_FRAME_HEADER )
			        frame_header_obu( )
			    else if ( obu_type == OBU_REDUNDANT_FRAME_HEADER )
			        frame_header_obu( )
			    else if ( obu_type == OBU_TILE_GROUP )
			        tile_group_obu( obu_size )
			    else if ( obu_type == OBU_METADATA )
			        metadata_obu( )
			    else if ( obu_type == OBU_FRAME )
			        frame_obu( obu_size )
			    else if ( obu_type == OBU_TILE_LIST )
			        tile_list_obu( )
			    else if ( obu_type == OBU_PADDING )
			        padding_obu( )
			    else
			        reserved_obu( )
			    currentPosition = get_position( )
			    payloadBits = currentPosition - startPosition
			    if ( obu_size > 0 && obu_type != OBU_TILE_GROUP &&
			         obu_type != OBU_TILE_LIST &&
			         obu_type != OBU_FRAME ) {
			        trailing_bits( obu_size * 8 - payloadBits )
			    }
			}
			</pre>
		<td>
			**Type**

			leb128()
</table>

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

No branches or pull requests

2 participants