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

highlightjs-macaulay2

v0.2.4

Published

highlight.js syntax definition for Macaulay2

Downloads

316

Readme

highlightjs-macaulay2

npm version github workflow

Macaulay2 is a software system devoted to supporting research in algebraic geometry and commutative algebra.

highlight.js is a JavaScript syntax highlighter with language auto-detection and zero dependencies.

Usage

Include the Highlight.js library in your webpage or Node app, then load this module.

Static website

Load the module after loading Highlight.js. Use the minified version found in the dist directory. This module is just a CDN build of the language, so it will register itself as the JavaScript is loaded.

<link rel="/path/to/styles/default.min.css"> <!-- or another highlight.js theme -->
<script src="/path/to/highlight.min.js"></script>
<script src="/path/to/macaulay2.min.js"></script>
<script>hljs.highlightAll();</script>
<pre><code class="language-macaulay2">
i1 : R = QQ[x,y,z,w]

o1 = R

o1 : PolynomialRing

i2 : I = monomialCurveIdeal(R, {1, 2, 3})

             2                    2
o2 = ideal (z  - y*w, y*z - x*w, y  - x*z)

o2 : Ideal of R
</code></pre>

Using directly from the UNPKG CDN

<script src="https://unpkg.com/highlightjs-macaulay2/dist/macaulay2.min.js"></script>

With Node or another build system

If you're using Node / Webpack / Rollup / Browserify, etc., import the language module, then register it with Highlight.js.

import hljs from 'highlight.js'; // or 'highlight.js/lib/core' to not load other languages
import macaulay2 from 'highlightjs-macaulay2';

hljs.registerLanguage("macaulay2", macaulay2);
hljs.highlightAll();

With reveal.js

The popular presentation framework reveal.js uses highlight.js for syntax highlighting.

To start including Macaulay2 code in your reveal.js presentations, download and unzip this slightly modified copy of reveal.js. It adds Macaulay2 support to the syntax highlighting plugin.

Then edit the file index.html with your Macaulay2 code, e.g.,:

<section>
The twisted cubic in Macaulay2:

<pre><code class="hljs macaulay2">
i1 : R = QQ[x,y,z,w]

o1 = R

o1 : PolynomialRing

i2 : I = monomialCurveIdeal(R, {1,2,3})

             2                    2
o2 = ideal (z  - y*w, y*z - x*w, y  - x*z)

o2 : Ideal of R
</code></pre>
</section>

Then open index.html in your favorite browser. It should look like this.

Building and testing

To build dist/macaulay2.min.js yourself, run:

npm run build

Or, if you have already cloned the highlight.js repository:

npm run build -- HLJSDIR=/path/to/highlight.js

To update the Macaulay2 language keywords, e.g., after a new release of Macaulay2, run:

npm run update

Note that you must have Macaulay2 installed for this to work. If you have already cloned the Macaulay2 repository:

npm run update -- M2DIR=/path/to/M2

To run the test suite, run:

npm run test

Or, as above, if you already have the highlight.js repository cloned:

npm run test -- HLJSDIR=/path/to/highlight.js

License

Distributed under the BSD 3-Clause License. See LICENSE for more information.

Highlight.js is also released under the BSD 3-Clause License.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork this project.
  2. Create a work branch (git checkout -b my-branch).
  3. Commit your changes (git commit -m 'my changes').
  4. Push the branch (git push origin my-branch).
  5. Open a Pull Request from your fork back to this repository.

Links