• lennivelkant@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 day ago

    If you put things in triple backticks ```, it’s formatted as a code block

    Like this
    

    I believe you can specify a language for syntax highlighting at the start of the code block.

    SELECT * 
    FROM passwords
    WHERE storage_method = 'plaintext' 
    -- TODO rename storage method to something less obvious so the IT-Sec guys get off my case
    
    <p class="bold">Stop storing password in plain text, dammit</div>
    <!-- TODO clean up the tags so the linter stops complaining -->
    
    if (true) this.code.makeCringe(this.reader);
    else 
        { 
    throw new NullPointerException("Unreachable code"); }
    // Why, yes, I do love creating terrible code
    

    I don’t know what or how it guesses the language otherwise.

    if (highlighting == "Python"): 
      System.out.println("Wait, that's not a Python command");
      std::cout << "Also not Python"
      print("This one is")
    
    CASE highlighting 
      WHEN 'SQL' THEN 'I dont know any dialect-specific ways to check which one this is'
      WHEN 'sql' THEN 'Apparently its case-sensitive' 
      ELSE 'No clue' 
    END 
    
    (concatenate 'string "I can't be arsed to try everything I know" "So this will have to do")