Skip to content

tategakibunko/nehan-anchor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>.