kovetskiy/mark

`<!-- Include: disclaimer.md -->` does not work

Closed this issue · 8 comments

What happened?
When I use <!-- Include: ../../disclaimer.md --> to include a disclaimer in the generated Confluence pages, the disclaimer does not show up.

What did you expect to happen?
I expected the text in the disclaimer.md file to be included in the generated Confluence pages, at the beginning of the page.

How can we reproduce the behavior you experienced?
Steps to reproduce the behavior:

  1. Take an example markdown file with the necessary frontmatter, including the <!-- Include: disclaimer.md --> parameter.
  2. Create a disclaimer.md file containing the desired text, and make sure that the path to the file in the frontmatter is correct.
  3. Push the example file to Confluence using Mark.
  4. Check the resulting page in Confluence. You will see that the disclaimer text was not included in the page.

In case this is related to specific markdown, please provide a minimal markdown example here.

** Information (please complete the following information):**

  • Mark Version (mark --version): 9.2.1
  • Mark Parameters: --debug --trace --title-from-h1 --drop-h1 -c ~/.config/mark -u <my_username> -p <my_token> -b <my_confluence_url> -f "docs/Knowledge-Base/Getting-Started/Automox-University.md"
  • Confluence Version: Confluence Cloud 1000.0.0-cf97bbfc2268
  • Environment specific Information: macOS Ventura 13.3.1, M1 Macbook Pro, mark installed using Brew

** Logs or other output**
image

Additional context
Add any other context about the problem here.

mrueg commented
  • Can you try moving disclaimer into the same directory level and see if this works?

  • Include should add it in the rendered markdown if it finds the file. Can you take a look there and tell me how it looks?

I'm running into this as well.
I've duplicated the template in root of repository, docs directory and the nested directory. No luck.

The cli with --debug isn't showing anything about the template path either.

I have tried moving it to the same directory level, however this results in the disclaimer being rendered as a stand-alone article and still not included in the articles where it is called out.

mrueg commented

Can you try

mark --space Test --title-from-h1 --trace --debug --compile-only -f README.md

with the following files:

README.md

# Test
<!-- Include: disclaimer.md -->

disclaimer.md

This is a test include.

and share the output of mark here?

ryankitchen@MacBook-Pro-2 docs % cd ~/test
ryankitchen@MacBook-Pro-2 test % ls
mark
ryankitchen@MacBook-Pro-2 test % touch README.md
ryankitchen@MacBook-Pro-2 test % vim README.md
ryankitchen@MacBook-Pro-2 test % touch disclaimer.md
ryankitchen@MacBook-Pro-2 test % vim disclaimer.md
ryankitchen@MacBook-Pro-2 test % mark --space Test --title-from-h1 --trace --debug --compile-only -f README.md
2023-05-08 15:49:19.258 INFO  processing README.md
2023-05-08 15:49:19.260 TRACE loaded macro "@\\{([^}]+)\\}"
                              ├─ template: ac:link:user
                              ├─ expr: @\{([^}]+)\}
                              └─ config:
                                      Name: ${1}
2023-05-08 15:49:19.260 TRACE including template "disclaimer.md"
                              └─ path: disclaimer.md
2023-05-08 15:49:19.260 TRACE rendering markdown:
                              # Test
                              This is a test include.


2023-05-08 15:49:19.261 TRACE rendered markdown to html:
                              <h1 id="test">Test</h1>

                              <p>This is a test include.</p>

<h1 id="test">Test</h1>

<p>This is a test include.</p>

ryankitchen@MacBook-Pro-2 test %

I have found that the disclaimer is only included if it is after the header (using -title-from-h1 and --drop-h1). It does not work before, perhaps a warning would be helpful?

works:

# hi
<!-- Include: disclaimer.md -->

hello.

does not work:

<!-- Include: disclaimer.md -->
# hi

hello.

It looks like the bug has been fixed (I don't know which commit), so this issue should be closed.

mrueg commented

Thanks for the info