kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Other
977 stars 143 forks source link

[Feature] Ignore First Comment #366

Open maeghan-porter opened 9 months ago

maeghan-porter commented 9 months ago

Is your feature request related to a problem? Please describe. As many companies do, my company insists on us having copyright license headers at the tops of all of our files. This breaks the functionality of the tool since the license header is an HTML comment just like the tool is looking for to define the parameters for the file.

Describe the solution you'd like It would be nice to have an option to skip the first HTML comment in the file which would accommodate license headers.

Describe alternatives you've considered I can only think to remove the license headers to make it work, which is obviously not ideal.

Additional context It's pretty straight forward 🤷‍♀️ This is a great tool though!

Skeeve commented 9 months ago

Just today I finished an internal script which takes care of publishing my documentation to our internal Confluence upon push into main.

My markdown files do not contain the space nor the parent information and start directly with h1.

All the mark-stuff is put at the front before the file is published.

Maybe this is an option for you as well? Creating a publish script which takes care of putting all the configuration stuff at the top of the file?

maeghan-porter commented 9 months ago

Just today I finished an internal script which takes care of publishing my documentation to our internal Confluence upon push into main.

My markdown files do not contain the space nor the parent information and start directly with h1.

All the mark-stuff is put at the front before the file is published.

Maybe this is an option for you as well? Creating a publish script which takes care of putting all the configuration stuff at the top of the file?

Hmm yes, that could be an option! This would still be a nice feature to have though :) But thanks for sharing the idea!

Skeeve commented 9 months ago

Easiest would be to introduce a new header like:

<!--#: this will be ignored by mark -->

or, more specific to your use case

<!-- Copyright: …
mrueg commented 9 months ago

it likely can be solved with a more generic solution like: https://github.com/kovetskiy/mark/issues/317

maeghan-porter commented 9 months ago

The generic solution is cool but unfortunately wouldn't work in my specific case, I don't think. We have automation that looks for the license header at the tops of our files. And that same automation will inject it at the top of it isn't found there. That's why a simple "ignore the very first comment you find" would have been nice, since I think it's quite common for license headers to be one big html comment block:

<!--

    Copyright (c) 2011-present blahblahblha
    blahblahblah
    ...

-->

But I can see how the generic version would be sufficient for most.