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

pandoc-plantuml

v1.0.0

Published

Pandoc filter to convert diagrams in PlantUml syntax blocks to inline images in markdown files

Downloads

43

Readme

npm version Dependencies License

Pandoc PlantUML

pandoc-plantuml is a pandoc filter that allows you to write PlantUML diagrams in your markdown files and convert them to inline images.

It makes use of its demo online tool, so, if you like this filter, go to PlantUML site and support them.

Install

This is a Node.js module available through the npm registry, so, you will need Node.js installed first.

// With npm
$ npm install -g pandoc-plantuml
// With yarn
$ yarn global add pandoc-plantuml

Use

Apply filter

To apply the filter to your markdown conversion just add it to your command like this:

pandoc -t html -F pandoc-plantuml -o my-file.html my-file.md

Graph definition

To add a graph simply create a plantuml code block and follow the format of PlantUML. It must contain the @startuml and @enduml tags at the start and end respectively.

```plantuml
@startuml
participant John as "John Doe"
participant Jane as "Jane Doe"

John --> Jane: Hello world
@enduml
` ``

Simple diagram

Style support

You can add any skinparam to style your diagram like this.

```plantuml
@startuml
skinparam {
  RoundCorner 5
  Shadowing false
  ArrowColor Black
  ArrowFontSize 16
  Padding 8
  WrapWidth 1024
  note {
    BackgroundColor OldLace
    BorderColor BurlyWood
    FontSize 16
  }
  sequence {
    LifeLineBorderColor Black
    LifeLineBackgroundColor White
    MessageAlignment center
    Participant {
      BorderColor Black
      BorderThickness 0.5
      BackgroundColor White
      FontSize 18
    }
  }
}

participant John as "John Doe"
participant Jane as "Jane Doe"

John --> Jane: Hello world
@enduml
` ``

Styled diagram

.skinparam.iuml

For convenience pandoc-plantuml will search for a .skinparam.iuml file in the root folder of your project. You can add your styles in this file and will be applied to all your diagrams.

Add a .skinparam.iuml file

skinparam {
  RoundCorner 5
  Shadowing false
  ArrowColor Black
  ArrowFontSize 16
  Padding 8
  WrapWidth 1024
  note {
    BackgroundColor OldLace
    BorderColor BurlyWood
    FontSize 16
  }
  sequence {
    LifeLineBorderColor Black
    LifeLineBackgroundColor White
    MessageAlignment center
    Participant {
      BorderColor Black
      BorderThickness 0.5
      BackgroundColor White
      FontSize 18
    }
  }
}

Then create a diagram

```plantuml
@startuml
participant John as "John Doe"
participant Jane as "Jane Doe"

John --> Jane: Hello world
@enduml
` ``

And you will get

Styled diagram

Limitations

Local conversion is not posible at this moment so, including files will not work, but pull requests are welcome.

Contributing

  • Use prettify and eslint to lint your code.
  • Update the readme with an example if you add or change any functionality.

Legal

Author: Masquerade Circus. License Apache-2.0