User steps in Longform

What I’m trying to do

Create a user step in the Longform plugin.

Things I have tried

  • I’ve tried modifying the .js files I found here: User Script Steps and here: Strip Frontmatter example.
  • I have enough programming background to modify a working script, but I’m not a JavaScript expert by any stretch. I’ve tried tweaking the above files to do what I want (strip ‘==’ from my compiled manuscript), but Longform isn’t recognizing them as steps.
  • I’ve created a longform folder under ‘templates’ in my vault and added the .js files there.
  • I’ve set the Longform options to look at my longform steps folder.
  • I’ve tried using both a .js and .ts extension on the files because that is the name of the second example.

None of my attempts are showing up as user steps in the Longform Add Step dialog.

Can anyone point me to an example of a working user step? I just need to see how one is constructed, gets its input, and passes its output to Longform.

If there is an existing step that will accept a regex statement, that would do the trick as well. I’m already using Linter, but I don’t want to do this whenever I lint a file, only when I compile a manuscript.

Thanks,

Ken Tryon

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.