Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Code bank indentation


chronosalfa's Avatar
510 -15

I have just noticed there is no indentation for the code in the code bank. That renders the Python scripts useless.


Futility's Avatar
:(
80 122

If you don’t mind copying that over to the issues page, I think the devs would appreciate it. Makes things like this easier to manage and track. As for the code bank… ugh. I think it needs a fair bit of love before it’s actually of any use. Unless I’m mistaken, it’s basically just a copy/paste from the old site and probably hasn’t been looked at too much since then.


Mordak's Avatar
Evil Sorcerer
4,025 19

What Futility has said is correct the content of the code bank hasn’t been updated to match the new markdown based content system. It is on our list to go and edit the content in the code bank to correct the format, however we haven’t had time to go and edit the content. We will I just can’t say when as when doing that we will also remove code from the code bank which doesn’t work or is no lonnger needed.


chronosalfa's Avatar
510 -15

Well, the code is categorized based on the language, so it should be easy to use e.g.

print("Hello")

for python code.


chronosalfa's Avatar
510 -15

I am basically suggesting to do the select from the database and then a huge update with the proper markdown markup, should work for most languages there.


Mordak's Avatar
Evil Sorcerer
4,025 19

Unfortunately that wouldn’t work. Due to how the code is stored in the database from the old HBH it will need to be edited line by line to remove the old BBCode and the random html which has been added to the code item due to how the old HBH worked.

We have built a custom markdown rendering system which removes BBCode and replaces custom HTML which is in use across the site. Unfortunately doing the same for the code bank isn’t an option as it isn’t standardised text which needs to be remove as each code bank item has different weird text which has been added.

Hopefully in the next few months we will have the time to edit the code bank to correct this and other issues, along with the editing the articles to be markdown based.


chronosalfa's Avatar
510 -15

Speaking of the code bank. I have noticed my recent submissions are still not available. Is it the same reason the indentation doesn’t work?


Mordak's Avatar
Evil Sorcerer
4,025 19

No they haven’t been reviewed yet. Once they have been accepted they will be published to the code bank.


chronosalfa's Avatar
510 -15

Unfortunately that wouldn’t work. Due to how the code is stored in the database from the old HBH it will need to be edited line by line to remove the old BBCode and the random html which has been added to the code item due to how the old HBH worked.

Could you post some examples of this weird data that was added? There might be a pattern that could be used to remove these.


Mordak's Avatar
Evil Sorcerer
4,025 19

No as there isn’t any reason to share the data or examples of the data. The code bank will be updated and content remove by staff as and when they can.