Coder plugin (2)
- Author
- Message
-
Offline
- Posts: 3217
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
-
Offline
- Posts: 366
- Joined: Mon Jan 10, 2011 5:28 pm
- Contact:
-
Offline
- Posts: 47
- Joined: Fri Mar 27, 2015 7:46 am
Highlighting and folding of Markdown syntax - is there anything like it available?
Or a tutorial how to create my own lexer for markdown syntax? I am mostly interested in folding #headings and ##subheadings.
Please excuse me if this is the wrong section - the English discussion seems to general for something syntax-related like Markdown.
Or a tutorial how to create my own lexer for markdown syntax? I am mostly interested in folding #headings and ##subheadings.
Please excuse me if this is the wrong section - the English discussion seems to general for something syntax-related like Markdown.
-
Offline
- Posts: 3217
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Is here: http://akelpad.sourceforge.net/files/pl ... r/md.coderAkuro wrote:Highlighting and folding of Markdown syntax - is there anything like it available?
-
Offline
- Posts: 47
- Joined: Fri Mar 27, 2015 7:46 am
Thank you KDJ,
I put the file as md.coder into \AkelFiles\Plugs\Coder, where all the other coders reside.
I also added a line to ContextMenu::ShowMenu under the heading
Can't get it to work, though. Opened coder.ini and Akelpad.ini for any clues, also browsed Coder-Eng.txt, but I am stuck.
I put the file as md.coder into \AkelFiles\Plugs\Coder, where all the other coders reside.
I also added a line to ContextMenu::ShowMenu under the heading
Code: Select all
"SYNTAXTHEME"
{
"MarkDown" Call("Coder::Settings", 1, "md")
-
Offline
- Posts: 3217
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
Akuro
Start this code from menu or a button:and try again.
Start this code from menu or a button:
Code: Select all
-"Update Coder-cache" Call("Coder::Settings", 2)
-
Offline
- Posts: 1250
- Joined: Thu Nov 16, 2006 11:53 am
- Location: Kyiv, Ukraine
Похоже, все до сих пор игнорируют настройку "Умный кеш" ("Smart cache").
А ведь она была добавлена специально для того, чтобы при старте AkelPad его кеш автоматически обновлялся при любых изменениях в файлах .coder ! (При любых изменениях = модификации, добавлении нового файла или удалении старого файла .coder)
А ведь она была добавлена специально для того, чтобы при старте AkelPad его кеш автоматически обновлялся при любых изменениях в файлах .coder ! (При любых изменениях = модификации, добавлении нового файла или удалении старого файла .coder)
-
Offline
- Posts: 47
- Joined: Fri Mar 27, 2015 7:46 am
VladSH
thank you very much. Running your code did the trick.
One more thing, if you don't mind - I wonder if I could get folding in a hierarchical fashion, to see indented folds in the folds panel, nested inside others, depending on heading levels.
Here is what I entered into md.coder under the Folds-section:
I simply followed the example of ini.coder, which seemed similar to get folding for complete sections. And it works OK for my headings.
But since I use Akelpad for writing long, structured documents, it were great if the fold panel would unfold like this:
If I knew how to do this, I could even use txt -files and set up my own schemes for headings instead of abusing Markdown for it. Any suggestions for what I should enter into the .coder file to achieve this?
thank you very much. Running your code did the trick.
One more thing, if you don't mind - I wonder if I could get folding in a hierarchical fashion, to see indented folds in the folds panel, nested inside others, depending on heading levels.
Here is what I entered into md.coder under the Folds-section:
Code: Select all
;173=1+4+8+32+128
173 0 0 0 "#" "#" ""
173 0 0 0 "##" "##" ""
...
But since I use Akelpad for writing long, structured documents, it were great if the fold panel would unfold like this:
Code: Select all
# heading 1
## heading 1.1
# heading 2
## heading 2.1
### heading 2.1.1
### heading 2.1.2
## heading 2.2
# heading 3
...
-
Offline
- Posts: 1161
- Joined: Sun Oct 20, 2013 11:44 am
Good ideaAkuro wrote:If I knew how to do this, I could even use txt -files and set up my own schemes for headings instead of abusing Markdown for it.
For example http://rghost.ru/6bxxGJPPj/image.png
-
Offline
- Posts: 3217
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
-
Offline
- Posts: 47
- Joined: Fri Mar 27, 2015 7:46 am
Skif_off
THANK YOU. This looks very promising.
I still need to understand some of the end-stuff === and --- or how to apply/ modify it. Been reading coder-help but this does not come easy. Guess I have to look at more .coder examples to make more sense of it.
Any help resources I am not aware of? For instance, is it possible to apply RegEx rules for start/end? Such as "^#" to apply the end-rule to line beginnings only?
THANK YOU. This looks very promising.
I still need to understand some of the end-stuff === and --- or how to apply/ modify it. Been reading coder-help but this does not come easy. Guess I have to look at more .coder examples to make more sense of it.
Any help resources I am not aware of? For instance, is it possible to apply RegEx rules for start/end? Such as "^#" to apply the end-rule to line beginnings only?
-
Offline
- Posts: 1161
- Joined: Sun Oct 20, 2013 11:44 am
Akuro
Unfortunately my English is bad In a few words.
You can see flags for HighLight and CodeFold in any coder-file.
works with
and don't works with
Rule "^\s++#" don't works because regular expression not fixed length. But flag 8 (fold start located at line start) will work in both cases.
Unfortunately my English is bad In a few words.
You can see flags for HighLight and CodeFold in any coder-file.
Yes, but RegEx rule"^#" - inconvenient:Akuro wrote:For instance, is it possible to apply RegEx rules for start/end? Such as "^#" to apply the end-rule to line beginnings only?
works with
Code: Select all
# text
Code: Select all
# text
We need to specify the beginning and end of the block for folding, but where is the end in your example? So I added rare text's combinations "===" and "---", now we have the correct form and folding (you can choose another symbols).Akuro wrote:I still need to understand some of the end-stuff === and --- or how to apply/ modify it.