npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

remark-obsidian-footnotes

v1.0.0

Published

A remark plugin that parses a file searching for Obsidian-style footnotes markup, and then creates a footnotes section at the end of the AST.

Downloads

1

Readme

remark-obsidian-flavoured-footnotes

A remark plugin that parses a file searching for Obsidian-style footnotes markup, and then creates a footnotes section at the end of the AST. Footnotes are created by typing ^[Footnote content] wherever one desires, so that the writer does not break her line of thought and never has to bother about the right indexes : they are automatically computed by the plugin. For instance, the following Markdown paragraph :

Lorem ipsum odor amet^[Von Dughâto, P. (1922). *Un Livre exceptionnel*. pp. 110-117], consectetuer adipiscing elit.
Est magnis cras auctor donec netus vel mus. Elementum quisque massa risus aliquet class dictum consequat. Nostra nam finibus orci senectus orci orci^[*Ibid*. p. 137] aenean neque.
Est luctus bibendum magnis fames lobortis. Justo leo pharetra lacinia et bibendum elementum eget varius.^[*Ibid*. p. 284] Rhoncus consectetur massa vehicula tellus habitasse non tempor congue. Est dignissim justo vulputate interdum elit. Vel ad viverra fermentum augue integer cubilia neque pretium.

... will yield the following abstract syntax tree (AST) :

{
  "type": "root",
  "children": [
    {
      "type": "paragraph",
      "children": [
        {
          "type": "text",
          "value": "Lorem ipsum odor amet"
        },
        {
          "type": "footnoteReference",
          "identifier": "footnote-1",
          "label": "1"
        },
        {
          "type": "text",
          "value": ", consectetuer adipiscing elit. Est magnis cras auctor donec netus vel mus. Elementum quisque massa risus aliquet class dictum consequat. Nostra nam finibus orci senectus orci orci"
        },
        {
          "type": "footnoteReference",
          "identifier": "footnote-2",
          "label": "2"
        },
        {
          "type": "text",
          "value": " aenean neque. Est luctus bibendum magnis fames lobortis. Justo leo pharetra lacinia et bibendum elementum eget varius."
        },
        {
          "type": "footnoteReference",
          "identifier": "footnote-3",
          "label": "3"
        },
        {
          "type": "text",
          "value": " Rhoncus consectetur massa vehicula tellus habitasse non tempor congue."
        }
      ],
      "position": {
        "start": {
          "line": 2,
          "column": 1,
          "offset": 2
        },
        "end": {
          "line": 2,
          "column": 489,
          "offset": 490
        }
      }
    },
    {
      "type": "footnoteDefinition",
      "identifier": "footnote-1",
      "children": [
        {
          "type": "paragraph",
          "children": [
            {
              "type": "text",
              "value": "Von Dughâto, P. (1922). "
            },
            {
              "type": "emphasis",
              "children": [
                {
                  "type": "text",
                  "value": "Un Livre exceptionnel",
                  "position": {
                    "start": {
                      "line": 2,
                      "column": 49,
                      "offset": 50
                    },
                    "end": {
                      "line": 2,
                      "column": 70,
                      "offset": 71
                    }
                  }
                }
              ],
              "position": {
                "start": {
                  "line": 2,
                  "column": 48,
                  "offset": 49
                },
                "end": {
                  "line": 2,
                  "column": 71,
                  "offset": 72
                }
              }
            },
            {
              "type": "text",
              "value": ". pp. 110-117"
            }
          ]
        }
      ]
    },
    {
      "type": "footnoteDefinition",
      "identifier": "footnote-2",
      "children": [
        {
          "type": "paragraph",
          "children": [
            {
              "type": "emphasis",
              "children": [
                {
                  "type": "text",
                  "value": "Ibid",
                  "position": {
                    "start": {
                      "line": 2,
                      "column": 268,
                      "offset": 269
                    },
                    "end": {
                      "line": 2,
                      "column": 272,
                      "offset": 273
                    }
                  }
                }
              ],
              "position": {
                "start": {
                  "line": 2,
                  "column": 267,
                  "offset": 268
                },
                "end": {
                  "line": 2,
                  "column": 273,
                  "offset": 274
                }
              }
            },
            {
              "type": "text",
              "value": ". p. 137"
            }
          ]
        }
      ]
    },
    {
      "type": "footnoteDefinition",
      "identifier": "footnote-3",
      "children": [
        {
          "type": "paragraph",
          "children": [
            {
              "type": "emphasis",
              "children": [
                {
                  "type": "text",
                  "value": "Ibid",
                  "position": {
                    "start": {
                      "line": 2,
                      "column": 404,
                      "offset": 405
                    },
                    "end": {
                      "line": 2,
                      "column": 408,
                      "offset": 409
                    }
                  }
                }
              ],
              "position": {
                "start": {
                  "line": 2,
                  "column": 403,
                  "offset": 404
                },
                "end": {
                  "line": 2,
                  "column": 409,
                  "offset": 410
                }
              }
            },
            {
              "type": "text",
              "value": ". p. 284"
            }
          ]
        }
      ]
    }
  ],
  "position": {
    "start": {
      "line": 1,
      "column": 1,
      "offset": 0
    },
    "end": {
      "line": 2,
      "column": 489,
      "offset": 490
    }
  }
}

... And, using remark-rehype, the following HTML :

<p>Lorem ipsum odor amet<sup><a href="#user-content-fn-footnote-1" id="user-content-fnref-footnote-1" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup>, consectetuer adipiscing elit. Est magnis cras auctor donec netus vel mus. Elementum quisque massa risus aliquet class dictum consequat. Nostra nam finibus orci senectus orci orci<sup><a href="#user-content-fn-footnote-2" id="user-content-fnref-footnote-2" data-footnote-ref="" aria-describedby="footnote-label">2</a></sup> aenean neque. Est luctus bibendum magnis fames lobortis. Justo leo pharetra lacinia et bibendum elementum eget varius.<sup><a href="#user-content-fn-footnote-3" id="user-content-fnref-footnote-3" data-footnote-ref="" aria-describedby="footnote-label">3</a></sup> Rhoncus consectetur massa vehicula tellus habitasse non tempor congue.</p>
<section data-footnotes="" class="footnotes">
   <h2 class="sr-only" id="footnote-label">Footnotes</h2>
   <ol>
      <li id="user-content-fn-footnote-1">
         <p>Von Dughâto, P. (1922). <em>Un Livre exceptionnel</em>. pp. 110-117 <a href="#user-content-fnref-footnote-1" data-footnote-backref="" aria-label="Back to reference 1" class="data-footnote-backref">↩</a></p>
      </li>
      <li id="user-content-fn-footnote-2">
         <p><em>Ibid</em>. p. 137 <a href="#user-content-fnref-footnote-2" data-footnote-backref="" aria-label="Back to reference 2" class="data-footnote-backref">↩</a></p>
      </li>
      <li id="user-content-fn-footnote-3">
         <p><em>Ibid</em>. p. 284 <a href="#user-content-fnref-footnote-3" data-footnote-backref="" aria-label="Back to reference 3" class="data-footnote-backref">↩</a></p>
      </li>
   </ol>
</section>