Comments (7)
For what is worth we are working towards a referencing based on explicit ids – https://github.com/refractproject/refract-spec/blob/master/refract-spec.md#link-enum this is currently in the underlaying data format and not just yet in the API Blueprint itself.
from hercule.
Thanks @zdne. That's useful to know.
from hercule.
Are there any plans to support partial file transclude based on line numbers or regular expressions?
Supporting partial transclude based on markdown structure is in fact useful when transcluding markdown files but not when referencing source code parts for instance.
from hercule.
@gautaz thanks for the input. No specific plans to add this at the moment, but this is primarily because I haven't had the need for it nor has anyone asked for it until now.
If there was significant interest from others too or if someone were to open a PR, I'd be happy to review, help out and merge a contribution adding this feature.
from hercule.
My first concern about adding partial transclusion based on line numbers or regexes is the format of the markdown link.
To follow the initial proposal based on markdown sections, for line numbers, the format could be the one used by github:
:[link to something](sourcefile.lang#L32-L56)
For regexes, I am still wondering what would be the right format, perhaps something like:
:[link to something](sourcefile.lang#/start-regex/stop-regex/)
Feel free to add your own proposals.
from hercule.
Sorry for reviving this old thread.
I've published a new version (4.0.0-beta.1
) to npm which opens up a new API for resolving links. A resolve function basically receives the link portion of the transclusion link (file.md#section-6
of :[link to something](file.md#section-6)
) and returns a stream or string to be transcluded.
If partial file transclusion is important the new API allows you to implement this by simply passing in your own function instead of the builtin resolvers.
from hercule.
Closing, but happy to re-open in future if you want to discuss further.
from hercule.
Related Issues (20)
- Size limitation on linked local files HOT 4
- Resolver argument source equals "string" HOT 5
- Escaping? HOT 11
- Resolvers per link or per document? HOT 7
- Smart heading levels
- Provide placeholder context to resolver HOT 3
- Tagged docker images HOT 1
- docs: fix inaccurate reference example
- Is it possible to load multiple gist file from a folder? HOT 1
- Promise support HOT 2
- Removed sync API (pre 4.x) doesn't work on Windows HOT 3
- Test hercule CLI works on Windows HOT 1
- Refactor http resolver into separate npm package
- Version 10 of node.js has been released HOT 1
- An in-range update of eslint-plugin-import is breaking the build 🚨 HOT 11
- An in-range update of prettier is breaking the build 🚨 HOT 2
- An in-range update of nock is breaking the build 🚨 HOT 2
- An in-range update of babel7 is breaking the build 🚨 HOT 10
- Missing file in 5.1.2: lib/promises.js HOT 3
- Add support for Obsidian transclusion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hercule.