Virtual Dhamma-Vinaya Vihara

Studies, projects & library - [Studium, Projekte & Bibliothek] (brahma & nimmanarati deva) => Translation projects - [Übersetzungsprojekte] => Studygroups & Dhamma Dana - [Studiengruppen & Dhamma Dana] => Zugang zur Einsicht - [Access to Insight] => Topic started by: Dhammañāṇa on October 30, 2018, 10:28:18 PM

Title: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on October 30, 2018, 10:28:18 PM
While "include (https://www.dokuwiki.org/start?id=plugin:include)" is perfect to imbedd the many often use of sources, makes all wunderful to maintain simply at the source-file, the selection works by using the specific section header only.

It makes it not easy to perform new pages automaticly on one hand, and the other is that headers may change.

Now: hiddenheader (https://www.dokuwiki.org/plugin:hiddenheader) seems to be perfect to work with the sutta codes as header/anchor, and at first glance works fine. There seems to be, how ever, a bug, performing the section edit not work right, creating an additional line in the middle of the last </sp... an> tag, when then saved breaks the whole page and also generates other anchors-links in a way that the anchor's "." would be deleted in the html.

possible to see for now at http://accesstoinsight.eu/km/tipitaka/book_006

Currently no idea of if or how it could be fixed in long terms.

A topic in DW-forum (https://forum.dokuwiki.org/post/63448) has been raised.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on November 01, 2018, 05:17:43 PM
Quote from: Johann https://forum.dokuwiki.org/post/63467
After disable, after also deinstallation of hidden-header-plugin, the section edit problem is gone so far BUT:

The rerendering/break of anchor/id in link remains now.

An anchor-link like [m]url#vin.mv.01.01[/m] is now -like when 1. using hh-plugin - parsed into [m]url#vinmv0101[/m]

(see http://accesstoinsight.eu/km/tipitaka/book_006 ) as sample, under book_006 links, right, small)

What could my person do to solve this matter?
If a bug, or bugs here, it would be good to let the developer know.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on November 17, 2018, 03:41:54 PM
Since the strange rendering of anchor-links remains, no solution is found or given, if Nyom Moritz finds time and certain joy, maybe he can look into this matter.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Moritz on November 17, 2018, 05:45:07 PM
Vandami, Bhante _/\_

It seems I have found a quick fix: https://forum.dokuwiki.org/post/63653

Changed file "inc/pageutils.php" at line 232 from
Code: [Select]
    $title = str_replace(array(':','.'),'',cleanID($title));
to:
Code: [Select]
    $title = str_replace(array(':'),'',cleanID($title));

Not sure if this will cause any other problems. Maybe there is a good reason why DokuWiki would remove all dots from anchor links and section ids. It should not cause any big problems (like data loss) but changes only how the page is rendered. So if something is wrong with this approach and something strange appears, one can simply change it back and look for a better way.

It might be that the change only comes into effect for each page after editing it one more time (to rebuild the page in the cache, but I'm not sure how this process works in detail and maybe it happens automatically after some time. For the test page http://accesstoinsight.eu/playground/playground/anchor#mv0102 it worked after just making a small change in the file and saving again).

_/\_

/me going now off to other work. Wishing a good day _/\_
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on November 17, 2018, 06:16:48 PM
Sadhu

It work on the other pages as well without "rebuild the page in the cache" like http://accesstoinsight.eu/km/tipitaka/book_007

Just a thought on DW-forum:

Quote from: https://forum.dokuwiki.org/post/63654
Sadhu

PHPXref 0.7 states:
"Creates a XHTML valid linkid from a given headline title"

Not sure about XHTML and dots in anchor or id.

How ever, as a dot might be common in headers (1. ..., 2. ...), and as far as perceived before (that there was no "problem" before hidden-plugin), it seems that there must be two renderings, one for the created link and one for the created ID of headers. Not sure if the possible change by the plugin did not left something in the part of rendering the ID of the title behind.

(the solution might be overwritten when upgrade is made, wouldn't it)

/me : may there be joy and release in good undertakings Nyom Moritz
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on November 18, 2018, 02:55:34 PM
The section-include function with the include-plugin does no more match the single section and returns now the whole source page, Nyom Moritz .

sample: http://accesstoinsight.eu/km/tipitaka/vin/mv/vin.mv.01.03

{{section>km:tipitaka:book_006#៣. មុចលិន្ទកថា&nouser&nodate&noheader&noeditbutton&readmore}}

My person still thinks that there are two actions involved, one rendering IDs and one Anchor-Links, and that hidden-plugin left something behind in the sphere of the ID-rendering. (independent of the matter ".", ":" or not in the DW-complex)


Seemingly was a cache-matter. After saving the settingpage all fine.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Moritz on July 07, 2020, 03:52:44 PM
Changed file "inc/pageutils.php" at line 232 from
Code: [Select]
    $title = str_replace(array(':','.'),'',cleanID($title));
to:
Code: [Select]
    $title = str_replace(array(':'),'',cleanID($title));

Now changed it further to just:
Code: [Select]
    $title = cleanID($title);
to allow also for colons.

Seeing no technical reason why periods or colons should not be allowed in section ids (and anchor links), I had opened an issue on the DokuWiki GitHub page (https://github.com/splitbrain/dokuwiki/issues/2580) before, discussing it in detail and suggesting that it be changed in official DokuWiki. So far, not addressed there.

https://github.com/splitbrain/dokuwiki/issues/2580
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on July 07, 2020, 10:54:58 PM
Sadhu
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on October 15, 2022, 12:34:20 PM
Just tested hiddenheader again as a way to make nicer index pages, made useful and easier for meta-datas, tags, without the need of data base.

Seems like hide does not hide the header after open page a second time.

example: https://sangham.net/km/tipitaka/vin/mv/vin.mv.01.01
index: https://sangham.net/km/tipitaka/vin/mv/index#vin.mv.01.01 (looks fine, aside of always require new division)
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Moritz on October 16, 2022, 03:31:22 AM
_/\_ _/\_ _/\_

I don't see what is wrong.

Quote from: vin.mv.01.01 (https://sangham.net/km/tipitaka/vin/mv/vin.mv.01.01)
១. ពោធិកថា
Code: [Select]
======%hide ១. ពោធិកថា ======

<div ref_source><span sang_id #vin.mv.01.01>[[km:tipitaka:vin:mv:vin.mv.01.01|vin.mv.01.01]] | [[km:tipitaka:book_006#vin.mv.01.01|ពី ភាគ ទី៦]]</span>
====== ======
</div>

===%hide សង្ខេប ===
__សង្ខេប៖__ បន្ទាប់​ពី​បាន​ត្រាស់​ដឹង ព្រះ​សម្មាសម្ពុទ្ធ​ទ្រង់​ត្រាស់​ព្រះ​ធម៌​អស់​ជា​ច្រើន​សប្តាហ៍​នៅ​​ក្រោម​ដើម​ឈើ​ផ្សេងៗគ្នា។
=== ===

===%hide គ្រូបាធ្យាយ ===
__គ្រូបាធ្យាយ:__ ព្រះពុទ្ធជាម្ចាស់
== ==

===%hide ទស្សនិកជន ===
__ទស្សនិកជន:__ លោកសង្ឃ
=== ===

And then where it is included:
Quote from: index#vin.mv.01.01 (https://sangham.net/km/tipitaka/vin/mv/index#vin.mv.01.01)
Code: [Select]
**[[vin.mv.01|មហាខន្ធកៈ]]**

It looks like this:
(https://forum.sangham.net/index.php?action=dlattach;topic=8930.0;attach=9029;image)

The headers are not included.
The text of the headers is just repeated in the text. So on the vin.mv.01.01 page (https://sangham.net/km/tipitaka/vin/mv/vin.mv.01.01) it appears twice (in the header and in the text below). On the index page it appears only once (headers are hidden, but the same text as in header also is in the not hidden text).


Or did I misunderstand the problem?
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on October 16, 2022, 05:09:32 AM
Inlude works fine so far, but hiddenheaders aren't hidden on their page. They had been, but later did appear again.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on October 16, 2022, 05:12:09 AM
When editing looking fine. Reoben page again, gone and no more hidden.

First vie after edit fine, then no more. Editing anew, one time fine.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Moritz on October 16, 2022, 04:49:26 PM
Oh, I see. I misunderstood. I understand the problem now. Thanks for clarifying.
I will take a look.

_/\_ _/\_ _/\_
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on October 16, 2022, 05:36:07 PM
When looking at the plugin page, it seems to have never been carried further intensively.

Quote from: https://www.dokuwiki.org/plugin:hiddenheader
Thanks, but I have a little problem (Mar2017, Frusterick). When I link to a hidden section from another page, the hidden headers are shown on the page when I arrive. The only way to hide them again appears to be to edit the page, make an actual change, and save.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Moritz on October 18, 2022, 04:28:37 AM
Hmm... same error seems to happen on the old sangham.net (test.sangham.net, now online again). After saving first it looks fine. Then reopening the page, the headers appear.

The plugin looks very simple, but I don't understand yet what is wrong there.
Title: Re: [ATI.eu] "include-plugin": "hiddenheader-plugin" breaks section-edit and anchor-
Post by: Dhammañāṇa on October 18, 2022, 04:56:58 AM
Atma doesn't think that most things now are much related to "Igor" but just "old stuff", Nyom.

(plugin never worked proper also before, just thought meanwhile different, and tried to use, as it would handy solve citing from original (like ptf-pages). while original not touched and steady last revision).