Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: links in paragraphs #112

Open
cwidhelm opened this issue Jun 3, 2021 · 8 comments
Open

Feature request: links in paragraphs #112

cwidhelm opened this issue Jun 3, 2021 · 8 comments

Comments

@cwidhelm
Copy link

cwidhelm commented Jun 3, 2021

Can you add support for a link tag?

Either in a paragraph or in a text block it would be nice to be able to inline a link $(Link -href "https://google.com" -target _blank -Label {Click Here}) so we can create more dynamic content linking to other resources.

@LordFrogprince
Copy link

I just did something where I needed to embed a link to a folder location in an HTML Email that was being generated.

What I did is use the TOC command with Please Click here: $Hyperlink and it did what I need to. The $Hyperlink was G Drive File Location

@rebelinux
Copy link

I think this would be a great feature!

@Atreidae
Copy link

This would be handy in Tables as well as Paragraphs, As this module is used heavily in AsBuiltReport this would allow us to have a table of configuration items, and then the clickable link to jump to that item.

For example, Say an object is comprised of multiple smaller objects. The table can link to each of those smaller objects.

@iainbrighton
Copy link
Owner

I think adding external/web links to paragraphs would be a fairly simple implementation.

{
    Paragraph {
        Text 'You can find the PScribo documentation examples'
        Link -Text 'Here' -Uri 'https://github.com/iainbrighton/PScribo/tree/dev/Examples' -Target New
    }
}

Would render this (Markdown doesn't support the target attribute)

You can find the PScribo documentation examples here

Adding them to tables would be a lot more difficult and would need further discussions before any implementation.

@iainbrighton
Copy link
Owner

This would be handy in Tables as well as Paragraphs, As this module is used heavily in AsBuiltReport this would allow us to have a table of configuration items, and then the clickable link to jump to that item.

For example, Say an object is comprised of multiple smaller objects. The table can link to each of those smaller objects.

@Atreidae you are talking about adding cross-references here - not external/web links? Adding support for this would be fairly straightforward for paragraphs, but a lot more involved for tables (just like with web links). I'll have a think about how it could be implemented.

@Atreidae
Copy link

Yes, that's correct, I'm looking for a way to implement similar functionality to tools like AudioCodes Ini file viewer.
With, Teams we have several objects that reference other objects (Dial Plans that reference multiple normalization rules, for example), and it's handy to be able to jump from one to another.

For example, see the aforementioned Ini viewer.
image

Clicking on this "2" takes us straight to the IP Group section to view the relevant entry.
image

As for the link subtype in the new paragraph method, that would still be very handy for references to external documentation.

image

@Atreidae
Copy link

Atreidae commented Jul 9, 2023

Had a play around this afternoon. I'm slowly wrapping my head around how this works.
This code is so much more beautiful than mine. Anyway.

I've hacked together a working implementation, just for text files for now,
dev...Atreidae:PScribo:dev
It takes a Link statement in a paragraph run and adds it via some changes to Out-TextParagraph

Hopefully, I'm sticking with the convention enough, if so, I keep developing and see if I can get it working with Word and HTML for linking to existing anchors.

@Atreidae
Copy link

@iainbrighton any thoughts before I keep going?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants