0.1.2 • Published 2 years ago

lc-ref v0.1.2

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

lc-ref

A LaTeX style webcomponent reference and preview

This library provides a webcomponent to create numbered elements references and authomatic preview.

<lc-ref href="#fig_1">fig. </lc-ref>

will probably render as "fi.g 1":

Cross documents links are supported:

<lc-ref href="https://example.com#fig_1">fig. </lc-ref>

they will probably render as "fig. example .1 "

Motivation

I created this package to reference figures, tables, etc. like in LaTeX.

Creating a numbered element

In your WebComponent, you have add the property:

class MyWebcomponent extends HTMLElement {
    // ...

    lc_number = "auto";
}

If you want to provide a custom number or something else, write:

class MyWebcomponent extends HTMLElement {
    // ...

    /**
     * @return {string}
     */
    lc_number() {
        return "42!";
    };
}