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

uniorg-attach

v1.0.1

Published

Uniorg plugin to process org-attach attachment links

Downloads

311

Readme

uniorg-attach

uniorg plugin to convert attachment: links to file: links.

Install

npm install --save uniorg-attach

Use

If we have the following example.org file:

:PROPERTIES:
:ID:   eae6a180-58d3-44b9-9c95-d8924849d365
:END:

attachment:file.txt

and

import { unified } from 'unified';
import toVFile from 'to-vfile';
import uniorgParse from 'uniorg-parse';
import { uniorgAttach } from 'uniorg-attach';
import uniorg2rehype from 'uniorg-rehype';
import html from 'rehype-stringify';

unified()
  .use(uniorgParse)
  .use(uniorgAttach)
  .use(uniorg2rehype)
  .use(html)
  .process(toVFile.readSync('./example.org'), function (err, file) {
    console.log(file.toString());
  });

will output

<p><a href="file:data/ea/e6a180-58d3-44b9-9c95-d8924849d365/file.txt">file:data/ea/e6a180-58d3-44b9-9c95-d8924849d365/file.txt</a>
</p>

Options

idDir

Type: string?

Default: "data/"

The directory where attachments are stored. If this is a relative path, it will be interpreted relative to the directory where the Org file lives.

Corresponds to org-attach-id-dir in Emacs.

useInheritance

Type: boolean?

Default: false

NOTE: In Emacs, the default is 'selective which means that Emacs will look at org-use-property-inheritance to check whether ID and DIR properties are inherited. uniorg-attach does not currently do that. This shouldn’t cause any troubles unless you inherit one property but not the other.

Attachment inheritance for the outline.

Enabling inheritance for implies that attachment links will look through all parent headings until it finds the linked attachment.

Corresponds to org-attach-use-inheritance in Emacs.

idToPath

Type: (id: string) => string

Default: idUuidFolderFormat

A function parsing an ID string into a folder-path.

Similar to org-attach-id-to-path-function-list in Emacs, but only allows one function.

This module exports idUuidFolderFormat and idTsFolderFormat that re-implement two common behaviors for org-attach.

License

GNU General Public License v3.0 or later