Giter Site home page Giter Site logo

Comments (15)

miekg avatar miekg commented on September 21, 2024 1

no, why?

from mmark.

miekg avatar miekg commented on September 21, 2024 1

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

from mmark.

miekg avatar miekg commented on September 21, 2024 1

update the code and docs to make this work, but you'll still need an subimage.

from mmark.

miekg avatar miekg commented on September 21, 2024

name should probably be the last element of the url or file being referenced.

from mmark.

dericed avatar dericed commented on September 21, 2024

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.

from mmark.

dericed avatar dericed commented on September 21, 2024

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.

from mmark.

dericed avatar dericed commented on September 21, 2024

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.

from mmark.

miekg avatar miekg commented on September 21, 2024

ok, but this is just using the HTML fall-through, that works because HTML ~= XML. Good to know though.

from mmark.

SamuelMarks avatar SamuelMarks commented on September 21, 2024

Any progress on this issue?

from mmark.

dericed avatar dericed commented on September 21, 2024

Using svg in the form of ![alt](context.svg "context") works for me; however, I have to:

  • change the resulting alt="alt" to type="svg"
  • remove any parent <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.

from mmark.

miekg avatar miekg commented on September 21, 2024

Getting type type from the file and using that doesn't seem too hard to implement.

from mmark.

miekg avatar miekg commented on September 21, 2024

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>

from mmark.

SamuelMarks avatar SamuelMarks commented on September 21, 2024

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.

from mmark.

miekg avatar miekg commented on September 21, 2024

from mmark.

miekg avatar miekg commented on September 21, 2024

Merged this, the <t> will be outputted, unless you use a subfigure.

from mmark.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.