New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview Templates not working #777
Comments
Only an absolute path seems to work. paragraph.js module.exports = ({ node }) => `<p class="paragraph">Brian did this: ${node.getContent()}</p>` Settings
|
In short: The setting description is wrong:
I don't think "All We should mention that only plain JavaScript is supported. |
Thanks I got this to work with your help. (Javascript "paragraph" you supplied) There is a few caveats we may need to document with all this though.. Firstly, in Settings in VSCode, there is the "User" and "Workspace" settings. As you mentioned, doing the |
I don't think this is intended. I will have a look. |
I also can see that only absolute paths are working. Isn't there a way to implement a simple way that the configured relative paths can be configured to use ${workspaceFolder}/templates or even better if it can be defined that the vscode extension automatically finds the templates under .asciidoctor/templates? It is really annoying to manually set the templates path for each developer after checking out the repository and I think that could be easily improved. |
We could support interpolation (i.e., replace Alternatively, we could use dot (
@mojavelinux thoughts? |
Providing a convention like mentioned here #843, might even be the easier solution. When already starting with conventions for extensions, why not doing the same for templates? |
Trying to modify the VSCode Asciidoctor "Preview" through the use of a Nunjuck Template.
There is a Setting in VScode called Asciidoc > Preview:Templates that says if this folder is left empty then templates will be discovered relative to the asciidoc file.
So if I have the nunjucks file and the asciidoc file together it should work.
It doesnt.
If I set up a folder to place the templates and add that path to the Setting in VScode *Asciidoc > Preview:Templates, it still doesnt work.
I have folder in my project called templates.
My setting in VSCode then for *Asciidoc > Preview:Templates I tried:
Nunjucks has been installed in VScode terminal using
$ npm i nunjucks
Files are:
paragraph.njk
test.adoc
= TEST DOCUMENT Paragraphs don't require any special markup in AsciiDoc. A paragraph is just one or more lines of consecutive text.
I expected the nunjucks paragraph template to be found and modify the VSCode Asciidoctor "Preview" where a paragraph was used.
The text was updated successfully, but these errors were encountered: