Repository navigation
Line Numbers
English | Русский
ShowSourceLineNumbers shows the numbers of the source lines in a margin on the left, like an editor
does. Numbers start from 1.

A window or a user control:
<ScrollViewer>
<md:MarkdownViewer Markdown="{Binding Text}"
ShowSourceLineNumbers="True"
ShowCodeLineNumbers="True"
Margin="8,16,24,16" />
</ScrollViewer>A number stands at every source line that has its own place on the screen: lines of text, blank
lines, the header of a code block and its lines of code. The closing fence of a code block, the
delimiter row of a table and the === or --- under a heading have no place of their own and get no
number. The width of the margin is one for the whole document, so it does not jump while you scroll.
With JoinSoftLineBreaks the lines of a
paragraph share the lines of the screen: a number stands at the line of the screen where its source line
starts, and of several numbers on one line of the screen only the first stays.
ShowCodeLineNumbers is a different numbering: from 1 inside every code block — see
Code Blocks.
The margin uses the keys Md.Gutter.FontFamily, Md.Gutter.Foreground, Md.Gutter.FontSize and
Md.Gutter.Padding — see Theming. A template of the viewer of your own keeps the margin when
it has md:MdLineGutter x:Name="PART_Gutter".
Bars and icons of marks stand in the margin: icons to the left of the numbers, bars to the right of them. The margin is wider by their columns only while there are such marks. The same places of lines for a column of your own give coordinates.
The numbers are the line numbers of the text in Markdown, the same an editor shows for that text.
From code, lines are counted from 0 — see Source Lines and Two Panes.
Beresta.Markdown.Wpf · Issues · MIT License
Basics
- Getting Started
- How It Renders
- Supported Markdown
- Settings and Hooks
- Scrolling and Virtualization
- Comparison
Working with Text
Appearance
Integration
- Application Links
- Images
- Untrusted Text
- Task Lists
- Source Lines and Two Panes
- Coordinates
- Live Preview
Editing
Your Own Syntax
Ready-made Extensions
Основы
- Начало работы
- Как рисует вьюер
- Что поддерживается
- Настройки и перехват
- Прокрутка и виртуализация
- Сравнение
Работа с текстом
Оформление
Встраивание в приложение
- Ссылки приложения
- Картинки
- Чужой текст
- Списки задач
- Строки исходника и две панели
- Координаты
- Живой предпросмотр
Правка
Свой синтаксис
Готовые расширения