Re: Trying to include this javascript code with custom markup
ABClf <[email protected]> Fri, 21 Mar 2025 13:19:52 +0100
| Newsgroups | gmane.comp.web.wiki.pmwiki.user |
|---|---|
| Message-ID | <CACE3LEswjuzo7vg+Y2R4njrWSStxE45exbt_itV27rHJBqxhRw@mail.gmail.com> |
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 <[email protected]> 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 ? _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users