speced / respec

A tool for creating technical documents and web standards
https://respec.org/
Other
712 stars 384 forks source link

include the 'pages' field of specref entries in references #4067

Open pchampin opened 2 years ago

pchampin commented 2 years ago

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.

marcoscaceres commented 2 years ago

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.

pchampin commented 2 years ago

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

marcoscaceres commented 2 years ago

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!