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

Support Macros escaping #192

Closed
oleg-nenashev opened this issue Nov 28, 2023 · 3 comments
Closed

Support Macros escaping #192

oleg-nenashev opened this issue Nov 28, 2023 · 3 comments
Labels
solved The issue has been satisfactorily solved

Comments

@oleg-nenashev
Copy link
Contributor

It would be nice to be able to escape Macros so that they are ignored by the engine, e.g. if they are supposed to be added to documentation as is. At least, the triple bracket for Handlebars does not work, and there are also non-fatal resolution warnings for other macros in code samples

My use-case

Error for ``{{{` in code

In wiremock/wiremock.org#228 I am moving the documentation for WireMock which also includes its internal Handlebars-based engine. Based on that, there might be documentation lines like the following:

`--filename-template`: Set filename template in handlebar format. For endpoint: `GET /pets/{id}` using the format: `{{{method}}}-{{{url}}}.json` output will be `get-pets-id.json`. Default format: `{{{method}}}-{{{path}}}-{{{id}}}.json` hence by default template filename will be: `get-pets-id-1.json`.
Note: introduced in [3.0.0-beta-8](https://github.com/wiremock/wiremock/releases/tag/3.0.0-beta-8).

And this macro gets picked up by the plugins, and it results in page rendering failure:

INFO    -  [macros] - ERROR # _Macro Syntax Error_

           _File_: `standalone/java-jar.md`

           _Line 172 in Markdown file:_ **expected token ':', got '}'**
           ```markdown
           `--filename-template`: Set filename template in handlebar format. For endpoint: `GET /pets/{id}` using the format:
           `{{{method}}}-{{{url}}}.json` output will be `get-pets-id.json`. Default format: `{{{method}}}-{{{path}}}-{{{id}}}.json` hence by default
           template filename will be: `get-pets-id-1.json`.
           ```

Warnings during the build

WARNING -  A relative path to 'dotgithub/SECURITY.md' is included in the 'nav' configuration, which is not found in the documentation files.
INFO    -  [macros] - ERROR # _Macro Syntax Error_

           _File_: `configuration.md`

           _Line 239 in Markdown file:_ **expected token ':', got '}'**
           ```markdown
           For instance for endpoint `PUT /hosts/{id}` and format `{{{method}}}-{{{request.url}}}.json`
           ```
WARNING -  Doc file 'download-and-installation.md' contains a relative link './running-standalone.md', but the target 'running-standalone.md' is not
           found among documentation files.
INFO    -  [macros] - ERROR # _Macro Syntax Error_

           _File_: `grpc.md`

           _Line 80 in Markdown file:_ **expected token 'end of print statement', got 'request'**
           ```markdown
                           "{ \"greeting\": \"Hello {{jsonPath request.body '$.name'}}\" }")));
           ```
INFO    -  Doc file 'participate.md' contains an unrecognized relative link '../support', it was left as is.
INFO    -  Doc file 'proxying.md' contains an unrecognized relative link '../api/#tag/System/paths/~1__admin~1settings/post', it was left as is.
INFO    -  [macros] - ERROR # _Macro Syntax Error_

           _File_: `standalone/java-jar.md`

           _Line 170 in Markdown file:_ **expected token ':', got '}'**
           ```markdown
           `--filename-template`: Set filename template in handlebar format. For endpoint: `GET /pets/{id}` using the format:
           `{{{method}}}-{{{url}}}.json` output will be `get-pets-id.json`. Default format: `{{{method}}}-{{{path}}}-{{{id}}}.json` hence by default
           template filename will be: `get-pets-id-1.json`.
           ```
INFO    -  [SASS] Build CSS "assets/stylesheets/extra-style.hiztdwb7.min.css" from "extra_sass/style.css.scss"
@fralau
Copy link
Owner

fralau commented Nov 28, 2023

This documentation page provides a number of possible approaches to controlling the rendering of pages. Solution 4 might do it for you?

@fralau fralau added the info required Further information is requested label Nov 28, 2023
@oleg-nenashev
Copy link
Contributor Author

@fralau Indeed, option 4 works. I saw it, but didn't think it could work for inline definitions. Indeed it does: wiremock/wiremock.org@9fcfe90

@fralau fralau added solved The issue has been satisfactorily solved and removed info required Further information is requested labels Nov 28, 2023
@fralau
Copy link
Owner

fralau commented Nov 28, 2023

Problem solved, documentation updated.

@fralau fralau closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved The issue has been satisfactorily solved
Projects
None yet
Development

No branches or pull requests

2 participants