How to understand the functionlist parameters
-
Hi, All,
When writing on our forum, some of us noticed that, sometimes, backslahes
\
are omitted, after submitting their posts !I did some additionnal tests. Now, I get it !
The rules are :
-
To display a
\\[
string, on our forum, if not followed with an other opening squared bracket[
, you need to type a leadingbackslash
, so the syntax\\\[
-
To display a
\\]
string, on our forum, if not followed with an other ending squared bracket]
, you need to type a leadingbackslash
, so the syntax\\\]
-
To display the
\[[
or\]]
strings, juste write them, without any extra character
To automate the sequence, you could use the following regex S/R :
SEARCH
\\\\[(?!\\[)|\\\\](?!\\])
REPLACE
\\$0
Cheers,
guy038
-
-
@guy038 You are a clever and industrious fellow!
Nice solution! I am very impressed. The only problem, and I hate to say this, is that it is impractical.
- When a squiffy authour wants to create a link to a pssage, he’ll have to type exactly what is in the
[passage]
. For example, just above your[ * apassage]:
you can see the textclick on [apassage].
Those have to match. And again, the line above that,Check out the [passage](globalpassage)
- the coder would have to type:Check out the [passage]( * globalpassage)
. I know, it gets a little strange - in the second case, the words in the[x]
indicate it is a link and the text can be anything, but the( )
contains the link to the actual[globalpassage]:
.
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.
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.
For your tests - I found out that if I type
[ ]
strange, eh? - When a squiffy authour wants to create a link to a pssage, he’ll have to type exactly what is in the
-
Now, with the idea of “preparing” the squiffy text, I played with the idea of putting a
-
at the start of a passage name and squiffy doesn’t mind that.[[section]]: Click on [this link](-passage) [-passage]: Hi there!
The squiffy compiler converts
[this link](-passage)
into a link like this (and adds a class called “disabled” after you click on it):<a class="squiffy-link link-passage" data-passage="-passage" role="link" tabindex="-1">this link</a>
So, we could do something like you suggest by adding a
-
or_
at the start of a passage name. -
Hi, @BGM-coder,
OK ! I don’t give up, anyway ;-))
One more question :
Do sentences like
Click on [this link](-passage)
orYou could click on this link [-passage] to get the whole story
always come before the[-passage]:
definition ?And what is the maximum of lines, which may separates a link from the definition ?
Also, could you provide your sample code, placing a dash
-
everywhere needed ? Just to visualize all the modifications to do with the regex S/R. Of course, I suppose :-
In passage definition as in
[-apassage]:
-
In passage link as in
Check out the [passage](-globalpassage)
-
Now, in the sentence above, does
[passage]
, right before(-globalpassage)
, need to be written[-passage]
, too ? -
And, in sentences like
this link [passage] will give you some hints
, does[passage]
need to be written[-passage]
?
Thanks for your cooperation !
BR
guy038
-
-
@guy038 haha - you are relentless!
So, you can
Click on [this link](-passage)
where[this link]
could be any text at all and it creates a link to what is in the parenthesis where(-passage)
must be the same as in[-passage]:
(the definition). The parenthesis always come after the link text.Bascially, we are using this text to generate an html link. What is in the
[ ]
is the link text. What is in the parenthesis comes as a property calleddata-passage
in the<a>
element.There is no limit on the amount of lines between a link and a definition.
If I used dashes, I think we would put them in the definition for the passages. So, anywhere we have
[somepassagename]:
with the:
at the end. We would also have to use them in the links themselves.[[Some Section]]: 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. [[]]: Behold! The Global Section. [-a global passage]: And this is text in a global passage.
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.
-
Hello @BGM-coder,
Could you confirm me that the regexes should act as below :
Case A ^[[]]: => Unchanged Case B ^[[aaaaa]]: => Unchanged Case C [[bbbbb]] not followed by (ccccc) => Unchanged Case D (eeeee) preceded by [[ddddd]] => Unchanged Case E ^[]: => Unchanged Case F [fffff] not followed by (gggggg) => [-fffff] Case G (iiiii) preceded by [hhhhh] => (-iiiii) Case H ^[jjjjj]: => [-jjjjj]:
Note that, when cases F or G occur, the respective passage
fffff
oriiiii
may be defined or notSee you later,
Cheers,
guy038