முன்னிலைப்படுத்தல் ​

தேர்ந்தெடுத்த எழுத்துக்குப் பின்னால் முன்னிலைப்படுத்தல் நிறத்தைப் பயன்படுத்துகிறது. சேமித்த தரவில் விரும்பிய CSS நிற மதிப்புக்குப் பதில் அனுமதிக்கப்பட்ட நிறப் பெயர் மட்டுமே இருப்பதால், திரைப் பாணியையும் ஆவணத் தரவையும் பிரிக்கலாம்.

சிறகுகள்
அடிப்படை எழுத்துருஇடமாற்றம்
HTMLதொகுப்பி ஏற்றப்படுகிறது…
JSONnabi-treeதொகுப்பி ஏற்றப்படுகிறது…
நிறுவு
npm install nabi-note
நிரல்
import {
  createLocale, createNabiWith, mountSurface, mountToolbar,
  mountContextToolbar, mountHints, watchSettle, textColorWing,
  highlightWing, footnoteWing, mountViewTools,
} from 'nabi-note'

const selected = [
  textColorWing,
  highlightWing,
  footnoteWing,
]
const locale = createLocale('ta')
const { nabi, registry } = createNabiWith(selected, { locale })

const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!

// The locale also sets the direction — Arabic and Urdu run right to left
mountSurface({ nabi, registry, root: content, locale })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale }
const toolbar = mountToolbar({ ...shared, root: document.querySelector('#toolbar')! })
const context = mountContextToolbar({ ...shared, root: document.querySelector('#context')! })
mountHints({ toolbar, context, root, surface: content })
// The preview and fullscreen buttons — they stand their own box at the end of the row
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })

// on every change — hook up your own code here
// nabi.onChange(() => user_callback(nabi.getHtml()))

// Call from your language selector. Content and editing history stay intact.
// locale.setLocale('ko')
ts
const selected = wings().use('hl', {
  values: ['yellow', 'green', 'cyan'],
}).build()

values ஐ விடுத்தால் yellow, green, cyan, pink, purple, orange பயன்படுத்தப்படும். பட்டியலைக் குறைத்தால் பதிவு செய்யாத நிறங்கள் ஏற்றப்பட்ட ஆவணத்திலும் தக்கவைக்கப்படாது.

CSS பாணிகள் ​

ஆவணத்தில் நிறப் பெயர் மட்டுமே சேமிக்கப்படும். தொகுப்பி மற்றும் வெளியீட்டுப் பக்க நிறங்களை CSS மாறிகளால் மாற்றவும்.

css
.nabi-content { --nabi-hl-yellow: #fff0a6; }

பல நிறங்களை ஒன்றாக மாற்றினால் ஆவணத்தின் நிறப் பெயர்களை மாற்றாமல் சேவையின் தோற்றத்தை மட்டும் மாற்றலாம்.

css
.article-body {
  --nabi-hl-yellow: #fff0a6;
  --nabi-hl-green: #c8f0d8;
  --nabi-hl-pink: #ffd6e5;
}