scripting / drummerRFC

A place to post RFCs for people who use and develop in Drummer.
MIT License
11 stars 0 forks source link

Permalinks in Old School are weird #11

Open scripting opened 2 years ago

scripting commented 2 years ago

I just wrote a change note for background.

scripting commented 2 years ago

To generate a link to a post on Old School from within Drummer, this is what you do.

var d1 = the time in the user's time zone that the post was created;

var d2 = the time the bar cursor headline was created in GMT;

var headers = a struct containing the head-level atts;

var url = headers.urlBlogWebsite + d1.getFullYear () + "/" + pad (d1.getMonth () + 1) + "/" + pad (d1.getDate ()) + ".html";

url += "#a" + pad (d2.getUTCHours ()) + pad (d2.getUTCMinutes ()) + pad (d2.getUTCSeconds ());