Git Product home page Git Product logo

Comments (9)

lisps avatar lisps commented on July 18, 2024

hi ajfre,
can you give me some more infos?

  • which dokuversion are you using?
  • which other plugins have you installed?
  • can you paste an example how you used this plugin (raw wikipage)?
  • what exactly does not work as you expect?

from const.

ajfre avatar ajfre commented on July 18, 2024

I didn't test the math functions. I analyzed the offset alignment, copied it into an own plugin and found, that it doesn't work, because of line 220 and the fact, that $this->page is never set to a value other than ''

After correcting this, I got invalid section alignment, if multible blank lines are in the raw text. Reason: line 83, which eats them. Changeing the pattern to /\r?\n/ will make it work.

What is the reason for that trivial syntax component? As far as I see, it does simply nothing.

Regarding the section alignment: this stuff is quite generic and should be implemented as interface to a kernel function.

from const.

lisps avatar lisps commented on July 18, 2024

as described in https://www.dokuwiki.org/plugin:const you can define constants and math calculations anywhere on a page (inside tags) and use them afterwards on the same page. The syntax component just hides the defines inside the tags, because they should not be displayed to the user.

The code on line 220 in action.php is to remove the blank lines as it is part of parsing the defines. It has no effect to the wiki page.

Just for my info: are you using the const plugin and having problems to get it work, or have you problems getting parts of the code working in an other plugin?

from const.

ajfre avatar ajfre commented on July 18, 2024

No, I don't use const in my wiki. I only used as a source for the trick to realign the code and found, that it doesn't work correctly. (A bunch of action plugins has very similar issues and for plugin users it is very difficult to find the culprit for these effects, that frequently garble page text.)

To see the misbehaviour, try this page text (including all blank lines!):

print=Calculation value1=10 value2=30 value3=%RANDOM%

formular=(value1 * value2) + (value3 / 2)
result:formular

  • Value 1 = %%value1%%
  • Value 2 = %%value2%%
  • Value 3 = %%value3%%

%%print%% => %%formular%% = %%result%%

====== Section 1 ======

12345678901234567890

====== Section 2 ======

12345678901234567890
12345678901234567890

====== Section 3 ======

12345678901234567890


Save it and then click "Edit" for the sections. DW's opinion about these sections in the section editor is not what the source text suggests.

from const.

ajfre avatar ajfre commented on July 18, 2024

PS.: The syntax component of const is not really needed. The -section can be removed in PARSER_WIKITEXT_PREPROCESS.

from const.

ajfre avatar ajfre commented on July 18, 2024

PPS: Sorry, the bugtracker has thrown away anything, that looks like a html tag.

The const code in my example code is from https://www.dokuwiki.org/plugin:const

'The -section' in my PS was intended to be 'const-section', const in angle brackets.

from const.

lisps avatar lisps commented on July 18, 2024

if i hide the const section with the syntax compontent, i don't have to deal with the section-correction

The code example works for me, I am using weatherwax - and only have tested it against this version. Users have selected it as compatible with binky and adora.

from const.

ajfre avatar ajfre commented on July 18, 2024

The code example works for me, I am using weatherwax - and only have tested it against this version. Users have selected it as compatible with binky and adora.

I use Binky. Did you open sections for edit? Not the whole page.

if i hide the const section with the syntax compontent, i don't have to deal with the section-correction

Only, if the variable substitutions do not cause changes of the text lengt.

Offsets in code are computed from rendered text. If preprocessing modified the raw text length, section headings move to new offsets. Section-correction is necessary to make section headers etc. in the code point to the section in the raw text on disk. That is necessary for the section editor to correctly get the section.

Here some screen shots + wiki source
https://dl.dropboxusercontent.com/u/55092578/PluginList.png
https://dl.dropboxusercontent.com/u/55092578/RenderedText.png
https://dl.dropboxusercontent.com/u/55092578/source.png
https://dl.dropboxusercontent.com/u/55092578/SectionEdit.png
https://dl.dropboxusercontent.com/u/55092578/src.txt

Be aware, that the random function in your code causes differences in offsets.

from const.

lisps avatar lisps commented on July 18, 2024

i have pushed some updates to the master branch. Can you please test it?
if it doesn't work, you can try to delete your cache directory (data/cache/[0-f]) and test again.

thanks

from const.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.