[pmwiki-devel] PUB dir and javascript

0 views
Skip to first unread message

Simon

unread,
Mar 21, 2020, 12:55:05 AM3/21/20
to PmWiki Devel Mailing List
Petko

I'd like to suggest that a new default sub-directory of the Pub dir be added for java script, as there is for CSS and Skins.

I see for example localtimes.js and pm-utils.js in the pub dir root

cheers

Simon

Petko Yotov

unread,
Mar 22, 2020, 6:21:16 AM3/22/20
to Simon, PmWiki Devel Mailing List
LocalTimes is not in the core, if it gets included then its logic will
go into pmwiki-utils.js.

I'll think about it -- one problem is that moving the file into a
subdirectory in the core will not move it on existing installations and
people will end with 2 versions of pmwiki-utils.js. Isn't this worse
than what happens now?

As the directories where the PmWiki core is installed should not be
writable by the PHP process, an automatic cleanup cannot be reliably
implemented.

Petko
_______________________________________________
pmwiki-devel mailing list
pmwiki...@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Simon

unread,
Mar 22, 2020, 10:59:25 PM3/22/20
to Petko Yotov, PmWiki Devel Mailing List
Petko

thanks for (all your) responses.

What I was thinking about, rather than those specific recipes was - and there may be advice about this on the wiki - but I can't see it

If I am a recipe writer
  • skin (recipes) go in the /pub/skins directory
  • recipe css (I guess) goes in the /pub/css directory
  • recipes go in the cookbook directory
  • recipe javascript goes ... ?
  • recipe resources (e.g. graphics) go in /pub/myrecipe/
Or as a recipe writer do I create a folder /pub/myrecipe/ and put everything in there?
I'm a sort of a tidy developer and like to have a place for things, and I can see that more and more recipes will be using javascript, hence the suggestion

As far as moving forward, should it be considered being worth doing then yes, the old file becomes orphaned, but perhaps instructions to manually deleet it would be sufficient

thanks very much

On another note I hope you are keeping safe through the COVID pandemic

regards

Simon

Petko Yotov

unread,
Mar 23, 2020, 1:53:27 AM3/23/20
to PmWiki Devel Mailing List
On 23/03/2020 03:58, Simon wrote:
> If I am a recipe writer
>
> - skin (recipes) go in the /pub/skins directory

This can be either the "core" pmwiki/pub/skins directory where the skin
can be used in all fields, or the "field" directory field/pub/skins
where the skin only applies to the current field, and overrides any skin
with the same name that could exist in pmwiki/pub/skins.

> - recipe css (I guess) goes in the /pub/css directory

Not exactly, this directory, BTW always field/pub/css (*) contains CSS
files that are automatically included by PmWiki, that normally could
override core CSS and skin CSS (unless the skin does something
specific). These are local.css and various Group.css or Group.Page.css.

It is not recommended for recipe authors to place individual files
there, but many recipes have instructions to place custom code inside
local.css (which is fine).

(*) "field" is the directory where index.php is (it includes pmwiki.php
wherever the latter is) and in the simplest installation --
not-a-wiki-farm -- it is the one that exists in the core distribution.

> - recipes go in the cookbook directory

PHP recipes, yes.

> - recipe javascript goes ... ?
> - recipe resources (e.g. graphics) go in /pub/*myrecipe*/
> Or as a recipe writer do I create a folder /pub/*myrecipe*/ and put
> everything in there?

If your recipe includes both CSS and JavaScript (most do) and possibly
graphics, their place is in pub/your-recipe -- either the one under
pmwiki ($FarmPubDirUrl/your-recipe), or the one under field
($PubDirUrl/your-recipe).

> I'm a sort of a tidy developer and like to have a place for things, and
> I
> can see that more and more recipes will be using javascript, hence the
> suggestion

Yes, recipes that only ship JavaScript and no CSS could use a suggestion
to place their files in pmwiki/pub/js or in field/pub/js.

> As far as moving forward, should it be considered being worth doing
> then
> yes, the old file becomes orphaned, but perhaps instructions to
> manually
> delete it would be sufficient

Perhaps.

Petko

> On Sun, 22 Mar 2020 at 23:20, Petko Yotov <5...@5ko.fr> wrote:
>
>> LocalTimes is not in the core, if it gets included then its logic will
>> go into pmwiki-utils.js.
>>
>> I'll think about it -- one problem is that moving the file into a
>> subdirectory in the core will not move it on existing installations
>> and
>> people will end with 2 versions of pmwiki-utils.js. Isn't this worse
>> than what happens now?
>>
>> As the directories where the PmWiki core is installed should not be
>> writable by the PHP process, an automatic cleanup cannot be reliably
>> implemented.
>>
>> Petko
>>
>> On 21/03/2020 05:53, Simon wrote:
>> > I'd like to suggest that a new default sub-directory of the Pub dir be
>> > added for java script, as there is for CSS and Skins.
>> >
>> > I see for example localtimes.js and pm-utils.js in the pub dir root

Reply all
Reply to author
Forward
0 new messages