Closed miekg closed 5 years ago
name should probably be the last element of the url or file being referenced.
I'd really like to use this feature. For me, when I include ![alt](img.svg "title")
the rendered output in the xml is
<t>
<artwork src="img.svg" alt="alt" name="title"/>
</t>
which gives an error with xml2rfc 2.12.3
Warning: No 'type' attribute value provided for <artwork>, cannot process source img.svg
Warning: No image data found in source img.svg
Error: Expected ascii-art artwork for <artwork type="">, but found <artwork xmlns:xi="http://www.w3.org/2001/XInclude" src="img.svg" alt="alt" name="title" alig...
but when I remove the alt flag and add a type flag such as <artwork type="svg" name="title" src="img.svg"/>
then the xml works in xml2rfc works as expected.
Just wanted to note that piping the mmark output through sed to change the artwork attribute is working for me, such as:
mmark test.md | sed 's|alt="alt"|type="svg"|g' > output.xml
However my next issue is that when I convert that output.xml to html with xml2rfc, the first svg looks good but the subsequent ones seem like a malformed version of that svg mixed with the first svg.
Just noting that I have this working without needing to remove the alt
attribute. Also I fixed the malformed looking non-first svg issue but ensuring that the id attributes in each svg are unique. So in general, using svg works if type="svg"
is added.
ok, but this is just using the HTML fall-through, that works because HTML ~= XML. Good to know though.
Any progress on this issue?
no, why?
Using svg in the form of ![alt](context.svg "context")
works for me; however, I have to:
alt="alt"
to type="svg"
<t>
elements. <artwork>
is not permitted as a child of <t>
but is allowed to be a child of <section>
and some others.So by using xmlstarlet to edit the mmark xml output with those two changes, then I can get xml2rfc to render the rfc.
Getting type type from the file and using that doesn't seem too hard to implement.
Ok, having this:
Just take a look at
![alt](context.svg "context")
this image
resuts into this now:
<t>Just take a look at
<artwork src="context.svg" type="alt" name="context"/>
this image</t>
which apart from the <t>
s should be good. Stripping those <t>
is doable but may only make sense if an image is the only thing in the paragraph? Alternatively a image may surround itself with closing and opening <t>
I think you should just use a subfigure in this case:
Just take a look at
!---
![alt](context.svg "context")
!---
this image
This works and doesn't create the complexities an image creates
update the code and docs to make this work, but you'll still need an subimage.
Am I missing something? - Using mmark 2.0.45 with xml2rfc 2.22.3. image.md is yours.
$ mmark image.md > imaged.xml
$ xml2rfc --v3 imaged.xml
Parsing file imaged.xml
Converting v2 to v3: imaged.xml
Traceback (most recent call last):
File "/usr/local/bin/xml2rfc", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/xml2rfc/run.py", line 545, in main
xmlrfc.tree = v2v3.convert2to3()
File "/usr/local/lib/python3.7/site-packages/xml2rfc/writers/v2v3.py", line 334, in convert2to3
func(e, e.getparent())
File "/usr/local/lib/python3.7/site-packages/xml2rfc/writers/v2v3.py", line 610, in element_rfc
series = front.xpath('seriesInfo')
AttributeError: 'NoneType' object has no attribute 'xpath
It looks like it's missing the header stuff, seriesInfo
and what have you.
[ Quoting notifications@github.com in "Re: [mmarkdown/mmark] xml: images a..." ]
Am I missing something? - Using mmark 2.0.45 with xml2rfc 2.22.3. image.md is yours.
this hasn't been released, you'll need to run it from master. Then still you can't transform a snippet and convert that to text, because xml2rfc expect a whole bunch of meta data.
/Miek
-- Miek Gieben
Merged this, the <t>
will be outputted, unless you use a subfigure.
for rfc7991 output we can't output images as artwork, as a image element is not an (block)level artwork, this means we must inhibit outputting
<t>
s, but that is hard. Also using the title for the name attribute looks weird.A figureblock works, but must be present in the markdown code.