Skip to content
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

add support for custom templates #616

Merged
merged 7 commits into from
Aug 10, 2022

Conversation

xdavidson
Copy link
Contributor

This MR allows user-defined custom templates to be provided at conversion time.
To use a pug template:

  • On a terminal, $ npm i pug
  • In Settings -> AsciiDoc -> Open Preview, define path to pub templates

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/asciidocParser.ts Outdated Show resolved Hide resolved
src/asciidocParser.ts Outdated Show resolved Hide resolved
@ggrossetie
Copy link
Member

@xdavidson I left a few nitpicks but otherwise it looks very good, thank you!

@ggrossetie
Copy link
Member

As a follow-up we should hide this option when running in Visual Studio Code for the Web but we can do that later.

@ggrossetie
Copy link
Member

Linter is unhappy:

/home/runner/work/asciidoctor-vscode/asciidoctor-vscode/src/asciidocParser.ts:171:15: ["template_dirs"] is better written in dot notation. [Error/dot-notation]
/home/runner/work/asciidoctor-vscode/asciidoctor-vscode/src/asciidocParser.ts:171:15: Strings must use singlequote. [Error/quotes]
/home/runner/work/asciidoctor-vscode/asciidoctor-vscode/src/asciidocParser.ts:273:[11](https://github.com/asciidoctor/asciidoctor-vscode/runs/7753730673?check_suite_focus=true#step:5:12)2: A space is required after ','. [Error/comma-spacing]
/home/runner/work/asciidoctor-vscode/asciidoctor-vscode/src/asciidoctorWebViewConverter.ts:121:31: Missing trailing comma. [Error/comma-dangle]

You can run npm run lint to check locally. You can also use npm run lint -- --fix to try to automatically fix lint issues.

@xdavidson
Copy link
Contributor Author

You can run npm run lint to check locally. You can also use npm run lint -- --fix to try to automatically fix lint issues.

Thanks for the pointers. It's fixed.

@xdavidson
Copy link
Contributor Author

As a follow-up we should hide this option when running in Visual Studio Code for the Web but we can do that later.

Good point!

@ggrossetie ggrossetie merged commit b65f1c1 into asciidoctor:master Aug 10, 2022
@xdavidson xdavidson deleted the support-custom-templates branch August 10, 2022 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants