griptape-ai / griptape-trade-school

Griptape Trade School mkdocs
4 stars 5 forks source link

Fix code highlighting after code formatting changes #16

Closed wemoveon2 closed 1 year ago

wemoveon2 commented 1 year ago

oops, #9 merged code formatting changes which made the code highlighting weird.

https://learn.griptape.ai/courses/chatbot-rulesets/10_markdown_madness/#__codelineno-6-29 should be highlighted

https://learn.griptape.ai/courses/chatbot-rulesets/11_gleaming_the_chat/#__codelineno-4-68 should be highlighted https://learn.griptape.ai/courses/chatbot-rulesets/11_gleaming_the_chat/#color highlight in code example should be moved down a line https://learn.griptape.ai/courses/chatbot-rulesets/11_gleaming_the_chat/#__codelineno-4-49 should be removed https://learn.griptape.ai/courses/chatbot-rulesets/11_gleaming_the_chat/#__codelineno-4-51 highlight should be moved down a line https://learn.griptape.ai/courses/chatbot-rulesets/11_gleaming_the_chat/#__codelineno-4-68 should be highlighted

https://learn.griptape.ai/courses/chatbot-rulesets/12_multiple_personas/#__codelineno-4-84 highlights should be moved down a line

https://learn.griptape.ai/courses/chatbot-rulesets/13_adding_personality_colors/#use-it should have highlight moved down a line https://learn.griptape.ai/courses/chatbot-rulesets/13_adding_personality_colors/#use-it_1 should have highlights moved down a line https://learn.griptape.ai/courses/chatbot-rulesets/13_adding_personality_colors/#__codelineno-7-80 should have highlights moved down a line

shhlife commented 1 year ago

Hi @wemoveon2 - did you make these changes in the site/ html code or in the markdown files?

wemoveon2 commented 1 year ago

changes were made to the HTML files

shhlife commented 1 year ago

Okay, unfortunately changes to the html files will get overwritten when we do a mkdocs build. Is it possible to make them to the .md files instead?

To highlight specific lines, make sure to use the hl_lines option in the code section.

Here's the documentation from mkdocs on how to do it: https://squidfunk.github.io/mkdocs-material/reference/code-blocks/?h=code#highlighting-specific-lines

I found that the easiest way for me to know what line numbers to highlight was to first enable line numbers so I could see exactly which lines need to be highlighted, then add hl_lines="1-4, 8, 18", etc.

wemoveon2 commented 1 year ago

@shhlife changes made to .md