halostatue

halostatue

TableauRefLinkExtension - Resolve Reference LInks in Tableau

Over the last several months, I’ve been using Tableau to rebuild my long-neglected website. Tableau is part of the Elixir Tools project headed by @mhanberg, and is built on top of MDEx by @leandrocp. This library is one of ten libraries and Elixir extensions that I built. Most of these were built with the assistance of Kiro.

TableauRefLinkExtension is a Tableau extension that resolves “reference links” to pages, posts, and static assets without to know the precise URL of the referenced comments. This works with elements supporting the href or src attributes.

  • Links: <a>, <link>
  • Media: <img>, <audio>, <video>, <source>, <track>
  • Embedded: <embed>, <iframe>, <script>

A reference link in this context is a partial link ($ref:<content-file> or $site:<path>) that is resolved against the content of the site with the configured base URL. I use this in my site for referencing my licence page ($ref:licence.md) so that if I move it from /licence to /about/licence it will be resolved correctly without having to find and resolve all locations.

Content Link Resolution ($ref:<content>)

Links with $ref:<content> resolve to content files (pages, posts) or static assets.

[My Post]($ref:_posts/2024-01-15-my-post.md)
[About Page]($ref:_pages/about.md)
![Logo]($ref:logo.png)
[With Anchor]($ref:post.md#section)
<a href="/posts/2024/01/15/my-post">My Post</a>
<a href="/about">About Page</a>
<img src="/logo.png" alt="Logo">
<a href="/posts/post#section">With Anchor</a>

If the content reference is just the filename (no /), files are searched across all content and static assets.

[My Post]($ref:my-post.md)

If the content reference is a path (contains /), the file paths are matched from the workspace root.

[Specific Post]($ref:_posts/2024-01-15-my-post.md) [Asset]($ref:images/logo.png)

$ref links are resolved from content before static assets. Missing references ($ref:no-file.md) become #ref-not-found:path with a logged warning. Ambiguous matches ($ref:one.md) use the first match with a logged warning.

Site Link Resolution ($site:<path>)

Links with $site:<path> resolve to files relative to the site base URL.

[Download PDF]($site:downloads/guide.pdf)
[Secret File]($site:secret/file.txt)
<a href="/base/downloads/guide.pdf">Download PDF</a>
<a href="/base/secret/file.txt">Secret File</a>

No content lookup or validation is performed.

https://github.com/halostatue/tableau_ref_link_extension

Where Next?

Popular in Announcing Top

wmnnd
Hi there, for my project DBLSQD, I needed a file storage solution that is a bit more flexible than Arc. Because I thought others might f...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
mikehostetler
I’m excited to announce Jido, a framework providing foundational primitives for building autonomous agent systems in Elixir. While develo...
New
bryanjos
Hi, I just published version 0.23.0 of Elixirscript. https://github.com/bryanjos/elixirscript/blob/master/CHANGELOG.md Most of the chan...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
fuelen
Hey folks! Want to present a toolkit for writing command-line user interfaces. It provides a convenient interface for colorizing text...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New

Other popular topics Top

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement