respec icon indicating copy to clipboard operation
respec copied to clipboard

include the 'pages' field of specref entries in references

Open pchampin opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. In my respec config, I have the following entry:

  localBiblio: {
    "carroll-2003" : {
      title: "Signing RDF Graphs",
      authors: [
        "Jeremy J. Carroll"
      ],
      href : "https://link.springer.com/chapter/10.1007/978-3-540-39718-2_24",
      publisher: "International Semantic Web Conference — ISWC 2003, Springer Verlag",
      pages: "369-384",
      rawDate : "2003"
    },
  }

which is rendered like this:

[carroll-2003] Signing RDF Graphs. Jeremy J. Carroll. International Semantic Web Conference — ISWC 2003, Springer Verlag. URL: https://link.springer.com/chapter/10.1007/978-3-540-39718-2_24

Notice that the page number is not present.

Describe the solution you'd like

I would like the page number to be included in the reference entry, like this:

[carroll-2003] Signing RDF Graphs. Jeremy J. Carroll. International Semantic Web Conference — ISWC 2003, Springer Verlag, pp. 369-384. URL: https://link.springer.com/chapter/10.1007/978-3-540-39718-2_24

(NB; I could live with "p." instead of "pp.")

Describe alternatives you've considered

As a workaround, I include the page number in the publisher key, which is hacky.

Can you or your organization fund the work or help with development?

I never contributed to Respec, but I guess I could try and help with this.

pchampin avatar Mar 03 '22 18:03 pchampin

Hi @pchampin, it should be super easy to add at: https://github.com/w3c/respec/blob/e693644fe4b36091a8d310d5b93d909b6a1b16da/src/core/render-biblio.js#L227

Would you mind sending a pull request? Otherwise I’ll try to add it next week.

marcoscaceres avatar Mar 03 '22 20:03 marcoscaceres

I should manage... :) Will do, soonish.

pchampin avatar Mar 03 '22 20:03 pchampin

Thank so much @pchampin 🙏. If it's not too much trouble, please add a simple test. You can probably just copy/paste or modify this one:

https://github.com/w3c/respec/blob/e693644fe4b36091a8d310d5b93d909b6a1b16da/tests/spec/core/biblio-spec.js#L77-L82

And either add "carroll-2003" to: https://github.com/w3c/respec/blob/e693644fe4b36091a8d310d5b93d909b6a1b16da/tests/spec/core/biblio-spec.js#L11

Or cite "[COMPUTABLE]", which has "pages": "230-265": https://github.com/w3c/respec/blob/e693644fe4b36091a8d310d5b93d909b6a1b16da/tests/spec/core/biblio-spec.js#L48

Any issues, just ping!

marcoscaceres avatar Mar 03 '22 21:03 marcoscaceres