Skip to content

Commit

Permalink
Addressing usnistgov#451: parameter insertion syntax in Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
wendellpiez committed Jul 18, 2019
1 parent b2dcf59 commit 54d14f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 47 deletions.
8 changes: 4 additions & 4 deletions build/metaschema/json/md-oscal-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
<q>"<text/>"</q>

<img alt="!\[{{$text}}\]" src="\({{$text}}\)"/>
<insert param-id="\{{{{$nws}}\}}"/>
<insert param-id="\{{\{{{{$nws}}\}}\}}"/>

<a href="\[{{$text}}\]">\(<text/>\)</a>
<code>`<text/>`</code>
Expand Down Expand Up @@ -447,16 +447,16 @@ Paragraph, \n\nand new paragraph

Bit of `code` here and there, such as one might have along with *italics*.

{ ac-4.4_prm_2 }
no insertion here: { ac-4.4_prm_2 }


Extra long x
y and z


Here's a text with a parameter insertion: { insert }
Here's a text with a *parameter* insertion: {{ insert }}

{insert-me}
{{insert-me}}

And interesting.

Expand Down
41 changes: 0 additions & 41 deletions build/metaschema/json/produce-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -313,40 +313,13 @@
</XSLT:for-each>
</xsl:template>

<!-- <XSLT:template match="array[@key='prose']" priority="11" mode="json2xml">
<XSLT:variable name="text-contents" select="string-join(string,'&#xA;')"/>
<XSLT:call-template name="parse">
<XSLT:with-param name="markdown-str" select="$text-contents"/>
</XSLT:call-template>
</XSLT:template>
<XSLT:template match="string[@key='prose']" priority="11" mode="json2xml">
<XSLT:call-template name="parse">
<XSLT:with-param name="markdown-str" select="string(.)"/>
</XSLT:call-template>
</XSLT:template>-->

<xsl:template name="render-markdown-field">
<XSLT:variable name="markup">
<XSLT:apply-templates mode="infer-inlines"/>
</XSLT:variable>
<XSLT:apply-templates mode="cast-ns" select="$markup"/>
</xsl:template>

<!--<xsl:template priority="2" match="define-field[exists(flag)]" mode="field-text">
<!-\- XXX to do: fetch value for alternative label -\->
<XSLT:apply-templates mode="json2xml" select="string[@key=('{$string-value-label}','{$markdown-value-label}')]"/>
</xsl:template>-->

<!--<xsl:template match="define-assembly[exists(json-key) and matches(@group-as,'\S')]">
<XSLT:template match="map[@key='{@group-as}']" priority="4" mode="json2xml">
<XSLT:apply-templates mode="#current"/>
</XSLT:template>
<xsl:next-match/>
</xsl:template>-->


<xsl:template match="define-assembly">
<xsl:variable name="group-names" select="distinct-values(key('references-by-name',@name)/group-as/@name)"/>
<xsl:variable name="single-match" as="xs:string" expand-text="true">*[@key='{@name}']</xsl:variable>
Expand Down Expand Up @@ -426,16 +399,6 @@
<XSLT:apply-templates mode="#current"/>
</XSLT:template>



<!-- drops all strings except those expecting the inline markup -->
<!--<XSLT:template match="string" mode="handle-inlines">
<XSLT:variable name="markup">
<XSLT:apply-templates mode="infer-inlines"/>
</XSLT:variable>
<XSLT:apply-templates mode="cast-ns" select="$markup"/>
</XSLT:template>-->

<XSLT:template match="string[@key='{$markdown-value-label}']" mode="json2xml">
<!--<XSLT:apply-templates select="." mode="handle-inlines"/>-->
<XSLT:call-template name="parse">
Expand All @@ -449,10 +412,6 @@

<XSLT:template mode="as-attribute" match="*"/>

<!--<XSLT:template mode="as-attribute" match="map">
<XSLT:apply-templates mode="#current"/>
</XSLT:template>-->

<XSLT:template mode="as-attribute" match="string[@key='id']" priority="0.4">
<XSLT:attribute name="id">
<XSLT:apply-templates mode="#current"/>
Expand Down
4 changes: 2 additions & 2 deletions build/metaschema/xml/produce-xml-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@

<!-- <insert param-id="ac-1_prm_1"/> -->
<XSLT:template mode="md" match="insert">
<XSLT:text>{ </XSLT:text>
<XSLT:text>{{ </XSLT:text>
<XSLT:value-of select="@param-id"/>
<XSLT:text> }</XSLT:text>
<XSLT:text> }}</XSLT:text>
</XSLT:template>

<XSLT:key name="element-by-id" match="*[exists(@id)]" use="@id"/>
Expand Down

0 comments on commit 54d14f3

Please sign in to comment.