Giter VIP home page Giter VIP logo

Comments (6)

erickgnavar avatar erickgnavar commented on June 10, 2024 1

Hi there, I implemented this feature in #8

from scrivener_headers.

doomspork avatar doomspork commented on June 10, 2024

@pragmaticivan this is a great idea! Would you like to take a whack at implementing it?

from scrivener_headers.

pragmaticivan avatar pragmaticivan commented on June 10, 2024

Yep, I will try it later, thanks :D

from scrivener_headers.

Sardoan avatar Sardoan commented on June 10, 2024

I would also suggest to change the link structure. Now it is a string with '<http...>; rel="first", <http...>; rel="next"....' I am reading the headers in an web application and parsing the link with RegExp seems strange. Json would be much nicer. link: { "first": "http...", "last": "http.."}
Don't see the point putting it all into a string. I don't know if json is allowed in headers (due to a RFC or spec), but would be nicer. Think a switch would be cool, like page_size -> format: "standard" or "json". Has pragmaticivan already provided an implementiation for the config? Could take it as base and add a json format switch to it this weekend.

from scrivener_headers.

Sardoan avatar Sardoan commented on June 10, 2024

I am relativ new to elixir, used to write c, csharp, java and stuff, elixir is my first functional language, but check my fork. Added link as json and made the header parameter names configurable. No idea, if this was the correct way, since I am still programming oop with elixir. Any improvements are welcome. Next step would be the switch "json" or "standard" for the link. @pragmaticivan check my fork for custom header names, I added a configuration, because I prefer the header name links instead of link for multiple links.

from scrivener_headers.

doomspork avatar doomspork commented on June 10, 2024

@Sardoan we don't use JSON because this package implements RFC 5988 which outlaws how we format the links. If you're interested in reading more about the spec: https://tools.ietf.org/html/rfc5988

I'll take a peek at your fork this week 👍

from scrivener_headers.

Related Issues (3)

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.