Logs for #nikola for 2020-11-10

16:15:17 <ChrisWarrick> KwBot: ping
16:15:17 <KwBot> ChrisWarrick: pong
17:04:22 <prg318> What's the recommended way to get a block of preformatted text in a Nikola post?  Usually I can surround a code block in markdown with ```, but that doesn't seem to work with markdown posts in nikola.  ``` actually does pretty close to what I want in RST, but one of the `'s get printed
17:06:56 <prg318> .. code-block:: seems to work okay, but I really just need preformatted text; I don't need highlighting or line numbers
17:10:07 <prg318> Looks like RST's :: does pretty much what I need.. But i'm still not sure how to do preformatted in a markdown nikola post
18:36:20 <ChrisWarrick> prg318: in reST, we recommend .. code::  or .. code-block::
18:37:18 <ChrisWarrick> prg318: for Markdown, see https://python-markdown.github.io/extensions/code_hilite/ and https://python-markdown.github.io/extensions/fenced_code_blocks/
19:10:53 <prg318> Thanks ChrisWarrick - that's what I thought.. But why do these fenced code blocks show up with a red border around them? https://blog.xannode.com/posts/testing-markdown-fenced-code-blocks.html#
19:11:58 <ChrisWarrick> prg318: it tried to auto-detect a programming language, it picked something but then your code is not valid in that language
19:12:33 <ChrisWarrick> prg318: for plain text, you could use the four-spaces syntax of classic markdown, or one of the code block forms that lets you specify `text` explicitly
19:13:41 <prg318> That doesn't seem to be the case.  I updated this example - the second code block is 4 spaces: https://blog.xannode.com/posts/testing-markdown-fenced-code-blocks.html#
19:13:55 <prg318> even using classic markdown four space syntax, it still gets surrounded in a red border for some reason
19:14:48 <prg318> I'm really looking to do blocks of preformatted text: not necessarily code
19:15:57 <ChrisWarrick> then use one of the other forms
19:16:11 <prg318> That's my question :)  What form can I use in markdown for preformatted text?
19:16:55 <prg318> Because all of the ones that I am aware of are putting this strange red border around it in nikola even though they render fine everywhere else.  Is there a way to turn this code highlighting feature off in niokla maybe?
19:17:04 <prg318> Or is there another way to do preformatted text?
19:18:06 <prg318> https://commonmark.org/help/
19:18:15 <prg318> I don't see another form in here for preformatted text; although I may be missing something
19:25:15 <prg318> Maybe it's a bug in nikola's markdown parser?  But i'm pretty new to this project - which is why i'm asking in here:)
19:27:32 <prg318> ChrisWarrick: So you mention that's markdown is trying to auto detect a language.. Do you know how I would specify one in a ``` block or four-space block
19:27:53 <ChrisWarrick> prg318: this is not a bug
19:28:01 <ChrisWarrick> prg318: python-markdown is not commonmark
19:28:11 <ChrisWarrick> prg318: https://python-markdown.github.io/extensions/code_hilite/ tells you how to specify a language
19:30:19 <prg318> What i'm saying is that even using what is suggested in the code-hilite link that you mentioned is that it still shows up with a red border: https://blog.xannode.com/posts/testing-markdown-fenced-code-blocks.html
19:30:27 <prg318> https://blog.xannode.com/posts/testing-markdown-fenced-code-blocks.md
19:30:50 <ChrisWarrick> prg318: specify :::text explicitly
19:30:53 <prg318> CodeHilite is completely backwards compatible so that if a code block is encountered that does not define a language, the block is simply wrapped in <pre> tags and output.
19:31:51 <ChrisWarrick> prg318: the docs seem a bit contradictory
19:32:15 <prg318> Aha!  That's it.  So I guess if you want to do non-code preformatted blocks in markdown, you have to prefix a space indented block a  :::text   line
19:32:16 <ChrisWarrick> prg318: guess_lang is set to True by default, which disables that
19:32:21 <prg318> Aha okay
19:32:56 <ChrisWarrick> depending on your needs, you might pick a different markdown library (we support a handful, see plugins.getnikola.com)
19:34:28 <ChrisWarrick> You can also use ```text   without indentation
19:35:05 <prg318> I was getting the code highlting red when using ```\ntext\n```, but i'll try it without the newlines
19:36:18 <prg318> Ah!  That's perfect ChrisWarrick .  Thank you - that's just what I was looking for.  Without the newline in between ``` and the beginning of the content, it doesn't try to do code highlighting
19:36:29 <ChrisWarrick> you’re welcome!
19:36:36 <ChrisWarrick> and this does not seem to be the case?
19:37:00 <ChrisWarrick> no newlines seems to create an inline block (`foo`) for me
19:38:31 <prg318> I'm referring to something like  ```Text goes here \n More text\n More text```
19:39:25 <ChrisWarrick> yes, this is an inline code block
19:39:28 <ChrisWarrick> this isn’t what you want
19:40:09 <prg318> what's the difference?  I see that's its slightly different (white text in the theme i'm using) and not totally indented (second group of lines on this page) https://blog.xannode.com/posts/testing-markdown-fenced-code-blocks.html
19:40:33 <prg318> It *does* retain spaces and newlines; which is my primary goal
19:40:42 <prg318> But it might not be doing what I think it's doing
19:44:30 <ChrisWarrick> prg318: this looks good only because your theme is doing something non-standard
19:44:39 <prg318> I was afraid of that
19:45:10 <ChrisWarrick> (and I would argue that code { white-space: pre; } is wrong
19:45:12 <ChrisWarrick> )
19:45:21 <prg318> Aha - I see now.. I just re-rendered my page with the default theme and I see what you mean now
19:46:24 <prg318> I can learn and use RST... But I do feel like there should be a way to do non-highlighted markdown preformatted sections without having to use :::text
19:49:56 <prg318> Or maybe there's some way that I can disable code_hilite's guess_lang in my nikola project somehow
20:05:24 <prg318> Looks like you can tell CodeHilite to not guess a language (which prevents it from highlighting plain text red) by passing options to codehilite in the fenced code block like: ``` { .lang guess_lang=False title="An Example Code Block" }
20:05:32 <prg318> But at that point, it's easier to just specify :::text
20:07:06 <prg318> It would be really cool if you could configure codehilite's default options in a nikola configuration.
23:55:32 <ChrisWarrick> KwBot: ping
23:55:32 <KwBot> ChrisWarrick: pong