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

@tomduffield/confluence-pod

v1.0.0

Published

A Dendron pod to publish notes to your personal Confluence space

Downloads

2

Readme

confluence-pod

A V1 Dendron Pod to publish notes to your personal Confluence space.

Installation

cd {workspace}
{workspace} $ npm init -y
{workspace} $ npm install --global dendron-cli
{workspace} $ npm install --save @tomduffield/confluence-pod

Install From Source

~/code $ git clone https://github.com/tduffield/confluence-pod.git
~/code/confluence-pod $ yarn install
~/code/confluence-pod $ npm link
{workspace} $ npm init -y
{workspace} $ npm install --global dendron-cli
{workspace} $ npm link confluence-pod

Usage

cd {workspace}
dendron publishPod \
  --wsRoot . \
  --vault vault \
  --podId dendron.confluence \
  --podPkg confluence-pod \
  --podSource custom \
  --configPath './pods/dendron.confluence/config.yml' \
  --query '<YOUR_NOTE>'

Bash Helper

You can copy and paste this function into your shell profile (e.g., ~/.bashrc) to give yourself a nifty helper. Just replace {workspace} with the fully-qualified path to your Dendron workspace. You can also replace the fallback vault value to whatever your default vault might be.

function publish-note-to-confluence() {
  query="$1"
  vault="${2:-vault}"
  workspace="{workspace}"
  dendron-cli publishPod --wsRoot "$workspace" --vault "$vault" \
    --podId dendron.confluence --podPkg confluence-pod --podSource custom \
    --configPath "${workspace}/pods/dendron.confluence/config.yml" \
    --query "$query"
}

Configuration

Create the Pod configuration file in ./pods/dendron.confluence/config.yml.

username: <your_email>
password: <your_api_key>
baseUrl: https://<your_organization>.atlassian.net
space: "~012345678" # e.g., "~[0-9]{9}"
parentPageId: "0123456789" # e.g., "[0-9]{10}"
includeNote: false

Option | Description | Default --- | --- | --- username | The username you use to log in to Confluence (typically your email) | required password | An API Token you generated | required baseUrl | The domain root for your Confluence installation | required space | The reference to the space where you want to upload | required parentPageId | The page under which all pages are published | None: uploads directly to the space. includeNote | Whether or not to include an info panel at the top of the page indicating the page is exported from Dendron | false

Confluence Storage Format Support

Atlassian Confluence's Storage Format is XHTML based, which means that Dendron's built-in HTML processor gets us 95% of the way there. Where there are exceptions, this Pod leverages a custom unified plugin to re-process the HTML appropriately.

Format Type | Status --- | --- Basic HTML | ✅ Task Lists | 🚧 Link to Another Confluence Page | ✅ Attached Image | ✅ External Image | ✅ Image Attributes | 🚧

Limitations

  • Exported notes do not include the Children or Backlink sections. This is something we'd like to support in the future however.
  • All notes are published as children pages to your parentPageId. We do re-create your hierarchy.
  • This pod has only been tested on the Confluence Cloud.

Features

Cross-note Links

If you include a reference to another note that is also published to Confluence (i.e., the note has a pageId in its frontmatter), then this pod should properly create an <ac:link> to that page. Otherwise, this pod will leave the the <a> tag alone and it should get stripped out by Confluence (leaving just the text).

Image Attachments

This pod will upload any referenced images from ./assets as attachments and convert the <img> element to <ac:image>.

Info Block

If you set includeNote in your config to true, this pod will prepend an info block to the top of your page indicating that this note was exported from Dendron and that changes made to the page directly may be overwritten.

Debugging

The most likely bug you'll run into once you get things working is com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format. This means that there's something in the HTML that Confluence doesn't like. This means that there's probably an edge case that I haven't caught (apologies).