Code Monkey home page Code Monkey logo

no-can-transclude's Introduction

No Can Transclude!

Want to transclude something on the Web? You can't...really.

Well...not without JavaScript...and often lots of it.

What's wanted

Transclusion of content from one resource into the render tree of another.

Usage

Run an HTTP server in this local directory and request http://localhost:8080 (or whatever port your server uses).

If you've got npm, use:

$ npm i -g http-server
$ http-server .

You'll see a boring/ugly set of HTML and CSS to see what's (im)possible.

Help Wanted

If you find a way to do this as minimally as possible, please send me a PR!

The ideal solution would be something baked into the browsers. Until then, as little JS as possible would be best.

So many options...so little success...

or

Less boarder than an iframe, but still no CSS inheritance.

Requires JS.

iframe seamless

The all-to-short-lived <iframe seamless> attribute would have (maybe) come close.

As originally defined (though not widely implemented) it allowed:

  • cascading of parent's styles
  • styles are override-able by child's styles
  • width and height based on the iframe's contents

Mainly, it seems to have failed due to trying to be too many things at once, and not any one thing successfully: https://labs.ft.com/2013/01/seamless-iframes-not-quite-seamless/

UC Browser for Android seems to be the only implementor.

seamless polyfills

Most of these focus on width/height calculation, but some explore CSS cascading from parent to child.

Non-standard, JS trickery

Bonus: A Publishing Carol.

This "bonus" content attempts to explore Web Publication concepts in the context of "transclusion" at the level we have it (which--as noted above--is nearly not at all).

More will be done on this elsewhere, but for now, enjoy the read.

License

MIT (for what little of this is actually license-able/usable)

no-can-transclude's People

Contributors

bigbluehat avatar dauwhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

no-can-transclude's Issues

Map this work agains the DPIG UCRs

https://w3c.github.io/dpub-pwp-ucr/#req_list

Number and reference Short description
Req. 1Web Publications should be able to make use of all features offered by the OWP
Req. 2A Web Publication should conform to the requirements of all horizontal dependencies
Req. 3The notion of a Web Publication should enable specific publications like audio books, graphics books, and mixed media
Req. 4A Web Publication needs to support both time-based media and text
Req. 5Web Publications should be able to include data as resources, just as it does with text, images, etc
Req. 6A Web Publication should also be available offline
Req. 7User agents must treat a Web Publication as a single logical resource with its own URL, beyond the references to individual, constituent resources
Req. 8There should be a way to uniquely identify a Web Publication
Req. 9All constitutent resources, and their contents, should be uniquely identifiable
Req. 10It should be possible to see the Web Publication in a “paginated” view
Req. 11The user must have the possibility to personalize his or her reading experience
Req. 12There should be a means to indicate the author’s preferred navigation structure among the resources of a Web Publication
Req. 13Authors of a Web Publication should be able to provide the user agent with information to access random parts of the publication
Req. 14The information regarding the constituent resources of a Web Publication must be easily discovered and there should be a way to differentiate between essential and non-essential resources
Req. 15A Web Publication should be able to express the access control and write protections of the publication
Req. 16Web Publications should include technical and descriptive metadata as well as any additional characteristics of the constituent resources.
Req. 17It should be possible to create and distribute a Web Publication as a single unit over different protocols or physical media
Req. 18The distribution of a Packaged Web Publication should not affect its iterations
Req. 19The distribution of Packaged Web Publications should respect the existing processes and expectations of professional publishing channels as well as ad-hoc methods of distribution (eg. email).
Req. 20There should be a way to indicate whether one or more Packaged Web Publication components contain (embedded) descriptive metadata
Req. 21There should be a way to discover that one or more new components have been added to or deleted from a Web Publication
Req. 22A PWP should include means to map the identification of a constituent resource between the Web and its equivalent in a package
Req. 23The publisher should be able to provide information in a Portable Web Publication proving that the publication has not been tampered with during delivery.
Req. 24The publisher should be able to provide information in a Portable Web Publication that can be used to check the origin of the publication and its authenticity.
Req. 25User agents may provide a method for escalating trust for a specific publication

Intra-publication links

These... are a problem. A fragment link within a single document works fine. But linking from iframe to iframe is much, much trickier. You can target the other iframe, but it doesn't work with our :target css, and even if all iframe are visible a UA won't scroll to the "active" one.

I'm hoping I'm missing something obvious.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.