Dynamic links

28 views
Skip to first unread message

Vladimir100

unread,
May 17, 2016, 6:39:29 PM5/17/16
to concordion
During the Java test run, we generate array of URLs and would like to add them to the markdown results as the links.
So far, we were able to display them as a long comma-separated string.
Please help.

Thanks,
Vladimir

Nigel Charman

unread,
May 17, 2016, 7:57:26 PM5/17/16
to conco...@googlegroups.com
The echo command allows you to insert the results of evaluating an expression as text.

However, in your case, you'll want to insert the results as HTML since you want to add links. For this, you'll need the embed extension. Your java code would look something like:
@RunWith(ConcordionRunner.class)
@Extensions(EmbedExtension.class)
@ConcordionOptions(declareNamespaces={"ext", "urn:concordion-extensions:2010"})
public class MySpecFixture {
    public String getLinks() {
        return "<a href="...">link1<a/>";
    }
}

with the markdown spec something like:
[link](- "ext:embed=getLinks()")
There's a bit of documentation about this here.

Let us know if this solves it for you, and we'll add more details of this to the main documentation.
--
You received this message because you are subscribed to the Google Groups "concordion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion+...@googlegroups.com.
To post to this group, send email to conco...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion/31bbe649-5048-4f46-95d3-a3ed0feb03a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vladimir100

unread,
May 18, 2016, 8:18:00 PM5/18/16
to concordion
Thank you, Nigel. It works!
Reply all
Reply to author
Forward
0 new messages