Comments (6)
Hi there, I implemented this feature in #8
from scrivener_headers.
@pragmaticivan this is a great idea! Would you like to take a whack at implementing it?
from scrivener_headers.
Yep, I will try it later, thanks :D
from scrivener_headers.
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.
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.
@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
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 scrivener_headers.