<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to understand the functionlist parameters]]></title><description><![CDATA[<p dir="auto">Oh, I’m having trouble just understanding what I’m doing here.</p>
<p dir="auto">I’m creating a custom Notepad++ FunctionList. I know how to add it, and it’s parsing, but I can’t figure out from the docs how to specify the regex correctly.</p>
<p dir="auto">In my code file (for a program called Squiffy), it has sections, kind of like an .ini file, so I started by copying the ini file’s functionlist code.</p>
<p dir="auto">I’m looking for sections like this: &lsqb;&lsqb;something&rsqb;&rsqb;: on it’s own line, and for subsections like this: [somesubsection]:.</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;

&lt;NotepadPlus&gt;
    &lt;functionList&gt;
        &lt;!-- File format used for: .sq         --&gt;
        &lt;parser displayName="Squiffy" id="Squiffy" 
            commentExpr=""
        &gt;
            &lt;function mainExpr=mainExpr="^\[\[.*\]\]\:$" &gt;
                &lt;functionName&gt;
                    &lt;nameExpr expr="^\[\[.*\]\]*"/&gt;
                &lt;/functionName&gt;
            &lt;/function&gt;
        &lt;/parser&gt;
    &lt;/functionList&gt;
&lt;/NotepadPlus&gt;

</code></pre>
<p dir="auto">Here is what a file could contain:</p>
<pre><code>&lsqb;&lsqb;start&rsqb;&rsqb;:
Something here with a &lsqb;&lsqb;link to another section&rsqb;&rsqb;(a section).
show [passage].

[passage]:
Here is a link to &lsqb;&lsqb;start&rsqb;&rsqb; and another &lsqb;&lsqb;link to start&rsqb;&rsqb;(start).

&lsqb;&lsqb;a section&rsqb;&rsqb;:
Finally, a section.
</code></pre>
<p dir="auto">In my functionlist, I want to see a list containing &lsqb;&lsqb;start&rsqb;&rsqb;: , [passage]: and &lsqb;&lsqb;a section&rsqb;&rsqb;  - just the ones with the colon at the end, and on their own lines.  In the list itself, though, I think I want to display the brackets so I can tell sections from passages (subsections) but without the colons at the end.</p>
<p dir="auto">My problem is, (even after reading the docs) is that I don’t really understand what mainExpr and nameExpr are looking for.</p>
<p dir="auto">Docs say:  “mainExpr: it’s the regex to get the whole string which contains all the informations you need.”  What?!  What is “the whole string”?  Would the whole string be the function name?  If so, then what is nameExpr?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20390/how-to-understand-the-functionlist-parameters</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 04:46:25 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20390.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Nov 2020 20:01:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to understand the functionlist parameters on Wed, 02 Dec 2020 11:30:28 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-coder</a>,</p>
<p dir="auto">Could you <strong>confirm</strong> me that the <strong>regexes</strong> should act as below :</p>
<pre><code class="language-z">Case A  ^&lsqb;&lsqb;&rsqb;&rsqb;:                                    =&gt;  Unchanged
Case B  ^&lsqb;&lsqb;aaaaa&rsqb;&rsqb;:                               =&gt;  Unchanged
Case C  &lsqb;&lsqb;bbbbb&rsqb;&rsqb; not followed by (ccccc)         =&gt;  Unchanged
Case D  (eeeee)   preceded by &lsqb;&lsqb;ddddd&rsqb;&rsqb;           =&gt;  Unchanged

Case E  ^[]:                                      =&gt;  Unchanged 
Case F  [fffff] not followed by (gggggg)          =&gt;  [-fffff]
Case G  (iiiii) preceded by [hhhhh]               =&gt;  (-iiiii)
Case H  ^[jjjjj]:                                 =&gt;  [-jjjjj]:
</code></pre>
<p dir="auto">Note that, when cases <strong>F</strong> or <strong>G</strong> occur, the respective passage <strong><code>fffff</code></strong> or <strong><code>iiiii</code></strong> may be <strong>defined</strong> or <strong>not</strong></p>
<p dir="auto">See you later,</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60365</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60365</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 02 Dec 2020 11:30:28 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Mon, 30 Nov 2020 17:18:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> haha - you are relentless!</p>
<p dir="auto">So, you can <code>Click on [this link](-passage)</code>  where <code>[this link]</code> could be any text at all and it creates a link to what is in the parenthesis where <code>(-passage)</code> must be the same as in <code>[-passage]:</code>  (the definition).  The parenthesis always come after the link text.</p>
<p dir="auto">Bascially, we are using this text to generate an html link.  What is in the <code>[ ]</code> is the link text.  What is in the parenthesis comes as a property called <code>data-passage</code> in the <code>&lt;a&gt;</code> element.</p>
<p dir="auto">There is no limit on the amount of lines between a link and a definition.</p>
<p dir="auto">If I used dashes, I think we would put them in the definition for the passages.  So, anywhere we have <code>[somepassagename]:</code>  with the <code>:</code> at the end.  We would also have to use them in the links themselves.</p>
<pre><code>&lsqb;&lsqb;Some Section&rsqb;&rsqb;:
Here is a section!
Click [here](-a passage) to display the passage.
Or we could display the link like:  [-a passage] and we don't need the parenthesis to tell us what passage.  The parenthesis are only needed if we use link text that is different than the definition name.  You see we can do it both ways.
Or we can summon [this one](-a global passage) or like this: [-a global passage]
Because we can call a global passage from any section.

[-a passage]:
Aha!  A passage has been revealed.

&lsqb;&lsqb;&rsqb;&rsqb;:
Behold! The Global Section.

[-a global passage]:
And this is text in a global passage.
</code></pre>
<p dir="auto">Uh, since a passage only exists for each section, that means you can have passages with the same name in different sections, but you can’t have two with the same name in the same section.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60326</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60326</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Mon, 30 Nov 2020 17:18:06 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Mon, 30 Nov 2020 09:45:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-coder</a>,</p>
<p dir="auto">OK ! I <strong>don’t</strong> give up, anyway ;-))</p>
<p dir="auto">One more question :</p>
<p dir="auto">Do sentences like <strong><code>Click on [this link](-passage)</code></strong> or <strong><code>You could click on this link [-passage] to get the whole story</code></strong> <strong>always</strong> come <strong>before</strong> the <strong><code>[-passage]:</code></strong> definition ?</p>
<p dir="auto">And what is the <strong>maximum</strong> of lines, which may <strong>separates</strong> a <strong>link</strong> from the <strong>definition</strong> ?</p>
<hr />
<p dir="auto">Also, could you provide your <strong>sample</strong> code, placing a <strong>dash</strong> <strong><code>-</code></strong> everywhere <strong>needed</strong> ? Just to visualize all the <strong>modifications</strong> to do with the <strong>regex</strong> S/R. Of course, I suppose :</p>
<ul>
<li>
<p dir="auto">In passage <strong>definition</strong> as in <strong><code>[-apassage]:</code></strong></p>
</li>
<li>
<p dir="auto">In passage <strong>link</strong> as in <strong><code>Check out the [passage](-globalpassage)</code></strong></p>
</li>
<li>
<p dir="auto">Now, in the sentence <strong>above</strong>, does <strong><code>[passage]</code></strong>, <strong>right before</strong> <strong><code>(-globalpassage)</code></strong>, need to be written  <strong><code>[-passage]</code></strong>, too ?</p>
</li>
<li>
<p dir="auto">And, in sentences like <strong><code>this link [passage] will give you some hints</code></strong>, does <strong><code>[passage]</code></strong> need to be written  <strong><code>[-passage]</code></strong> ?</p>
</li>
</ul>
<p dir="auto">Thanks for your <strong>cooperation</strong> !</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60285</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60285</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 30 Nov 2020 09:45:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sun, 29 Nov 2020 18:36:03 GMT]]></title><description><![CDATA[<p dir="auto">Now, with the idea of “preparing” the squiffy text, I played with the idea of putting a <code>-</code> at the start of a passage name and squiffy doesn’t mind that.</p>
<pre><code>&lsqb;&lsqb;section&rsqb;&rsqb;:
Click on [this link](-passage)
[-passage]:
Hi there!
</code></pre>
<p dir="auto">The squiffy compiler converts <code>[this link](-passage)</code> into a link like this (and adds a class called “disabled” after you click on it):</p>
<pre><code>&lt;a class="squiffy-link link-passage" data-passage="-passage" role="link" tabindex="-1"&gt;this link&lt;/a&gt;
</code></pre>
<p dir="auto">So, we could do something like you suggest by adding a <code>-</code> or <code>_</code> at the start of a passage name.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60284</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60284</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sun, 29 Nov 2020 18:36:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sun, 29 Nov 2020 18:26:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> You are a clever and industrious fellow!</p>
<p dir="auto">Nice solution!  I am very impressed.  The only problem, and I hate to say this, is that it is impractical.</p>
<ul>
<li>When a squiffy authour wants to create a link to a pssage, he’ll have to type exactly what is in the <code>[passage]</code>.  For example, just above your <code>[     * apassage]:</code> you can see the text <code>click on [apassage].</code>  Those have to match.  And again, the line above that, <code>Check out the [passage](globalpassage)</code> - the coder would have to type: <code>Check out the [passage](    * globalpassage)</code>.  I know, it gets a little strange - in the second case, the words in the <code>[x]</code> indicate it is a link and the text can be anything, but the <code>( )</code> contains the link to the actual <code>[globalpassage]:</code>.</li>
</ul>
<p dir="auto">The other thing that makes it impractical, is that I’d like to share this with other squiffy users, and from reading in the forums, they have a hard enough time with just squiffy code - they’ll never be able to manage something as compilcated as using a notepad macro.</p>
<p dir="auto">In the end, all I really want is the functionlist.  I’m sorry to tell you that I don’t want to use your fancy macro method - although you prove your cleverness here and it’s awesome.</p>
<p dir="auto">For your tests - I found out that if I type <code>[ ]</code></p><div class="plugin-markdown"><input type="checkbox" />strange, eh?</div><p></p>
]]></description><link>https://community.notepad-plus-plus.org/post/60282</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60282</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sun, 29 Nov 2020 18:26:53 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sun, 29 Nov 2020 19:03:30 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <strong>All</strong>,</p>
<p dir="auto">When writing on our <strong>forum</strong>, some of us noticed that, sometimes, backslahes <strong><code>\</code></strong> are <strong>omitted</strong>, <em>after</em> submitting their posts !</p>
<p dir="auto">I did some <strong>additionnal</strong> tests. Now, I get it !</p>
<p dir="auto">The rules are :</p>
<ul>
<li>
<p dir="auto">To display a <strong><code>\\[</code></strong> string, on our forum, if <strong>not followed</strong> with an other <strong>opening</strong> squared bracket <strong><code>[</code></strong>, you need to type a <strong>leading</strong> <strong><code>backslash</code></strong>, so the syntax <strong><code>\\\[</code></strong></p>
</li>
<li>
<p dir="auto">To display a <strong><code>\\]</code></strong> string, on our forum, if <strong>not followed</strong> with an other <strong>ending</strong> squared bracket <strong><code>]</code></strong>, you need to type a <strong>leading</strong> <strong><code>backslash</code></strong>, so the syntax <strong><code>\\\]</code></strong></p>
</li>
<li>
<p dir="auto">To display the <strong><code>\&lsqb;&lsqb;</code></strong> or <strong><code>\&rsqb;&rsqb;</code></strong> strings, juste write them, without any <strong>extra</strong> character</p>
</li>
</ul>
<hr />
<p dir="auto">To  <strong>automate</strong> the sequence, you could use the following <strong>regex</strong> S/R :</p>
<p dir="auto">SEARCH <strong><code>\\\\[(?!\\[)|\\\\](?!\\])</code></strong></p>
<p dir="auto">REPLACE <strong><code>\\$0</code></strong></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60281</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60281</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 29 Nov 2020 19:03:30 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sun, 29 Nov 2020 17:50:12 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@bgm-coder</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14">@MAPJe71</a> and <strong>All</strong>,</p>
<p dir="auto">OK ! So, as you prefer to go on <strong>without</strong> comments at all, we <strong>cannot</strong> use ( at least, <strong>easily</strong> ! ) the <strong><code>class</code></strong> structure and be <strong>stuck</strong> to <strong><code>Function</code></strong> definition, <strong>only</strong> !</p>
<p dir="auto">But, as <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14">@MAPJe71</a> said :</p>
<blockquote>
<p dir="auto">It’s not possible to add text that’s not in the document</p>
</blockquote>
<p dir="auto">So, how to get a <strong>difference</strong> when displaying <strong><code>&lsqb;&lsqb;sections&rsqb;&rsqb;</code></strong> and <strong><code>[passages]:</code></strong> in <strong><code>Function List</code></strong> ?</p>
<p dir="auto">Well, as the <strong><code>Function List</code></strong> feature <strong>cannot</strong> change text, we may <strong>reverse</strong> the problem :</p>
<ul>
<li>
<p dir="auto">We will <strong>change</strong> your <strong><code>Squiffy</code></strong> code, with a <strong>regex</strong> S/R, stored in a <strong>macro</strong>, <strong>before</strong> using <strong><code>Function List</code></strong></p>
</li>
<li>
<p dir="auto">You elaborate your <strong><code>Squiffy</code></strong> code, as you like, with the <strong>help</strong> of the <strong><code>Function List</code></strong> feature and a <strong>nice</strong> displaying</p>
</li>
<li>
<p dir="auto">You may get, at any time, your <strong>regular</strong> <strong><code>Squiffy</code></strong> code, using a <strong>second</strong> macro, which <strong>undo</strong> the <strong>few</strong> modifications done by the <strong>first</strong> macro</p>
</li>
</ul>
<hr />
<p dir="auto">Essentially, the <strong>modifications</strong> concern the <strong><code>[passage]:</code></strong> and <strong><code>&lsqb;&lsqb;&rsqb;&rsqb;:</code></strong> forms. For a <strong>best</strong> readability, I chose :</p>
<pre><code class="language-z">-  [passage]:  is changed as   [   • passage]:

