I would also suggest that this is a use case for a custom inline macro. The
inline macro would provide the common information, then emit two or more
links into the output.

For reference, see
https://asciidoctor.org/docs/user-manual/#inline-macro-processor-example

Cheers,

-Dan

On Sun, Oct 14, 2018 at 4:52 PM Lex Trotman <[email protected]> wrote:

> I'm not sure I understand your problem.  If you can enter one link as
> `https://gitlab.com/usr/prj/blob/master/Doc/Manual.asciidoc`
> <https://gitlab.com/usr/prj/blob/master/Doc/Manual.asciidoc> why can't
> you enter the other as
> `https://gitlab.com/usr/prj/raw/master/Doc/Manual.asciidoc`
> <https://gitlab.com/usr/prj/raw/master/Doc/Manual.asciidoc> ?
>
> And please provide a MINIMAL "working" example source and the result
> that shows the problem.
>
> Cheers
> Lex
>
> On Sun, 14 Oct 2018 at 22:02, rdp via asciidoc
> <[email protected]> wrote:
> >
> > Good afternoon
> > Maybe, we have a strange use case, I start with the question and add the
> background afterward:
> >
> > The Question:
> > Can we do something like the following pseudocode in AsciiDoc
> > and get the result of link:, replace /blob/ by /raw/ and use the result
> as a new link?:
> >
> >> link:Replace(link:Doc/Manual.asciidoc,"/blob/","/raw/")
> >
> >
> > The Background is
> > that we would like to create two links to the same Sub-Document but with
> a slightly modified root path:
> >
> >>             https://gitlab.com/usr/prj/blob/master/Main.asciidoc
> >>
> >> » Links to: https://gitlab.com/usr/prj/blob/master/Doc/Manual.asciidoc
> >>
> >> » Links to: https://gitlab.com/usr/prj/raw/master/Doc/Manual.asciidoc
> >
> >
> > Creating the blob link is simple because AsciiDoc automatically adds the
> parent path:
> >
> > // Source File:
> > // https://gitlab.com/usr/prj/blob/master/Main.asciidoc
> >
> > // Link:
> > link:Doc/Manual.asciidoc
> >
> > // Result:
> > // https://gitlab.com/usr/prj/blob/master/Doc/Manual.asciidoc
> >
> > // Question: is it possible to calculate this URL?:
> > // https://gitlab.com/usr/prj/raw/master/Doc/Manual.asciidoc
> >
> >
> >
> > Thanks a lot for any help and idea!,
> > kind regards,
> > Thomas
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "asciidoc" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> > To post to this group, send email to [email protected].
> > Visit this group at https://groups.google.com/group/asciidoc.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/asciidoc.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/d/optout.

Reply via email to