tag:support.markedapp.com,2011-09-11:/discussions/questions/9073-automatically-decrement-header-levels-with-multi-document-linkingMarked: Discussion 2018-01-11T12:51:06Ztag:support.markedapp.com,2011-09-11:Comment/444802352018-01-10T14:24:55Z2018-01-10T14:24:55ZAutomatically decrement header levels with multi-document linking?<div><p>This can't be done using Marked's custom include syntax, but it can be accomplished using the <a href="http://marked2app.com/help/Multi-File_Documents.html#mmd_merge">mmd_merge syntax that Marked supports</a>. Create an index file that contains nothing but filenames/paths and put <code>#merge</code> in the first line. You can then use indentation to manually adjust header levels:</p>
<pre>
<code>#merge
index.md
part1.md
part2.md
part3.md</code>
</pre>
<p>So if part1, 2 and 3.md have first level headers, it would now show up in the compiled document with a second-level header, and any subsequent headers within the file are decremented appropriately.</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/444802352018-01-10T16:10:07Z2018-01-10T16:10:07ZAutomatically decrement header levels with multi-document linking?<div><p>That's great, and very useful! One problem is that I'm using Discount processing primarily due to its image scaling capabilities. I don't suppose you know if Discount supports #merge?</p>
<p>Thanks again for the FAST response...</p></div>david.veldhousetag:support.markedapp.com,2011-09-11:Comment/444802352018-01-10T16:52:28Z2018-01-10T16:52:28ZAutomatically decrement header levels with multi-document linking?<div><p>The merge is built into marked, it just compiles the document before passing it to whatever processor you're using.</p>
<ul>
<li>Brett</li>
</ul></div>Bretttag:support.markedapp.com,2011-09-11:Comment/444802352018-01-11T02:16:40Z2018-01-11T02:16:40ZAutomatically decrement header levels with multi-document linking?<div><p>I see. That seems to work as advertised, thanks.</p>
<p>Of course, I want my cake and eat it too:</p>
<p>I can't build a dynamic table of contents this way like I can with Mark's slick "include" syntax, can I?</p></div>david.veldhousetag:support.markedapp.com,2011-09-11:Comment/444802352018-01-11T02:21:11Z2018-01-11T02:21:40ZAutomatically decrement header levels with multi-document linking?<div><p>Actually, I think I just answered my own question: putting the <!--TOC--> in the first document after the #merge command seems to work!</p></div>david.veldhousetag:support.markedapp.com,2011-09-11:Comment/444802352018-01-11T02:24:37Z2018-01-11T02:24:37ZAutomatically decrement header levels with multi-document linking?<div><p>You can't stick a toc tag into the merge file, but you can create a toc.txt (or whatever) with a <!--toc--> tag in it and insert it where you want in the merged document.</p>
<ul>
<li>Brett</li>
</ul></div>Bretttag:support.markedapp.com,2011-09-11:Comment/444802352018-01-11T12:51:03Z2018-01-11T12:51:03ZAutomatically decrement header levels with multi-document linking?<div><p>Yes, I ended up getting exactly the output I wanted. Thanks so much for the attention, Brett.</p></div>david.veldhouse