iilab / contentascode

Content as Code
http://iilab.github.io/contentascode
GNU General Public License v3.0
34 stars 7 forks source link

Transclusion of blocks via fragment identifiers #32

Open jmatsushita opened 8 years ago

jmatsushita commented 8 years ago

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 commented 8 years ago

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:

Maybe the problem can be split in:

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

poser commented 6 years ago

@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