kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Apache License 2.0
993 stars 148 forks source link

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

Closed AX-LLaidley closed 3 weeks ago

AX-LLaidley commented 1 year ago

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):

Logs or other output image

Additional context Add any other context about the problem here.

mrueg commented 1 year ago
sheldonhull commented 1 year ago

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.

AX-LLaidley commented 1 year ago

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 1 year ago

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?

joyfulrabbit commented 1 year ago
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 %
barryoneill commented 9 months ago

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.
AlexanderTheGrey commented 3 weeks ago

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

mrueg commented 3 weeks ago

Thanks for the info