[pmwiki-users] Trying to include this javascript code with custom markup
ABClf
languefrancaise at gmail.com
Fri Mar 21 05:19:52 PDT 2025
Thank you for your answer Petko.
It should work but I still have issues, which I believe are mines.
I'm still investigating.
Will come back.
I (and mostly AI) have used Chart.js before but, for my needs I prefer
how D3 looks like.
Le ven. 21 mars 2025 à 11:38, Petko Yotov <5ko at 5ko.fr> a écrit :
>
> Technically you also need to escape $ signs to \$ in the JavaScript code
> in a PHP string.
>
> I would indeed place the JS code in a separate JS file and add a
> <script> element instead of inline JS in the HTML page.
>
> Create a file say pub/chronologie.js
>
> Place in the file the JS code that is working.
>
> In PHP, return:
>
> Keep('<script src="https://d3js.org/d3.v7.min.js"></script>
> <script src="$PubDirUrl/chronologie.js"></script>');
>
> Possibly, add (:chronologie:) after (:template last:) in the pagelist
> template.
>
> Le me know if you have questions or need assistance, this
> enhancement/augmentation is very appropriate for automation.
>
> I am using the Chart.js library for charts rather than d3, I plan to
> someday release a PmWiki extension for charts.
>
> Petko
>
>
> On 21/03/2025 10:38, ABClf wrote:
> > either to load the javascript from an external javascript file (rather
> > than including it in my php file config) ;
> > thus my question becomes : how to include an external javascript from
> > custom markup rule and, more generally, what is the way to go to get
> > the magic begin ?
More information about the pmwiki-users
mailing list