Kiungo
Chagua maandishi kisha uambatishe anwani. Ukiandika anwani bila kuchagua maandishi, anwani yenyewe huingizwa kama maandishi ya kiungo. Kuandika anwani ya http:// au https:// kisha kubonyeza Space au Enter pia huibadilisha kuwa kiungo.
Viungo huhifadhi http:, https:, na njia za tovuti hiyohiyo zinazoanza kwa . au / pekee. Anwani ambazo chanzo chake hakiwezi kutambulika wazi, kama javascript: au //example.com, hukataliwa. Viungo vya viambatisho vinavyoundwa na upakiaji pia huhifadhi maelezo ya faili, na haviwezi kuundwa mwenyewe kama viungo vya kawaida.
npm install nabi-noteimport {
createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
mountHints, watchSettle, subscriptWing, highlightWing, linkWing,
mountViewTools,
} from 'nabi-note'
const selected = [
subscriptWing,
highlightWing,
linkWing,
]
const { nabi, registry } = createNabiWith(selected)
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: 'sw' })
const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'sw' }
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()))const selected = wings().use('a').build()Mitindo ya CSS
Tia mtindo viungo vya kawaida kwa .nabi-content a, na viungo vya viambatisho kivyake kwa .nabi-content a[data-nabi-file].
.article-body a:not([data-nabi-file]) {
color: var(--nabi-accent);
text-decoration-thickness: .08em;
text-underline-offset: .16em;
}
.article-body a[data-nabi-file] {
display: inline-flex;
gap: .35em;
padding: .25em .55em;
background: var(--nabi-soft);
}Sehemu za ::before na ::after za kiungo cha kiambatisho hutumika kuonyesha ikoni na kiendelezi cha faili, hivyo kwa kawaida ni bora kutobadilisha wala kuondoa content yake.