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

hexo-filter-tikzjax

v1.0.2

Published

Server side PGF/TikZ renderer plugin for Hexo.

Downloads

68

Readme

hexo-filter-tikzjax

Latest Version License

Server side PGF/TikZ renderer plugin for Hexo.

Render graphs, figures, circuits, chemical diagrams, commutative diagrams, and more in your blog posts.

No client side JavaScript required. Woo-hoo! 🎉

Installation

npm install hexo-filter-tikzjax

For the first run after installation, you need to run hexo clean to clean the cache.

Configuration

Configure this plugin in your site's _config.yml. Default values:

tikzjax:
  # Enable TikZ rendering for all posts and pages.
  # Or you can enable it per post by adding `tikzjax: true` to the front-matter.
  every_page: false
  # Add CSS to pages which contain TikZ graphs.
  append_css: true
  # URL of the font CSS file.
  font_css_url: 'https://cdn.jsdelivr.net/npm/node-tikzjax@latest/css/fonts.css'
  # Additional options that will be passed to node-tikzjax.
  # See: https://github.com/prinsss/node-tikzjax/#usage
  # tikzjax_options:
  #   showConsole: false

Usage

Add tikzjax: true to the front-matter of posts/pages that you would like to enable TikZ rendering.

Wrap you TikZ code in a Markdown code block with language tikz, and you are good to go!

```tikz
\begin{document}
  \begin{tikzpicture}
    % Your code here...
  \end{tikzpicture}
\end{document}
```

TikZ code are rendered as static SVG images during the Hexo generation process. The SVG images are then embedded into the HTML pages so there is no client side JavaScript involved. The images will be updated automatically when you change the code.

For a full list of supported TikZ features and $\LaTeX$ packages, please refer to the node-tikzjax documentation.

[!TIP] Run hexo generate or hexo server with --debug option to see the debug messages, including the console output of the TeX engine. To clear the internal SVG cache, run rm -rf node_modules/hexo-filter-tikzjax/.cache.

Example

As this plugin is greatly inspired by obsidian-tikzjax, you can expect the same syntax, features and rendering results.

---
title: 'Lorem Ipsum'
date: '2024/01/01 11:45:14'
mathjax: true
tikzjax: true
---

We love using $\LaTeX$ and Ti*k*Z in [Hexo](http://hexo.io)!

```tikz
\begin{document}
  \begin{tikzpicture}[domain=0:4,scale=1.1]
    \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
    \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
    \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
    \draw[color=red]    plot (\x,\x)             node[right] {$f(x) =x$};
    \draw[color=blue]   plot (\x,{sin(\x r)})    node[right] {$f(x) = \sin x$};
    \draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
  \end{tikzpicture}
\end{document}
```

The above code will be rendered and embedded as an inline SVG image.

For more examples, please refer to the node-tikzjax.

01-post-render

License

MIT