Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(html): enhance html entrants with id and anchors #2

Open
lewisacidic opened this issue Jan 10, 2019 · 0 comments
Open

feat(html): enhance html entrants with id and anchors #2

lewisacidic opened this issue Jan 10, 2019 · 0 comments

Comments

@lewisacidic
Copy link
Owner

lewisacidic commented Jan 10, 2019

We should add linking support in HTML. This would be a hacky and finicky change, and maybe should be in citeproc-js, but .

We want to support this (fun example from the citeproc-js docs):

<h1> The Discovery of Wetness </h1>
<p>
  While it has long been known that rocks are dry<sup>[<a href="#ref-a">1</a>]</sup> and that air is moist<sup>[<a href="#ref-b">2</a>]</sup> it has been suggested by Source [<a href="ref-c">3</a>]  that water is wet.
</p>
<div class="csl-bib">
  <h2 class="csl-bib-title">References</h2>
  <div class="csl-bib-body">
    <div id="ref-a" class="csl-entry">[1] John Noakes, The Dryness of Rocks (1952).</div>
    <div id="ref-b" class="csl-entry">[2] Richard Snoakes, The Moistness of Air (1967).</div>
    <div id="ref-c" class="csl-entry">[3] Jane Roe, The Wetness of Water (2000).</div>
  </div>
</div>

which looks like:

The Discovery of Wetness

While it has long been known that rocks are dry[1] and that air is moist[2] it has been suggested by Source [3] that water is wet.

References

[1] John Noakes, The Dryness of Rocks (1952).
[2] Richard Snoakes, The Moistness of Air (1967).
[3] Jane Roe, The Wetness of Water (2000).

Tasks

  • Splicing the anchors into the citation.
    • Can use citation.sortedItems to get the order, although collapse-able might make this hard
    • just link the first reference if collapsed
  • Splicing the id's into the bibliography
    • should be simple to put after the div, all of them start div class="csl-entry"
  • citeInText (hardest, will need even more hacks there...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant