Zettelkasten Forum


<!-- --> How to use this

edited November 2021 in The Archive

I'm not a coder, but I'd like to able to "comment out" sections of a file (like a part of a video script I decided not to use but don't want to delete).

I see that I can open with !-- and close with -- in The Archive. I read somewhere that sometimes markdown wants three dashes at the beginning. What say you?

If I want to comment out a paragraph, is this a good way to do it?

!-- THIS PART SUCKS
Here is a bad paragraph.
Blah blah blah. --

EDIT: I had to remove the "<" and ">" because it commented out most of my post 😂

Comments

  • To clarify, is this image the way to do it?

  • @joegilder Great question; I'm interested in learning the answer as well :smile:

  • Yeah, that's how it works :)

    Some editors don't recognize multi-line comments, only in-line, so if you have line breaks in e.g. block like this:

    <!-- start
    
    middle
    
    end
    -->
    

    ... then some editors will not show a different color for the block.

    But the relevant Markdown tools to transform Markdown into HTML, PDF, LaTeX etc. usually do. Editors often just have trouble with syntax highlighting for this. (It's not as easy as it looks, I can say from experience ;))


    @sfast and I comment in article and book drafts extensively to collaborate. It's super useful, also to leave reminders to your future self when you write longer pieces.

    Author at Zettelkasten.de • https://christiantietze.de/

  • That's helpful, Thanks @ctietze

    I couldn't remember how to do code. Silly me.

  • I notice (and found this by accident) that if I bracket lines with ---, the lines do not appear when I preview them. For example, if I type:

    ---
    Line 1  
    Line 2  
    Line 3
    ---
    

    The three lines and the enclosing --- do not appear in a preview.

    Is this expected behaviour?

  • One issue I ran into is that when I type two short dashes in a row, The Archive wants to turn those into one long dash, which messes up how the characters are interpreted in Markdown. Or maybe it is the Mac OS that is doing the conversion?

  • Try escaping with a backslash, somewhere. Example:

    <!--

    No comment.

    -->

    Was rendered with

    <\!--

    No comment.

    \-->

    ZK implemented with Zettlr+Pandoc+MikTeX+Zotero+BetterBibTex. Erdös #2.

  • @GeoEng51, this is a feature of macOS.

    The "one long dash" is called an em dash, a typeface term for a longer en dash. The em dash is useful as a punctuation mark in some writing genera. You can turn this on or off by application in the "Edit -->Subsitutions" menu.

    Will Simpson
    I'm a futzing, second-guessing, backtracking, compulsive oversharing, ZK-maniac, in other words, your typical zettelnant.
    Research areas: Attention Horizon, Productive Procrastination, Dzogchen, Non-fiction Creative Writing, Cognitive Workload, Python, Data Science
    kestrelcreek.com

  • @DavidWJ said:
    I notice (and found this by accident) that if I bracket lines with ---, the lines do not appear when I preview them. For example, if I type:

    ---
    Line 1  
    Line 2  
    Line 3
    ---
    

    The three lines and the enclosing --- do not appear in a preview.

    Is this expected behaviour?

    Yes. Three dashes are markdown for page break.

    The following line


    was created by the three dashes "---"

    I am a Zettler

  • @DavidWJ Depending on what you use for preview, this could also be interpreted as a metadata block, but that's usually only supposed to work at the beginning of a document.

    Author at Zettelkasten.de • https://christiantietze.de/

  • Thank you all.

Sign In or Register to comment.