-
Notifications
You must be signed in to change notification settings - Fork 3
/
markdown.nanorc
86 lines (81 loc) · 3.14 KB
/
markdown.nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
## Syntax definition for Markdown for coloration with GNU Nano
## (Syntax reference: http://daringfireball.net/projects/markdown/syntax)
##
## (C) 01/2014 Lilian Besson (lilian DOT besson AT normale DOT fr)
## Last version : http://besson.qc.to/NanoSyntax/markdown.nanorc
##############################################################################
# Definition of the name of the syntax : rst
# and capture of the extension : .txt .text .md .markdown
syntax "markdown" "\.md$" "\.markdown$"
##############################################################################
# Numbers
color white "-?[0-9\.][0-9\._,]*([eE]-?)?[0-9\._,]*"
# code block
color brightgreen,black "DONE"
color brightred,black "(FIXME|TODO|NEW|XXX|HOWTO|DEBUG|WARNING|PEP)"
# wrong links (empty)
color white,red "[a-z][a-z]+://[^([[:alnum:]]|[\]\[])]*"
# Balise <truc> et </truc>, pour embarquer du JavaScript notamment.
color brightblue,black "</?[[:alnum:]]+([[:space:]]+[[:alnum:]]*=\"[^\"]*\")*>"
# lists (not yet perfect)
color brightwhite "(^ *[\*\+-]([[:blank:]]| *[\*\+-])+)|(^ *#\.[[:blank:]]+)|(^ *[0-9]+\.[[:blank:]]+)|(^ *[\(]?[a-z]+[\.\)][[:blank:]]+)|(^ *[\(]?[A-Z]+[\.\)][[:blank:]]+)"
# options lists
color white "^ *([/\+\-]{1,2}[a-zA-Z0-9][[:blank:]]?([[:alnum:]]|_)*[,=]*([[:alnum:]]|_)*[[:blank:]]*)+"
## Links and others:
##
## link reference
## color brightgreen "((`[^`]+`_{1,2})|([[:blank:]]*\.\. _[[:alnum:]]+.*: .*$))"
## targets
## color brightgreen "^ *\.\. _[[:alnum:]]+:"
# email
icolor brightred,black "(mailto:)?[[:alnum:]]([[:alnum:]]|[_\.\[\]\--]|\.|-)*(@|AT)[[:alnum:]]([[:alnum:]]|[_\.\[\]\--]|\.|-)*\.[[:alnum:]]+"
# http, ftp, https, apt, links
icolor red,black "[a-z][a-z]+://[[:alnum:]]([[:alnum:]]|[-_\.~#\?:=%&])*([[:alnum:]]|[-/_\.~#\?:=%&;])*"
# italics
color red "\*[[:alnum:]]([[:alnum:]]|[[:space:]]|-|,|;|\.|'|\$|\\|/)*\*\\?"
color brightmagenta "\"[a-zA-Z]([[:alnum:]]|[[:space:]]|-|,|;|\.|'|\$|\\|/)*\"\\?"
color brightmagenta "'[a-zA-Z]([[:alnum:]]|-|,|;|\.|'|\$|\\|/)*'\\?"
color brightmagenta "“[a-zA-Z]([[:alnum:]]|-|,|;|\.|'|\$|\\|/)*”\\?"
# bold
color brightyellow "\*\*[^*^*]+\*\*\\?"
##############################################################################
## Old stuff
# Quotations
color cyan "^>.*"
# Emphasis
color green "_[^_]*_"
color green "\*[^\*]*\*"
# Strong emphasis
color brightgreen "\*\*[^\*]*\*\*"
color brightgreen "__[\_]*__"
# Underline headers
color brightblue "^====(=*)"
color brightblue "^----(-*)"
# Hash headers
color brightcyan "^#.*"
color brightred "^##.*"
color brightmagenta "^###.*"
color brightyellow "^####.*"
color brightblue "^#####.*"
# Linkified URLs (and inline html tags)
color brightmagenta start="<" end=">"
# Links
color brightmagenta "\[.*\](\([^\)]*\))?"
# Link id's:
color brightmagenta "^\[.*\]:( )+.*"
# Code spans
color brightyellow "`[^`]*`"
# Code blocks
# disabled, because indented lines aren't always code blocks
# color brightyellow "^( ).*"
# Links and inline images
color brightred start="!\[" end="\]"
color white start="\[" end="\]"
# Lists
color brightyellow "^( )*(\*|\+|\-|[0-9]+\.) "
# <hr>
color ,red "^\* \* \*.*$"
color ,red "^- - -.*$"
color ,yellow "^-----.*$"
color ,red "^----.*$"
color ,red "^---.*$"