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

Transclusion of blocks via fragment identifiers #32

Open
jmatsushita opened this issue Apr 10, 2016 · 2 comments
Open

Transclusion of blocks via fragment identifiers #32

jmatsushita opened this issue Apr 10, 2016 · 2 comments

Comments

@jmatsushita
Copy link
Member

If we have a document.md file with this content:

# Title 1
Content 1.A
# Title 2
## Title 2.1
Content 2.B
## Title 2.2
Content 2.C
# Title 3
Content 3.D

I would like to be able to transclude a block inside this document for instance Content 2.C by using the syntax:

:[](document.md#title-2.2)
@jmatsushita
Copy link
Member Author

It could be that for linking the fragment identifier is meant as a location whether for transclusion it is understood as a container. In some context s it might be needed to qualify in order to explicitly we express whether one or the other is meant.

Techniques to keep track of fragments across changes could be:

  • assign a unique ID automatically to blocks (in the org mode way)
  • use a content addressability approach which links to the hash of a section's content.

Maybe the problem can be split in:

  • how to keep track of the evolution of content blocks (including splitting merging or removing)
  • how do links refer to a particular point in time.

It could be that web server would cache fragment retrieval sources in order to memorise what the client's expectations are. For larger volumes link versioning my be required so that the client refers to a particular point in time, minimising the effort on the server side.

HTTP moved status codes could be used to help update clients.

#12

jmatsushita added a commit to contentascode/metalsmith-transclude that referenced this issue Jan 14, 2018
@poser
Copy link

poser commented May 12, 2018

@jmatsushita

Inclusive section transclusion appears to over-transclude by a few characters:

index.md

# EtI Curriculum - TEST

Hi.

## Test transclusion

:[](test-folder/index##second-level-heading)

test-folder/index.md

# Test page

Hi again.

## Second-level heading

Second level heading text

### Third-level heading

Third level heading text

### Another third-level heading

More third level heading text

## Another second-level heading

More second level heading text

Result

overtransclusion

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

No branches or pull requests

2 participants