Bağlantı

Metni seçip ona bir adres ekleyin. Metin seçmeden adres girerseniz adresin kendisi bağlantı metni olarak eklenir. Bir http:// veya https:// adresi yazıp ardından Space ya da Enter’a basmak da onu bağlantıya dönüştürür.

Bağlantılar yalnızca http:, https: ve . veya / ile başlayan aynı site yollarını saklar. Kökeni açıkça belirlenemeyen javascript: veya //example.com gibi adresler reddedilir. Upload ile oluşturulan ek bağlantıları dosya bilgisini de saklar ve normal bağlantılar gibi elle oluşturulamaz.

Kanatlar
Temel yazı tipiOfset
HTMLDüzenleyici yükleniyor…
JSONnabi-treeDüzenleyici yükleniyor…
Yükle
npm install nabi-note
Kod
import {
  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: 'tr' })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'tr' }
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()))
ts
const selected = wings().use('a').build()

CSS Styles

Normal bağlantıları .nabi-content a ile, ek bağlantılarını ise ayrıca .nabi-content a[data-nabi-file] ile stillendirin.

css
.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);
}

Ek bağlantılarının ::before ve ::after parçaları dosya ikonunu ve uzantısını göstermek için kullanılır; bu yüzden genellikle bunların content değerini değiştirmemek veya kaldırmamak en iyisidir.