sywac / sywac-website

Source content for the sywac/sywac.github.io repo
https://sywac.io
1 stars 2 forks source link

docs: example of accessing outputSettings from style hooks #7

Closed elliot-nelson closed 4 years ago

elliot-nelson commented 4 years ago

SUMMARY

Add an explanation and some examples of how to access outputSettings from style hooks, and why you might do so.

DETAILS

Like it says on the tin. This might actually be an unintended feature, but I think it's useful!

nexdrew commented 4 years ago

This change is now live. Thanks again!

elliot-nelson commented 4 years ago

Your comment is fair - I came up with this one while working on https://github.com/elliot-nelson/sywac-style-chunky (a style I've been tinkering with that I'll eventually add to the Styles list in the docs).

I think being able to insert ${this.lineSep} is better than \n, but there might be a better API for it (perhaps an explicit last argument, like fn(str, settings), so it doesn't break arrow functions).

nexdrew commented 4 years ago

but there might be a better API for it (perhaps an explicit last argument, like fn(str, settings), so it doesn't break arrow functions)

I like that idea.