```
function parentChunk() {
console.log("let's include another chunk below");
// [[Included chunk name]]
}
```function parentChunk() {
console.log("let's include another chunk below");
// Included chunk name <---- link to the tiddler! <a> tags are allowed inside <pre> and <code> ones AFAIK
}codeNode.appendChild(this.document.createTextNode(this.getAttribute("code"))); var t = this.getAttribute("code").split(/(\[\[.+?\]\])/);
for (var i = 0; i < t.length; i++) {
if (i % 2 === 0) {
codeNode.appendChild(this.document.createTextNode(t[i]));
} else {
var a = this.document.createElement("a");
var s = t[i].slice(2, -2);
a.setAttribute("href", "#" + encodeURIComponent(s));
a.appendChild(this.document.createTextNode(s));
codeNode.appendChild(a);
}
}
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4b8aaa19-0640-4f46-9101-9a755496bbae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The approach could be made more convenient by using a template and invoking it with a macro.
Hi!
Mario is right, \rules solution doesn't work well in my situation. I've spent entire morning playing with it, but decided to write custom parser: https://gist.github.com/ul/bdd6c6d6715b8ed36348304c973a91afCustom parser is better than custom widget because you not only get links, but proper reference handling, missing, orphans etc.
{{Included chunk name}} instead of [[Included chunk name]] it should be possible to create tangled source output out of the box, with some custom rendering templates.
So your code snippet would look like this:
```
function parentChunk() {
console.log("let's include another chunk below");
{{Included chunk name}}
}
```
The point of using links is to not transclude referenced chunks on the render, but only during the tangling process. Usually, you want to read literate code folded, but with an ability to jump quickly to included chunks.
...decided to write custom parser: https://gist.github.com/ul/bdd6c6d6715b8ed36348304c973a91af