-  &lsqb;&lsqb;&rsqb;&rsqb;:       is changed as   &lsqb;&lsqb;    &rsqb;&rsqb;
</code></pre>
<ul>
<li>
<p dir="auto">These <strong>modifications</strong> will be performed by a <strong>first</strong> macro, named <strong><code>Squiffy for Function List</code></strong></p>
</li>
<li>
<p dir="auto">Of course, the <strong>second</strong> macro, named <strong>`Regular Squiffy Syntax</strong>, will <strong>undo</strong> all these modifications</p>
</li>
</ul>
<p dir="auto">Note that the <strong>searches/replacements</strong>, performed by these macros, are <strong>safe</strong> ! Running these macros, more than <strong>once</strong>, consecutively, does <strong>nothing</strong> else ;-))</p>
<p dir="auto">Remember that you may <strong>associate</strong> a keyboard <strong>shortcut</strong> to any macro, using the <strong><code>Macro &gt; Modify Shortcut or Delete Macro...</code></strong> menu option and <strong>double</strong>-clicking on the <strong>concerned</strong> line !</p>
<p dir="auto">The <strong>first</strong> macro will use the <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>^\\[([^\\[\\]\h\r\n][^\\[\\]\r\n]+\\]:)$|^\Q&lsqb;&lsqb;&rsqb;&rsqb;:\E$</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>?1[\x20\x20\x20\x20\x{2022}\x20\1:&lsqb;&lsqb;\x20\x20\x20\x20&rsqb;&rsqb;:</code></strong></p>
</li>
</ul>
<p dir="auto">And the <strong>second</strong> macro will use the <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>\&lsqb;&lsqb;\x20\x{2022}]+</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>[</code></strong></p>
</li>
</ul>
<p dir="auto">So, in the <strong><code>&lt;macros&gt;.......&lt;/macros&gt;</code></strong> node of your <strong>active</strong> shortcuts.xml ( probably in <strong><code>%AppData%\Notepad++</code></strong> ), insert the following <strong>macros</strong>, with an <strong>other</strong> editor than <strong>Notepad++</strong> :</p>
<pre><code class="language-xml">        &lt;Macro name="Squiffy for Function List" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="^\\[([^\\[\\]\h\r\n][^\\[\\]\r\n]+\\]:)$|^\Q&lsqb;&lsqb;&rsqb;&rsqb;:\E$" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="?1[\x20\x20\x20\x20\x{2022}\x20\1:&lsqb;&lsqb;    &rsqb;&rsqb;:" /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="768" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;
        &lt;/Macro&gt;

        &lt;Macro name="Regular Squiffy Syntax" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="\&lsqb;&lsqb;\x20\x{2022}]+" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="[" /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="768" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;
        &lt;/Macro&gt;
</code></pre>
<ul>
<li>Now, insert this <strong>parser</strong> in an <strong><code>XML</code></strong> file, named <strong><code>squiffy.xml</code></strong> in the <strong><code>functionList</code></strong> folder</li>
</ul>
<pre><code class="language-xml">			&lt;parser
				id="squiffy" displayName="Squiffy" commentExpr=""
			&gt;
				&lt;function
					mainExpr="^\\[(\\[([^\\[\\]\r\n]+)\\]|\h*(?2)|\\[\h*\\])\\]:$"
				&gt;
					&lt;functionName&gt;
						&lt;nameExpr expr="[^\\[\\]\r\n]+|^\\[\\[\h*\\]\\]" /&gt;
					&lt;/functionName&gt;
				&lt;/function&gt;
			&lt;/parser&gt;
</code></pre>
<p dir="auto">Then, you have <strong>two</strong> possibilities to <strong>activate</strong> the <strong><code>Function List</code></strong> mechanism :</p>
<ul>
<li>Use the <strong><code>Normal text</code></strong> pseudo-language, with the line :</li>
</ul>
<pre><code class="language-xml">			&lt;association id= "squiffy.xml"    langID= "0" /&gt;    &lt;!--  NORMAL text ID  --&gt;
</code></pre>
<ul>
<li>Use a <strong><code>User Defined Language</code></strong> , with the line :</li>
</ul>
<pre><code class="language-xml">			&lt;association id= "squiffy.xml"    userDefinedLangName="Squiffy"/&gt;
</code></pre>
<p dir="auto">Finally :</p>
<ul>
<li>
<p dir="auto">In the <strong>first</strong> case, just open your <strong><code>Squiffy</code></strong> code with the <strong><code>Normal text</code></strong> pseudo language</p>
</li>
<li>
<p dir="auto">In the <strong>second</strong> case, open your <strong><code>Squiffy</code></strong> code with the <strong><code>User Defined Language - Squiffy</code></strong> language, providing that you previously created it with the <strong><code>Language &gt; User Defined Language &gt; Define your language...</code></strong> menu option</p>
</li>
</ul>
<hr />
<p dir="auto">So, assuming your <strong>last</strong> example :</p>
<ul>
<li>First perform the macro <strong><code>Squiffy for Function List</code></strong> against your <strong>regular</strong> <strong><code>Squiffy</code></strong> code</li>
</ul>
<p dir="auto">You should get the <strong>modified</strong> code, below :</p>
<pre><code class="language-diff">@start start

&lsqb;&lsqb;start&rsqb;&rsqb;:

@set life=10
@set thislink=dynalink1
You start with 10 life.
go to &lsqb;&lsqb;second&rsqb;&rsqb;
Check out the [passage](globalpassage)
go to &lsqb;&lsqb;this link&rsqb;&rsqb;(dynalink1)

&lsqb;&lsqb;empty section&rsqb;&rsqb;:

[    • empty's passage]:
You don't need to have anything in a section or in a passage.  
Of course, that makes for bad story flow, but it's possible.

&lsqb;&lsqb;second&rsqb;&rsqb;:
go to &lsqb;&lsqb;dead&rsqb;&rsqb;
go to &lsqb;&lsqb;start&rsqb;&rsqb;
go to &lsqb;&lsqb;{thislink}&rsqb;&rsqb;
Check out the [passage](globalpassage)
click on [apassage].

[    • apassage]:

[    • anotherpassage]:

More stuff. You can see that text doesn't *need* to follow on the line directly under the passage or section.  In fact, squiffy honours newlines.

[    • third passage]:
As you can see, a passage or even a section, can contain spaces.
There can be as many passages as you want, but they only belong to the section they appear under.

&lsqb;&lsqb;dead&rsqb;&rsqb;:
You have been decapitated and lose 10 life.
{@life=0} (this is how you set variables - which save as javascript localstorage cookies)

&lsqb;&lsqb;dynalink1&rsqb;&rsqb;:
    set("thislink","dynalink2");  //this line is javascript, so it has to be indented 4 spaces
alert("bob");  //this looks like javascript, but will be interpreted as text since it's not indented
Well, howdy, doody!
go to &lsqb;&lsqb;second&rsqb;&rsqb;

&lsqb;&lsqb;dynalink2&rsqb;&rsqb;:
    set("thislink","dynalink1");
Baby Shark!
go to &lsqb;&lsqb;second&rsqb;&rsqb;

&lsqb;&lsqb;    &rsqb;&rsqb;:
This, my friend, is a global passage.
Life: {life}
{if life&lt; 1:
you are dead
}
[    • globalpassage]:
Why, hello, there!
</code></pre>
<ul>
<li>Now, click on the <strong><code>View &gt; Function List</code></strong> menu option.: here we are ! We get the <strong>picture</strong> :</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1606670979893-2a80f6fb-7692-428e-8fbc-03006ecf6639-image.png" alt="2a80f6fb-7692-428e-8fbc-03006ecf6639-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Do you like it ? If <strong>not</strong>, no problem ! We may “prepare” your <strong>regular</strong> <strong><code>Squiffy</code></strong> code for <strong>any other</strong> kind of displaying, in the <strong><code>Function List</code></strong> panel ;-))</p>
<p dir="auto">Remember, these <strong>two</strong> gestures, available since Notepad++ <strong><code>7.9.1</code></strong> :</p>
<pre><code class="language-z">26. Add TAB keystroke in Function List to switch between search field and list (Fix 8665).
27. Add ESC keystroke in Function List to switch to edit window (Fix #8886).
</code></pre>
<p dir="auto">See you later !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60279</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60279</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 29 Nov 2020 17:50:12 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sun, 29 Nov 2020 01:26:45 GMT]]></title><description><![CDATA[<p dir="auto">Hi, Guy!</p>
<p dir="auto">So, first, we can’t do brackets like you have there in that image (I suppose you understand that already and are just doing that for demonstration).</p>
<ul>
<li>A passage can only appear after a section, but you can have as many passages as you want.</li>
<li>A section does not have to have any passages.</li>
<li>A section ends when the next section begins. That’s the only way of knowing what is inside a passage.</li>
<li>curly brackets have their own meaning</li>
<li>There is also a “global section” that can be anywhere in the script, that looks like this: <code>&lsqb;&lsqb;&rsqb;&rsqb;:</code> just like a section but with no name.  Normally it wouldn’t have passages, but I’ve sort of made some adjustments, so mine actually can have passages.</li>
<li>there is only one global section.</li>
</ul>
<p dir="auto">Comments - well, the code admits any kind of javascript (with an indentation of 4 spaces to make squiffy realize it’s javascript) or html.  You can use both kinds of comments, in fact.  But I don’t want to use comments for structuring anything - I’d rather settle on the functionlist display we’ve already got before I’d do that.</p>
<p dir="auto">For some sample code to play with, try this:</p>
<pre><code>@start start

&lsqb;&lsqb;start&rsqb;&rsqb;:

@set life=10
@set thislink=dynalink1
You start with 10 life.
go to &lsqb;&lsqb;second&rsqb;&rsqb;
Check out the [passage](globalpassage)
go to &lsqb;&lsqb;this link&rsqb;&rsqb;(dynalink1)

&lsqb;&lsqb;empty section&rsqb;&rsqb;:

[empty's passage]:
You don't need to have anything in a section or in a passage.  
Of course, that makes for bad story flow, but it's possible.

&lsqb;&lsqb;second&rsqb;&rsqb;:
go to &lsqb;&lsqb;dead&rsqb;&rsqb;
go to &lsqb;&lsqb;start&rsqb;&rsqb;
go to &lsqb;&lsqb;{thislink}&rsqb;&rsqb;
Check out the [passage](globalpassage)
click on [apassage].

[apassage]:

[anotherpassage]:

More stuff. You can see that text doesn't *need* to follow on the line directly under the passage or section.  In fact, squiffy honours newlines.

[third passage]:
As you can see, a passage or even a section, can contain spaces.
There can be as many passages as you want, but they only belong to the section they appear under.

&lsqb;&lsqb;dead&rsqb;&rsqb;:
You have been decapitated and lose 10 life.
{@life=0} (this is how you set variables - which save as javascript localstorage cookies)


&lsqb;&lsqb;dynalink1&rsqb;&rsqb;:
    set("thislink","dynalink2");  //this line is javascript, so it has to be indented 4 spaces
alert("bob");  //this looks like javascript, but will be interpreted as text since it's not indented
Well, howdy, doody!
go to &lsqb;&lsqb;second&rsqb;&rsqb;


&lsqb;&lsqb;dynalink2&rsqb;&rsqb;:
    set("thislink","dynalink1");
Baby Shark!
go to &lsqb;&lsqb;second&rsqb;&rsqb;

&lsqb;&lsqb;&rsqb;&rsqb;:
This, my friend, is a global passage.
Life: {life}
{if life&lt; 1:
you are dead
}
[globalpassage]:
Why, hello, there!
</code></pre>
<p dir="auto">I’m not sure what you mean by “resulting text”.  It’s an interactive story that squiffy builds - an html page running jquery behind which hides and shows parts of the story depending on where you click.</p>
<p dir="auto">But if you mean by “resulting text” as what should display in the functionlist, well, here you go:</p>
<pre><code>start
empty section
    empty's passage
second
    apassage
    anotherpassage
    third passage
dead
dynalink1
dynalink2
&lsqb;&lsqb;&rsqb;&rsqb;         &lt;------------------a tricky one, since it has no text.  Maybe it should say GLOBAL 
    globalpassage
</code></pre>
<p dir="auto">That Global section probably can’t work out, so if we had to leave it out, I would still be very happy to have all the rest.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60268</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60268</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sun, 29 Nov 2020 01:26:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sun, 29 Nov 2020 00:02:38 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@bgm-coder</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14">@MAPJe71</a> and <strong>All</strong>,</p>
<p dir="auto">I did some <strong>tests</strong> and I tried to get some <strong>hints</strong> from your site    <a href="http://docs.textadventures.co.uk/squiffy/" rel="nofollow ugc">http://docs.textadventures.co.uk/squiffy/</a>    but I’m still <strong>not</strong> satisfied !</p>
<p dir="auto">Some questions :</p>
<ul>
<li>
<p dir="auto"><strong>A</strong> – May a <strong><code>[passage]:</code></strong> block exist <strong>outside</strong> a <strong>`&lsqb;&lsqb;section&rsqb;&rsqb;:</strong> block ?</p>
</li>
<li>
<p dir="auto"><strong>B</strong> – May a <strong><code>&lsqb;&lsqb;section&rsqb;&rsqb;:</code></strong> block exist <strong>without any</strong> <strong><code>[passage]:</code></strong> block inside ?  Note, as <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a> said, that, in case of a positive answer, it <strong>not</strong> possible to display that <strong>specific</strong> section ( given this possible scheme  <strong><code>&lsqb;&lsqb;section&rsqb;&rsqb;: = class</code></strong> and <strong><code>[passage]: = function</code></strong> )</p>
</li>
<li>
<p dir="auto"><strong>C</strong> – Have you the possibility to easily insert <strong>comments</strong> in your code. I’m asking this question because I was able to get a <strong>different</strong> view for <strong><code>&lsqb;&lsqb;section&rsqb;&rsqb;</code></strong> and <strong><code>[passage]:</code></strong>, in the <strong><code>Function List</code></strong> panel, but <em>ONLY IF</em>  I add an <strong>opening</strong> and <strong>closing symbols</strong>, <strong><code>{</code></strong> and <strong><code>}</code></strong>, in order to delimit exactly the <strong>scope</strong> of, both, <strong><code>section&rsqb;&rsqb;:</code></strong> and <strong><code>[passage]</code></strong> blocks and get a <strong>hierarchical</strong> structure as shown below :</p>
</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1606608020171-b76123c7-d8a0-44cd-8483-9d02038038fc-image.png" alt="b76123c7-d8a0-44cd-8483-9d02038038fc-image.png" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">Now, regarding the problem of modifying your <strong>initial</strong> code to get some extra <strong>indentation</strong> or anything else, this can be resolved with some <strong>regexes</strong>, as it seems totally <strong>independent</strong> of the <strong><code>Function List</code></strong> feature. So, just provide us, both :</p>
<ul>
<li>
<p dir="auto">A fair enough amount of your <strong>initial</strong> code ( if not <strong>personal</strong> nor <strong>confidential</strong>, of course ! )</p>
</li>
<li>
<p dir="auto">The <strong>resulting</strong> text that you expect to</p>
</li>
</ul>
<p dir="auto">I’m quite <strong>confident</strong> to solve this part !</p>
<p dir="auto">See you later,</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60267</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60267</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 29 Nov 2020 00:02:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 21:12:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14">@MAPJe71</a> ,</p>
<p dir="auto">Thanks for your expert knowledge.  It’s good to get that confirmed.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-Coder</a> ,</p>
<p dir="auto">I think your best bet right now is for the idea you had earlier, of keeping the <code>&lsqb;&lsqb;</code> in section and rejecting the <code>[</code> in passages… <s>I’ve got an idea in that realm that I’m exploring now… though <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14">@MAPJe71</a> might beat me to it.</s></p>
<p dir="auto"><strong>edit</strong>: nevermind, that’s what Guy already gave you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60264</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60264</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 28 Nov 2020 21:12:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 21:10:51 GMT]]></title><description><![CDATA[<p dir="auto">Ah, I get it.  okay.  That makes it more difficult, then.</p>
<p dir="auto">Alright.  I can live with what we have then.</p>
<p dir="auto">Thanks for your time, fellas!  Really, thanks a lot!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60263</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60263</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sat, 28 Nov 2020 21:10:51 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 21:08:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-Coder</a> It’s not possible to add text that’s not in the document.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60262</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60262</guid><dc:creator><![CDATA[MAPJe71]]></dc:creator><pubDate>Sat, 28 Nov 2020 21:08:56 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 21:08:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-Coder</a> said in <a href="/post/60260">How to understand the functionlist parameters</a>:</p>
<blockquote>
<p dir="auto">and then adds four spaces</p>
</blockquote>
<p dir="auto">I have not yet figured out a way to <em>add</em> text to the expression; as I said, it appears to be a <strong>find</strong> expression, so it’s only showing what matches, without replacement.  (We can <em>remove</em> from the expression by fancy use of lookarounds and \K)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60261</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60261</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 28 Nov 2020 21:08:39 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 21:07:01 GMT]]></title><description><![CDATA[<p dir="auto">My brain is starting to hurt…  (It will take me hours to figure this out)</p>
<p dir="auto">Can we change the regex so it captures both <code>section</code> and <code>passage</code> without the brackets, and then adds four spaces to <code>passage</code>?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60260</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60260</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sat, 28 Nov 2020 21:07:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 21:04:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-Coder</a> said in <a href="/post/60254">How to understand the functionlist parameters</a>:</p>
<blockquote>
<p dir="auto">What tool are you using to test these?</p>
</blockquote>
<p dir="auto">I just use Notepad++ Find dialog to test the regex.</p>
<p dir="auto">I was exploring the class/function pairing… unfortunately, if you want to be able to have a <code>&lsqb;&lsqb;section&rsqb;&rsqb;</code> <em>without</em> any <code>[passage]</code> in it, <code>&lsqb;&lsqb;section&rsqb;&rsqb;</code> cannot be the class, because an empty class does not show up in the function list panel.</p>
<blockquote>
<p dir="auto">is there a way to see a preview of the regex replacement?</p>
</blockquote>
<p dir="auto">All the <code>mainExpr</code> and <code>nameExpr</code> regex are all <em>matching</em> expressions, none are <em>replace</em> expressions.  To test them in Notepad++, just use <strong>Find</strong> rather than <strong>Replace</strong></p>
]]></description><link>https://community.notepad-plus-plus.org/post/60259</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60259</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 28 Nov 2020 21:04:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 21:04:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> is there a way to see a preview of the regex replacement?  Seems a pain to keep hitting replace all and then undoing everything just to see if one change works.</p>
<p dir="auto">I know you can “Mark All” but you’d have to do that over and over.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60258</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60258</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sat, 28 Nov 2020 21:04:48 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 20:59:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-Coder</a> said in <a href="/post/60254">How to understand the functionlist parameters</a>:</p>
<blockquote>
<p dir="auto">What tool are you using to test these?</p>
</blockquote>
<p dir="auto">The best tool to use is…Notepad++.  :-)</p>
<p dir="auto">Seriously, though, it IS, because it is what is going to be doing the parsing for the function list.</p>
<p dir="auto">Regex engines are all different, especially as you get into more esoteric structures.</p>
<p dir="auto">The second best tool to use is probably RegexBuddy, set to the Boost regex engine settings.  But it is not a free tool.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60257</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60257</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 28 Nov 2020 20:59:44 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 20:53:55 GMT]]></title><description><![CDATA[<p dir="auto">What tool are you using to test these?</p>
<p dir="auto">I’m looking at this one: <a href="https://regexr.com" rel="nofollow ugc">https://regexr.com</a> and pasting in the <code>nameExpr</code> to the expression box.  Here is my input text for testing against:</p>
<pre><code>&lsqb;&lsqb;section&rsqb;&rsqb;:
some text here with &lsqb;&lsqb;link&rsqb;&rsqb;
[passage]:
some more text with [sublink]
&lsqb;&lsqb;another&rsqb;&rsqb;:
text
</code></pre>
<p dir="auto">If I want to display all the sections and passages without brackets, and to add spaces in front of the passages to indent them…then:</p>
<p dir="auto">It looks like I want to change group1 to capture <code>passage</code> with the brackets instead of <code>section</code>. Then I can add four spaces in front of <code>section</code>.  However, it’s breaking my brain to figure that out…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60254</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60254</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sat, 28 Nov 2020 20:53:55 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 20:35:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> said in <a href="/post/60246">How to understand the functionlist parameters</a></p>
<p dir="auto">You fellows are awesome!</p>
<p dir="auto">I actually thought about classes too.</p>
<p dir="auto">(Here are <a href="http://docs.textadventures.co.uk/squiffy/sections-passages.html" rel="nofollow ugc">squiffy docs</a>, if anyone is interested).  Squiffy is a text-adventure too.  It generates a jquery plugin that manages everything based on how you code the squiffy file (a text file which has a .sq file extension).</p>
<p dir="auto">If we used classes, well, there are several things that could be in it.<br />
a &lsqb;&lsqb;section&rsqb;&rsqb; is the master part and everything revolves around that.<br />
But anything that can be under a &lsqb;&lsqb;section&rsqb;&rsqb; can also be under a [passage].<br />
If you place a link to a &lsqb;&lsqb;section&rsqb;&rsqb; in the text anywhere, it isn’t a section, it’s just a link.  It requires the : after the &lsqb;&lsqb; &rsqb;&rsqb;: to form a section or a [  ]: passage.</p>
<p dir="auto">But there are a lot of if statements, too that could actually form a class.</p>
<p dir="auto">A [passage] is <em>always</em> under a &lsqb;&lsqb;section&rsqb;&rsqb;.  And a &lsqb;&lsqb;section&rsqb;&rsqb; is <em>never</em> under a [passage].<br />
If the passages could be subset under a section, well, that would be absolutely fabulous!  Then I could easily tell where everything is at within a very long story.</p>
<p dir="auto">The sections and passages <em>always</em> start at ^ and <em>always</em> end their line with : being on a line by itself, so they are easy enough to find (as we see in the regex for mainExpr).</p>
<pre><code>&lsqb;&lsqb;section&rsqb;&rsqb;:
    some text here
    &lt;p&gt;or even html can be here&lt;/p&gt;
 [passage]:
</code></pre>
<p dir="auto">Now that I think about it, if we just indented the passages in the display, that would do the trick!  I’m going to try and figure out how to add four spaces before the passages in the nameExpr.  (problem for me is, I don’t know how to test it unless I edit the functionlist parser and restart npp over and over).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60252</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60252</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sat, 28 Nov 2020 20:35:06 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 20:27:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@BGM-Coder</a> ,</p>
<p dir="auto">To accomplish what you’ve described (keeping section and subsection separate), I would suggest that you use the <code>&lsqb;&lsqb;section&rsqb;&rsqb;</code> as the “class” name, and the <code>[subsection]</code> as the “function” name, which would then give you a two-level hierarchical view.  That has the benefit that you could then decide separately for section and subsection whether to include the brackets in the displayed text or not.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60251</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60251</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 28 Nov 2020 20:27:31 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 17:29:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@bgm-coder</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a> and <strong>All</strong>,</p>
<p dir="auto">Try this <strong>parser</strong>. Given your example, it would output, in the <strong><code>Function List</code></strong> panel, the <strong>sections</strong> and <strong>sub-sections</strong> <strong><code>&lsqb;&lsqb;start&rsqb;&rsqb;</code></strong>, <strong><code>passage</code></strong> and <strong><code>&lsqb;&lsqb;a section&rsqb;&rsqb;</code></strong></p>
<pre><code class="language-xml">			&lt;parser
				id="Squiffy" displayName="Squiffy" commentExpr=""
			&gt;
				&lt;function
					mainExpr="^\\[(?:\\[([^\\[\\]\r\n]+)\\]|(?1))\\]:"
				&gt;
					&lt;functionName&gt;
						&lt;nameExpr expr="^\\[(?:\\[([^\\[\\]\r\n]+)\\]\\](?=:)|\K(?1)(?=\\]:))" /&gt;

					&lt;/functionName&gt;
				&lt;/function&gt;
			&lt;/parser&gt;
</code></pre>
<p dir="auto">Remark :</p>
<p dir="auto">For a <strong>better</strong> readability, you could, even, <strong>omit</strong> the <strong>ending</strong> brackets in <strong>sections</strong> names. So, displaying <strong><code>&lsqb;&lsqb;start</code></strong> instead of <strong><code>&lsqb;&lsqb;start&rsqb;&rsqb;</code></strong>. In that case, change the node <strong><code>nameExpr</code></strong> as :</p>
<pre><code class="language-xml">&lt;nameExpr expr="^\\[(?:\\[([^\\[\\]\r\n]+)(?=\\]\\]:)|\K(?1)(?=\\]:))" /&gt;
</code></pre>
<hr />
<p dir="auto">Sorry, but I don’t think that using an <strong>other</strong> <strong><code>Function</code></strong> icon is possible !</p>
<p dir="auto">Presently, I must be <strong>out</strong> and go to the <strong>supermarket</strong> ! But, when I’m back, I’ll do some tests if we may consider your <strong>sections</strong> as <strong><code>classes</code></strong> and your <strong>sub-sections</strong> as <strong><code>functions</code></strong> as they are <strong>two</strong> different icons</p>
<p dir="auto">See you later</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60246</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60246</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 28 Nov 2020 17:29:14 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 04:46:38 GMT]]></title><description><![CDATA[<p dir="auto">Also, how do I get icons?  Maybe I could just show a different icon for &lsqb;&lsqb;section&rsqb;&rsqb; and [subsection]?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60225</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60225</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sat, 28 Nov 2020 04:46:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Sat, 28 Nov 2020 04:17:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a></p>
<p dir="auto">Doh!  You’re right about having that mainExpr twice!  That’s what happens when you copy and paste too many times without paying enough attention!</p>
<p dir="auto">Okay, and I do have backslashes in my mainExpr.</p>
<p dir="auto">And thanks for the link to the FAQ Desk.  I searched google high and low for any tutorial - and there just aren’t any.  The docs are a bit vague (thanks to the fellow who made them, though).</p>
<p dir="auto">And thanks for the help on this.  Now that I know what those expressions actually stand for, I can fiddle with regexes.  I’ve used regex quite a bit - no expert, but I can do fairly well with them once I get started (and here I’ll be later… ).</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a><br />
Now, what you’ve showed me here displays all the sections and subsections in the list and it is glorious!  But I need a way to tell them apart in the display.</p>
<p dir="auto">If I wanted to display the &lsqb;&lsqb;sections&rsqb;&rsqb; in the list with brackets on them, and the [subsections] without them, do I need to add a second “function”?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60224</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60224</guid><dc:creator><![CDATA[BGM Coder]]></dc:creator><pubDate>Sat, 28 Nov 2020 04:17:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to understand the functionlist parameters on Fri, 27 Nov 2020 23:12:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/20497">@bgm-coder</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a> and <strong>All</strong>,</p>
<p dir="auto">If you want to display, in the <strong>Function List</strong> panel, the sections <strong><code>&lsqb;&lsqb;start&rsqb;&rsqb;:</code></strong>, <strong><code>[passage]:</code></strong> and <strong><code>&lsqb;&lsqb;a section&rsqb;&rsqb;:</code></strong>, use this <strong>simple</strong> parser, below, where the <strong><code>FunctionName</code></strong> node is <strong>omitted</strong> as its regex would be <strong>identical</strong> to the one in <strong><code>mainExpr</code></strong></p>
<pre><code class="language-xml">			&lt;parser
				id="Squiffy" displayName="Squiffy" commentExpr=""
			&gt;
				&lt;function
					mainExpr="(?-s)^\\[(?:\\[([^\\[\\]\r\n]+)\\]|(?1))\\]:"
				&gt;
				&lt;/function&gt;
			&lt;/parser&gt;
</code></pre>
<p dir="auto">But, if you want to display , in the <strong><code>Function List</code></strong> panel, the strings <strong><code>start</code></strong>, <strong><code>passage</code></strong> and <strong><code>a section</code></strong>, without the <strong>brackets</strong> and the <strong>colon</strong>, use this parser :</p>
<pre><code class="language-xml">			&lt;parser
				id="Squiffy" displayName="Squiffy" commentExpr=""
			&gt;
				&lt;function
					mainExpr="(?-s)^\\[(?:\\[([^\\[\\]\r\n]+)\\]|(?1))\\]:"
				&gt;
					&lt;functionName&gt;
						&lt;nameExpr expr="[^\\[\\]\r\n]+" /&gt;
					&lt;/functionName&gt;
				&lt;/function&gt;
			&lt;/parser&gt;
</code></pre>
<ul>
<li>
<p dir="auto">The regex, in <strong><code>mainExpr</code></strong>, defines the <strong>string</strong> what we want to <strong>search</strong> for</p>
</li>
<li>
<p dir="auto">The regex, in <strong><code>expr</code></strong>, defines the <strong>string</strong> what we want to <strong>display</strong></p>
</li>
</ul>
<p dir="auto">Give it a try ! If <strong>OK,</strong> next time I could give you some <strong>hints</strong> about the regexes</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60218</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60218</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 27 Nov 2020 23:12:25 GMT</pubDate></item></channel></rss>