Was inspired by @fasterthanlime's blog showcase and decided I also wanted to add the "click on any paragraph and open it in my editor" for my static site.
-
Was inspired by @fasterthanlime's blog showcase and decided I also wanted to add the "click on any paragraph and open it in my editor" for my static site.
Not 100% perfect but it works well enough.
-
Was inspired by @fasterthanlime's blog showcase and decided I also wanted to add the "click on any paragraph and open it in my editor" for my static site.
Not 100% perfect but it works well enough.
excuse the massive video I was too lazy to rearrange my widescreen desktop for this recording.
-
Was inspired by @fasterthanlime's blog showcase and decided I also wanted to add the "click on any paragraph and open it in my editor" for my static site.
Not 100% perfect but it works well enough.
@pixel @fasterthanlime how does one even do that
-
@pixel @fasterthanlime how does one even do that
I wrote a plugin for the markdown parser of my static site generator that wraps paragraphs in a clickable div
the parser knows where the tokens are and you can deduct the line number from that
and then you just open (for VS Code for example) vscode://file/{filepath}:{line}
-
V volpeon@icy.wyvern.rip shared this topic
-
I wrote a plugin for the markdown parser of my static site generator that wraps paragraphs in a clickable div
the parser knows where the tokens are and you can deduct the line number from that
and then you just open (for VS Code for example) vscode://file/{filepath}:{line}
@pixel @fasterthanlime thats cool!
-
@pixel @fasterthanlime thats cool!
@pixel@desu.social @fasterthanlime@hachyderm.io @4censord@unfug.social I actually was right. Haha
I wonder how you determine the file path though. -
@pixel@desu.social @fasterthanlime@hachyderm.io @4censord@unfug.social I actually was right. Haha
I wonder how you determine the file path though.@kura @4censord @fasterthanlime my SSG passes the entire site context into the parser so I have access to the page object with the full file path!
it was a bit trickier to get the proper offset with the frontmatter because my SSG strips that before passing the markdown content to the parser...I just load the file again to get the line count and cache that for the runtime.
-
@kura @4censord @fasterthanlime my SSG passes the entire site context into the parser so I have access to the page object with the full file path!
it was a bit trickier to get the proper offset with the frontmatter because my SSG strips that before passing the markdown content to the parser...I just load the file again to get the line count and cache that for the runtime.
@4censord@unfug.social @fasterthanlime@hachyderm.io @pixel@desu.social but are you using absolute paths or relative paths to project root?
Thats what I meant. And how does relative work, if you do it that way? -
@4censord@unfug.social @fasterthanlime@hachyderm.io @pixel@desu.social but are you using absolute paths or relative paths to project root?
Thats what I meant. And how does relative work, if you do it that way?@kura I'm using absolute paths