Coder Social home page Coder Social logo

Comments (7)

zdne avatar zdne commented on August 16, 2024

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.

jamesramsay avatar jamesramsay commented on August 16, 2024

Thanks @zdne. That's useful to know.

from hercule.

gautaz avatar gautaz commented on August 16, 2024

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.

jamesramsay avatar jamesramsay commented on August 16, 2024

@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.

gautaz avatar gautaz commented on August 16, 2024

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.

jamesramsay avatar jamesramsay commented on August 16, 2024

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.

jamesramsay avatar jamesramsay commented on August 16, 2024

Closing, but happy to re-open in future if you want to discuss further.

from hercule.

Related Issues (20)

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.