abessman | 2022-11-09 16:49:47 UTC | #1 Discourse automatically converts ASCII quotation marks (" ") to curlies (“ ”) when placed around text, except inside code blocks. For example, here I'm typing the same thing twice: "Hello world", `"Hello world"`. As you can see, outside the code block the quotation marks turned curly. Since newcomers often fail at properly putting their code inside code blocks, this "feature" makes it more difficult than necessary to copy their code when trying to reproduce a problem. If possible, this conversion should be disabled. ------------------------- zware | 2022-11-09 17:08:20 UTC | #2 Curly quotes are the least of your problems; all indentation is stripped :slight_smile: Ideally, users would use code blocks correctly (as is suggested when they try to post), but if you want to try to help someone who didn't, you can get the raw text of their post by replacing `/t/whatever-the-topic-slug-is/` portion of the URL with `/raw/`: see your post at [`https://discuss.python.org/raw/20904`](https://discuss.python.org/raw/20904). Personally, I wish that view was made more easily findable; as far as I know, there's no way to reach it via the UI, but instead manual URL manipulation is required. ------------------------- bryevdv | 2022-11-09 17:18:13 UTC | #3 Given that unformatted code would still unusable (indentation, etc), I don't see what benefit removing the nice formatting from non-code test offers. Personally I just refuse to spend effort on questions until/unless code gets formatted. Supposedly there was a plugin installed that would try to detect unformatted code, and pop up a modal dialog to prompt the user to correct it, but if so, it does not seem to be very successful. Does Discourse have a an mandatory onboarding flow that could be enabled? e.g. show new users how to make a formatted code block, and make them literally type one in correctly in some dialog before they are allowed to post for the first time? ------------------------- abessman | 2022-11-09 19:32:22 UTC | #4 The lost indentation is a bigger problem, but also harder to do anything about. The quotation marks are a hurdle, albeit minor, and if possible I don't see the downside to removing it. IMO the typographic benefits of curly quotation marks over straight are minor at best. [quote="Zachary Ware, post:2, topic:20904, full:true, username:zware"] you can get the raw text of their post by replacing `/t/whatever-the-topic-slug-is/` portion of the URL with `/raw/` [/quote] That's very useful, thanks! [quote="Bryan Van de Ven, post:3, topic:20904, full:true, username:bryevdv"] Does Discourse have a an mandatory onboarding flow that could be enabled? e.g. show new users how to make a formatted code block, and make them literally type one in correctly in some dialog before they are allowed to post for the first time? [/quote] This would perhaps be the ideal solution. Such a plugin doesn't seem to exist, unfortunately. ------------------------- jeanas | 2022-11-09 19:44:12 UTC | #5 See https://discuss.python.org/t/unformatted-code-detector/16739 though. ------------------------- abessman | 2022-11-09 19:46:55 UTC | #6 Yes, but as Bryan noted, that has only been moderately successful. People are still posting unformatted code in the 'Help' section every day. ------------------------- jeanas | 2022-11-09 19:47:34 UTC | #7 Oh, I'm sorry. I wasn't paying enough attention and misread Bryan's post. ------------------------- jeanas | 2022-11-09 19:54:51 UTC | #8 Well, but is the plugin actually installed? Can you point me to where admins announced this? I wanted to see how it looked like, but trying the exact same example as on https://meta.discourse.org/t/unformatted-code-detector/112773 in https://discuss.python.org/t/unformatted-code-detector/16739/4?u=jeanas, the post got sent without any warning... ------------------------- abessman | 2022-11-09 20:01:34 UTC | #9 Hmm, I could have sworn I've seen that warning myself previously, but indeed, no warning now. Strange. ------------------------- bryevdv | 2022-11-09 20:13:25 UTC | #10 > This would perhaps be the ideal solution. Such a plugin doesn’t seem to exist, unfortunately. I opened a discussion on Meta to solicit thoughts, so we will see :man_shrugging: https://meta.discourse.org/t/mandatory-onboarding-training-for-code-formatting/245036 ------------------------- jeanas | 2022-11-09 21:36:39 UTC | #11 Well, it is enabled actually, https://discuss.python.org/t/unformatted-code-detector/16739/8?u=jeanas. If it's not working well, it means their heuristics have many false negatives (I suppose this is not easy to write heuristics for). ------------------------- vbrozik | 2022-11-09 21:48:34 UTC | #12 The *Unformatted Code Detector* plugin works but it does not detect short core :frowning: Few months ago someone also reported that it had not worked for them at all. The proposed mandatory onboarding for code formatting would be great! ------------------------- vbrozik | 2022-11-09 22:20:42 UTC | #13 Meanwhile it could be helpful to create a post just about the code formatting in the welcome category and pin it there: https://discuss.python.org/c/welcome/12 Then we can link it for newcomers when needed instead of writing the same instructions again and again. I have added a section to the already pinned Quick Start message: https://discuss.python.org/t/python-discourse-quick-start/116#how-do-i-post-code-snippets-error-messages-etc-4 ...but I think the section gets lost in the relatively long message and when I link the section of the message it shows the beginning of the message in the preview, not the linked section. You can see the useless preview above. ------------------------- steven.daprano | 2023-02-15 00:22:25 UTC | #14 I see that Meta **immediately** derailed the conversation into the code detector plugin, which is not relevant to your question and does not work at all for people attaching screenshots. This is another example of that horrific techie practice of *not listening to their users* and thinking that they know better: "Hi I am an experienced developer and run a Discourse instance and would like mandatory onboarding." "Oh no, you don't want that, you want this plugin, even though it won't solve your problem." :roll_eyes: Is it worth trying to get that thread restarted, or create a new one? ------------------------- steven.daprano | 2023-02-15 00:29:59 UTC | #15 [quote="Václav Brožík, post:13, topic:20904, username:vbrozik"] I have added a section to the already pinned Quick Start message: [/quote] Pinning that to the Welcome To Discourse topic doesn't help, because newbies don't look at it. They go straight to the Help section and post screenshots of their code. ------------------------- bryevdv | 2023-02-15 16:55:53 UTC | #16 @steven.daprano Id make a new one, referencing the old one, and emphasize that the discussion that developed there about the plugin does not help at all with the case of new users posting images of code (and also the plugin still does not really seem to work in any case) ------------------------- cameron | 2023-02-15 20:56:13 UTC | #17 To be fair, the first response _didn't_ say "You don't want that". It may be that there's no mandatory onboarding available, but the first response at lead suggested a plugin which has some benefit for the underlying problem which motivated the query about mandatory onboarding. Given how often _we_ ask people for the underlying problem they're trying to solve (as opposed to the specific kind of perhaps-weird technical thing a user's trying to make work), this isn't unhelpful. Maybe it would have been nice if the response had said "Discourse doesn't have a mandatory onboarding feature" or "I don't know if that's possible, but this other thing in this problem domain exists". But they _didn't_ say "no you don't want that". Cheers, Cameron Simpson ------------------------- SamSaffron | 2023-03-29 22:32:31 UTC | #18 [quote="Alexander Bessman, post:1, topic:20904, username:abessman"] If possible, this conversion should be disabled. [/quote] Technically ... yes this can be disabled by Discourse admins, we have the setting `enable markdown typographer` which amends a bunch of stuff in cooked: > `Use typography rules to improve readability of text: replace straight quotes ' with curly quotes ’, (c) (tm) with symbols, -- with emdash –, etc` Glad to hear that the unformatted code detector is helping out. [quote="Alexander Bessman, post:6, topic:20904, full:true, username:abessman"] Yes, but as Bryan noted, that has only been moderately successful. People are still posting unformatted code in the ‘Help’ section every day. [/quote] I think there is some opportunity here for some GPT-4 integration to do some smart things here and catch even more of these. The unfortunate thing though is that the APIs are really slow at the moment so this would have to come after the fact. ------------------------- cameron | 2023-03-30 00:19:56 UTC | #19 We have enough problems with Python scoping/control info (and some punctuation) being lost with code posted in "prose" mode. Do we really want an LLM misparsing _on top_ of that? It just feels like a recipe for taking a poster's known-to-have-a-problem code and further mistranscribing it. Unless you're using GPT-4 as some kind of "oh this bit is probably code, not prose" thing, I'd rather rely on some kind of regexpy based heuristic. At least you'd know the basis for the inferences. -------------------------