mirror of https://github.com/tstack/lnav.git
[blog] post about markdown support
This commit is contained in:
parent
deb0e21554
commit
4e74491e84
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
layout: post
|
||||
title: Markdown Support
|
||||
excerpt: A side effect of fancier help text
|
||||
---
|
||||
|
||||
*(This change will be in the upcoming v0.11.0 release)*
|
||||
|
||||
As part of the effort to polish the lnav TUI, I wanted to make the builtin
|
||||
help text look a bit nicer. The current help text is a plain text file with
|
||||
some ANSI escape sequences for colors. It's not easy to write or read. Since
|
||||
Markdown has become a dominant way to write this type of document, I figured
|
||||
I could use that and have the side benefit of allowing lnav to read Markdown
|
||||
docs. Fortunately, the [MD4C](https://github.com/mity/md4c) library exists.
|
||||
This library provides a nice event-driven parser for documents instead of
|
||||
just converting directly to HTML. In addition, document structure is now
|
||||
shown/navigable through the new breadcrumb bar at the top. I think the
|
||||
result is pretty nice:
|
||||
|
||||
<script id="asciicast-2hx3UiyzOHQXBQOBf31ztKvHc"
|
||||
src="https://asciinema.org/a/2hx3UiyzOHQXBQOBf31ztKvHc.js"
|
||||
async>
|
||||
</script>
|
||||
|
||||
## Viewing Markdown Files
|
||||
|
||||
Files with an `.md` suffix will be considered as Markdown and will be
|
||||
parsed as such. As an example, here is lnav displaying its README.md file:
|
||||
|
||||
<script id="asciicast-iw4rwddZNGCe3v8DyOfItERG9"
|
||||
src="https://asciinema.org/a/iw4rwddZNGCe3v8DyOfItERG9.js"
|
||||
async>
|
||||
</script>
|
23
src/help.md
23
src/help.md
|
@ -278,22 +278,13 @@ that you can always use `q` to pop the top view off of the stack.
|
|||
| **|**<script> [arg1...] | Execute an lnav script contained in a format directory (e.g. \~/.lnav/formats/default). The script can contain lines starting with `:`, `;`, or `\|` to execute commands, SQL queries or execute other files in lnav. Any values after the script name are treated as arguments can be referenced in the script using `\$1`, `\$2`, and so on, like in a shell script. |
|
||||
| CTRL+], ESCAPE | Abort command-line entry started with `/`, `:`, `;`, or `\|`. |
|
||||
|
||||
Note: The regular expression format used by is PCRE
|
||||
(Perl-Compatible Regular Expressions). For example,
|
||||
if you wanted to search for ethernet device names,
|
||||
regardless of their ID number, you can type:
|
||||
|
||||
eth\\d+
|
||||
|
||||
You can find more information about Perl regular
|
||||
expressions at:
|
||||
|
||||
http://perldoc.perl.org/perlre.html
|
||||
|
||||
If the search string is not valid PCRE, a search
|
||||
is done for the exact string instead of doing a
|
||||
regex search.
|
||||
|
||||
> **Note**: The regular expression format used by lnav is
|
||||
> [PCRE](http://perldoc.perl.org/perlre.html)
|
||||
> (Perl-Compatible Regular Expressions).
|
||||
>
|
||||
> If the search string is not valid PCRE, a search
|
||||
> is done for the exact string instead of doing a
|
||||
> regex search.
|
||||
|
||||
## Session
|
||||
|
||||
|
|
|
@ -425,21 +425,13 @@ can always use [37m[40m q [0m to pop the top view off of the stack.
|
|||
CTRL+], ESCAPE Abort command-line entry started with [37m[40m / [0m, [37m[40m : [0m, [37m[40m ;[0m
|
||||
, or [37m[40m | [0m.
|
||||
|
||||
▌[37m[40m Note: The regular expression format used by is PCRE [0m
|
||||
▌[37m[40m (Perl-Compatible Regular Expressions). For example, [0m
|
||||
▌[37m[40m if you wanted to search for ethernet device names, [0m
|
||||
▌[37m[40m regardless of their ID number, you can type: [0m
|
||||
▌[37m[40m [0m
|
||||
▌[37m[40m eth\d+ [0m
|
||||
▌[37m[40m [0m
|
||||
▌[37m[40m You can find more information about Perl regular [0m
|
||||
▌[37m[40m expressions at: [0m
|
||||
▌[37m[40m [0m
|
||||
▌[37m[40m http://perldoc.perl.org/perlre.html [0m
|
||||
▌[37m[40m [0m
|
||||
▌[37m[40m If the search string is not valid PCRE, a search [0m
|
||||
▌[37m[40m is done for the exact string instead of doing a [0m
|
||||
▌[37m[40m regex search. [0m
|
||||
▌[1mNote[0m: The regular expression format used by lnav is PCRE[1]
|
||||
▌(Perl-Compatible Regular Expressions).
|
||||
▌
|
||||
▌ ▌[1] - http://perldoc.perl.org/perlre.html
|
||||
▌
|
||||
▌If the search string is not valid PCRE, a search is done for
|
||||
▌the exact string instead of doing a regex search.
|
||||
|
||||
[1mSession[0m
|
||||
|
||||
|
|
Loading…
Reference in New Issue