nehan plugin for preview anchor link
  • TypeScript 99.8%
  • Makefile 0.2%
Find a file
2021-03-21 21:46:01 +09:00
.gitignore Added .gitignore 2021-03-13 16:57:08 +09:00
.npmignore Fixed url 2021-03-13 17:43:52 +09:00
index.ts First commit 2021-03-13 16:55:21 +09:00
LICENSE Added LICENSE 2021-03-13 17:02:17 +09:00
Makefile First commit 2021-03-13 16:55:21 +09:00
package-lock.json Updated nehan 2021-03-21 21:46:01 +09:00
package.json Updated nehan 2021-03-20 07:16:22 +09:00
README.md Updated nehan 2021-03-21 21:45:48 +09:00
tsconfig.json First commit 2021-03-13 16:55:21 +09:00

nehan-anchor

nehan plugin for preview anchor link.

create nehan style

import { Anchor, PagedNehanDocument, CssStyleSheet } from 'nehan';
import * as AnchorStyle from 'nehan-anchor';
const anchorStyle: CssStyleSheet = AnchorStyle.create({
  previewSpacing: 10,
  onClickAnchorLink(anchor: Anchor){
    console.log("click anchor:", anchor);
  }
});
const pd = new PagedNehanDocument("<blockquote id="bq1">foo</blockquote><a href="#bq1">hover</a>", {
  styleSheets:[
    anchorStyle, // add anchor style!
  ]
});

use markup

<blockquote id="bq1">some blockquoted text with id attribute</blockquote>

And you can preview it by creating anchor link like <a href="#bq1">this</a>.