Coder plugin (2)

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Instructor
Предлагаю в xml.coder добавить *.ts - все локализации на Transifex идут в xml-формате.

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

VladSh
А ещё это файлы torrent stream.

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

И транспортный поток MPEG-TS HDTV

Offline
Posts: 47
Joined: Fri Mar 27, 2015 7:46 am

Post by Akuro »

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.

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

FeyFre, Lenchik
Это добро вряд ли кто-то будет пытаться открыть в AkelPad. Вот если бы кто-то попросил сделать ассоциации на запуск этого файла в AkelPad, тогда да.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Akuro wrote:Highlighting and folding of Markdown syntax - is there anything like it available?
Is here: http://akelpad.sourceforge.net/files/pl ... r/md.coder

Offline
Posts: 47
Joined: Fri Mar 27, 2015 7:46 am

Post by Akuro »

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

Code: Select all

"SYNTAXTHEME"
{
    "MarkDown" Call("Coder::Settings", 1, "md")
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. :cry:

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Akuro
Start this code from menu or a button:

Code: Select all

-"Update Coder-cache" Call("Coder::Settings", 2)
and try again.

DV
Offline
Posts: 1250
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

Похоже, все до сих пор игнорируют настройку "Умный кеш" ("Smart cache").
А ведь она была добавлена специально для того, чтобы при старте AkelPad его кеш автоматически обновлялся при любых изменениях в файлах .coder ! (При любых изменениях = модификации, добавлении нового файла или удалении старого файла .coder)
Image

Offline
Posts: 47
Joined: Fri Mar 27, 2015 7:46 am

Post by Akuro »

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:

Code: Select all

;173=1+4+8+32+128
173	0	0	0	"#"      "#"      ""
173	0	0	0	"##"      "##"      ""
...
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:

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
...
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?

Offline
Posts: 1161
Joined: Sun Oct 20, 2013 11:44 am

Post by Skif_off »

Akuro 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.
Good idea :)
For example http://rghost.ru/6bxxGJPPj/image.png

Code: Select all

...

Quotes:
;1+4
5	1	${STR}	0	`"`	`"`	""	""	""
;1+4+512
517	3	${VAR}	0	"###"	""	""	""	""
517	4	${OP}	0	"##"	""	""	""	""
517	2	0	0	"#"	""	""	""	""
...

Folds:
;141=1+4+8+32+128+256
429	0	0	0	"# "	"# "	""
429	0	0	0	"## "	"==="	""
429	0	0	0	"### "	"---"	""
...

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Skif_off
Хорошо! Но вместо # лучше использовать §.

Offline
Posts: 1161
Joined: Sun Oct 20, 2013 11:44 am

Post by Skif_off »

VladSh
Набросал на примере Akuro, заменить не проблема :) Сам при необходимости использую в txt.coder правило как в ini.coder для секций (*** пометка), вложенность как-то пока не требовалась.

Offline
Posts: 47
Joined: Fri Mar 27, 2015 7:46 am

Post by Akuro »

Skif_off
THANK YOU. This looks very promising. 8)
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

Post by Skif_off »

Akuro
Unfortunately my English is bad :( In a few words.
You can see flags for HighLight and CodeFold in any coder-file.
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?
Yes, but RegEx rule"^#" - inconvenient:
works with

Code: Select all

# text
and don't works with

Code: Select all

        # text
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.
Akuro wrote:I still need to understand some of the end-stuff === and --- or how to apply/ modify it.
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).
Locked