Skip to content

[Question] Use markers instead of line numbers #27

@marcinkunert

Description

@marcinkunert

Is there a way of embedding code using some kind of markers instead of line numbers?

Let's say I have this file:

import sth
import sth not important

fun myFun() {
 stuff here
 stuff here
}

I've embedded the myFun() part: L4-L7

fun myFun() {
 stuff here
 stuff here
}

Afterward I've noticed one of the imports is not important, so I delete it from the code base,

import sth

fun myFun() {
 stuff here
 stuff here
}

but forget to update the embedded line numbers, so the embedded part looks like this:

 stuff here
 stuff here
}

I'm aware that instead of pointing to a branch, I can point to a commit/permalink, which won't change. But this is also a disadvantage, since the code samples would show something outdated.

I was thinking if there is a way to embed code using some kind of markers. I've tried googling it, but no luck so far. Maybe you could point me to something useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions