![]() This builds the book in all the formats supported by Leanpub (PDF, epub, mobi). A regular preview is triggered for commits that are tagged with a tag starting with preview.This allows me to have a continuous PDF preview of any changes I make to my book. I keep Subset.txt with the same content as Book.txt, so a subset preview gives me a PDF-only build of my whole book (you could also modify Subset.txt before each commit depending on the part of the book you want to preview, but this is outside the scope of this article). A subset preview is triggered for every commit to the book’s repository.Here’s my preferred workflow (you can build others as well using the leanpub orb, see below for ideas): With it, you can set up a build/preview/publish workflow which you can trigger directly from git. I wrote an orb called zzamboni/leanpub for automating interactions with the Leanpub API. Looking for ways to further automate the preview and publish workflow of my books, I came across CircleCI, a popular CI/CD platform which is easy to use and allows creation of libraries called “orbs” to encapsulate more complex behaviors. Continue reading if you are interested in a flexible workflow which allows you to trigger different types of builds based on tags you define on your book’s repository. If you only want to automatically trigger one type of build then you don’t need to do anything else. This means that if you want to trigger a different type of build, you need to keep multiple webhooks defined, and activate the one you want by hand: This works well, but the downside is that the webhook is “hardcoded” so you can only trigger a fixed type of build per webhook (e.g. This is described in your book’s “Getting Started” page, which you can access at (replacing YOUR_BOOK with your book’s slug). The most basic way of automatically triggering builds is by using a webhook to trigger the Leanpub API directly. If you don’t see any buttons in the notifications, it may indicate that you have the Hammerspoon alert style set to “Banners” instead of “Alerts”. For example, if you don’t see any notifications, make sure the Hammerspoon notifications are not blocked and that you have not enabled “Do not disturb” mode. Note that the actual behavior and appearance of the notifications produced by Hammerspoon (like those of any other application) depend partly on the settings you have in the macOS Notifications control panel. The beginning: triggering and watching builds by hand I use “Git and Github”, but these techniques should work equally well with BitBucket or any other platforms that can trigger a webhook when your text is updated. Book writing mode refers to the source from which Leanpub gets the text for your book.Optionally, when publishing a new release you can send out an email with release notes to people who have already purchased the book (in any case, the new version of the book also becomes available for them to download). Publishing means that it becomes the version available for purchase. Publish builds and publishes a new version of the book.I do not use this operation in my workflows. File preview builds only a segment of text you need to provide as part of the API call.Subset preview builds only the PDF version of a book, from a subset of files defined in the Subset.txt file in your repository.Preview builds all the formats supported by Leanpub (PDF, ePub, Mobi), using the whole book as defined in the Book.txt file. ![]() Build types: The Leanpub API allows you to trigger several types of build operations on a book:.The API key needs to be provided on most Leanpub API calls (some query operations are allowed without a key). API key: Every Leanpub author gets an API key, which is a randomly-generated string of characters which is used as an authentication token.You can specify it if this is not the case by providing some additional configuration parameters. Hs.spoons.The tools I describe below assume by default that your book’s git repository name is the same as its Leanpub slug. Inc = hs.fnutils.partial(self.inc, self),ĭec = hs.fnutils.partial(c, self), ![]() I'd recommend to make the changeVolume function local ( local function changeVolume) and then expose inc() and dec() methods: local function changeVolume(diff) Note that the suggested way is to expose a :bindHotKeys() method. Local new = math.min(100, math.max(0, math.floor(current + diff))) Local current = hs.faultOutputDevice():volume() ![]() The only thing you need to do to make it work is to remove second line from top and bottom, this way when the function is called it will be executed: function obj:changeVolume(diff) When the changeVolume method is called it returns a function, but does not execute it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |